Revert 179271
> Simplify how TestChromeWebUIControllerFactory is registered now that multiple WebUIControllerFactory instances are supported. Instead of compiling the test code into the shipping product, have tests which use it unregister the default one and register the test one. This also makes the non-test version used for the majority of the test, which keeps the browser_tests more like the shipping product.
> 
> I've also moved the test harness code to chrome\test\base, which is where test harnesses live.
> 
> BUG=169170
> Review URL: https://codereview.chromium.org/12084029

This seems cause a few webui test crashes on Linux ChromiumOS Tests
(dbg)(2) since http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%282%29/builds/6808

I can reproduce the crash on my local machine with CookiesViewWebUITest.*
(Note: not all failing tests can be reproduced but this one has a reliable
reproduce of the crash).
And after I revert this, the crash gone. I am not sure why chromeos try
bots have a green run. 

The crash is:
[17690:17690:0128/215636:6223762366:FATAL:web_ui_impl.cc(84)] Check failed: false. Blocked unauthorized use of WebUIBindings.
[0x7f4eb3da52f0] base::debug::StackTrace::StackTrace()
[0x7f4eb3dda2a3] logging::LogMessage::~LogMessage()
[0x7f4eaf52c45b] content::WebUIImpl::OnWebUISend()
[0x7f4eaf52deaa] DispatchToMethod<>()
[0x7f4eaf52d823] ViewHostMsg_WebUISend::Dispatch<>()
[0x7f4eaf52c28c] content::WebUIImpl::OnMessageReceived()
[0x7f4eaf4fe6e8] content::WebContentsImpl::OnMessageReceived()
[0x7f4eaf444489] content::RenderViewHostImpl::OnMessageReceived()
[0x7f4eaf42f031] content::RenderProcessHostImpl::OnMessageReceived()
[0x7f4eb40109c0] IPC::ChannelProxy::Context::OnDispatchMessage()
[0x7f4eb4014a8b] base::internal::RunnableAdapter<>::Run()
[0x7f4eb4014553] base::internal::InvokeHelper<>::MakeItSo()
[0x7f4eb4013df3] base::internal::Invoker<>::Run()
[0x7f4eb3d9a0cd] base::Callback<>::Run()
[0x7f4eb3de0d21] MessageLoop::RunTask()
[0x7f4eb3de0e3c] MessageLoop::DeferOrRunPendingTask()
[0x7f4eb3de16cd] MessageLoop::DoWork()
[0x7f4eb3d7aee7] base::MessagePumpGlib::HandleDispatch()
[0x7f4eb3d7a557] (anonymous namespace)::WorkSourceDispatch()
[0x7f4ea3adb9d2] g_main_context_dispatch
[0x7f4ea3adf858] <unknown>
[0x7f4ea3adfa0c] g_main_context_iteration
[0x7f4eb3d7aaf4] base::MessagePumpGlib::RunWithDispatcher()
[0x7f4eb3d7afc4] base::MessagePumpGlib::Run()
[0x7f4eb3de0911] MessageLoop::RunInternal()
[0x7f4eb3de07cc] MessageLoop::RunHandler()
[0x7f4eb3e197c6] base::RunLoop::Run()
[0x000003101379] content::RunThisRunLoop()
[0x000003101306] content::RunMessageLoop()
[0x000001b66d64] InProcessBrowserTest::QuitBrowsers()
[0x000001b66c58] InProcessBrowserTest::RunTestOnMainThreadLoop()
[0x0000030bd6dd] content::BrowserTestBase::ProxyRunTestOnMainThreadLoop()
[0x0000030bdb5b] base::internal::RunnableAdapter<>::Run()
[0x0000030bdaf1] base::internal::InvokeHelper<>::MakeItSo()
[0x0000030bdaa9] base::internal::Invoker<>::Run()
[0x000000775215] base::Callback<>::Run()
[0x00000333188c] ChromeBrowserMainParts::PreMainMessageLoopRunImpl()
[0x00000332fe46] ChromeBrowserMainParts::PreMainMessageLoopRun()
[0x000002c50658] chromeos::ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun()
[0x7f4eaf197cba] content::BrowserMainLoop::CreateThreads()
[0x7f4eaf19b57e] content::BrowserMainRunnerImpl::Initialize()
[0x7f4eaf1959f7] content::BrowserMain()
[0x0000030bd662] content::BrowserTestBase::SetUp()
[0x000001b65e1a] InProcessBrowserTest::SetUp()
[0x000001c8072b] testing::internal::HandleSehExceptionsInMethodIfSupported<>()
[0x000001c7de76] testing::internal::HandleExceptionsInMethodIfSupported<>()
[0x000001c7305d] testing::Test::Run()
[0x000001c738d6] testing::TestInfo::Run()
[0x000001c74004] testing::TestCase::Run()
[0x000001c78faf] testing::internal::UnitTestImpl::RunAllTests()
[0x000001c81557] testing::internal::HandleSehExceptionsInMethodIfSupported<>()
[0x000001c7e67d] testing::internal::HandleExceptionsInMethodIfSupported<>()
[0x000001c77a7e] testing::UnitTest::Run()
[0x000001b8183c] base::TestSuite::Run()
[0x000000e6b473] ChromeTestLauncherDelegate::RunTestSuite()
[0x0000030fd3fc] content::LaunchTests()
[0x000000e6b315] main
[0x7f4ea2d7fc4d] __libc_start_main
[0x00000072fc29] <unknown>

TBR=jam@chromium.org
Review URL: https://codereview.chromium.org/12089051

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179347 0039d316-1c4b-4281-b951-d872f2087c98
26 files changed