Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Side by Side Diff: content/public/test/browser_test_base.cc

Issue 83633004: Do not spawn a thread in browser/interactive ui tests before spawning sandbox host process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/test/browser_test_base.h" 5 #include "content/public/test/browser_test_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 switches::kUseGL, gfx::kGLImplementationOSMesaName); 209 switches::kUseGL, gfx::kGLImplementationOSMesaName);
210 } 210 }
211 211
212 scoped_refptr<net::HostResolverProc> local_resolver = 212 scoped_refptr<net::HostResolverProc> local_resolver =
213 new LocalHostResolverProc(); 213 new LocalHostResolverProc();
214 rule_based_resolver_ = 214 rule_based_resolver_ =
215 new net::RuleBasedHostResolverProc(local_resolver.get()); 215 new net::RuleBasedHostResolverProc(local_resolver.get());
216 rule_based_resolver_->AddSimulatedFailure("wpad"); 216 rule_based_resolver_->AddSimulatedFailure("wpad");
217 net::ScopedDefaultHostResolverProc scoped_local_host_resolver_proc( 217 net::ScopedDefaultHostResolverProc scoped_local_host_resolver_proc(
218 rule_based_resolver_.get()); 218 rule_based_resolver_.get());
219
220 SetUpInProcessBrowserTestFixture(); 219 SetUpInProcessBrowserTestFixture();
221
222 MainFunctionParams params(*command_line); 220 MainFunctionParams params(*command_line);
223 params.ui_task = 221 params.ui_task =
224 new base::Closure( 222 new base::Closure(
225 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this)); 223 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this));
226 224
227 #if defined(OS_ANDROID) 225 #if defined(OS_ANDROID)
228 BrowserMainRunner::Create()->Initialize(params); 226 BrowserMainRunner::Create()->Initialize(params);
229 // We are done running the test by now. During teardown we 227 // We are done running the test by now. During teardown we
230 // need to be able to perform IO. 228 // need to be able to perform IO.
231 base::ThreadRestrictions::SetIOAllowed(true); 229 base::ThreadRestrictions::SetIOAllowed(true);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 RenderProcessHostImpl::GetInProcessRendererThreadForTesting(); 268 RenderProcessHostImpl::GetInProcessRendererThreadForTesting();
271 CHECK(renderer_loop); 269 CHECK(renderer_loop);
272 270
273 renderer_loop->PostTask( 271 renderer_loop->PostTask(
274 FROM_HERE, 272 FROM_HERE,
275 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure())); 273 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure()));
276 runner->Run(); 274 runner->Run();
277 } 275 }
278 276
279 } // namespace content 277 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698