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

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

Issue 2601843002: Convert more test helpers to base::RunLoop, fix page title checks. (Closed)
Patch Set: Remove unneeded call. Created 3 years, 11 months 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 switches::kEnableTracing)) { 334 switches::kEnableTracing)) {
335 base::trace_event::TraceConfig trace_config( 335 base::trace_event::TraceConfig trace_config(
336 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 336 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
337 switches::kEnableTracing), 337 switches::kEnableTracing),
338 base::trace_event::RECORD_CONTINUOUSLY); 338 base::trace_event::RECORD_CONTINUOUSLY);
339 TracingController::GetInstance()->StartTracing( 339 TracingController::GetInstance()->StartTracing(
340 trace_config, 340 trace_config,
341 TracingController::StartTracingDoneCallback()); 341 TracingController::StartTracingDoneCallback());
342 } 342 }
343 343
344 RunTestOnMainThreadLoop(); 344 {
345 // This can be called from a posted task. Allow nested tasks here, because
346 // otherwise the test body will have to do it in order to use RunLoop for
347 // waiting.
348 base::MessageLoop::ScopedNestableTaskAllower allow(
349 base::MessageLoop::current());
350 RunTestOnMainThreadLoop();
351 }
345 352
346 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 353 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
347 switches::kEnableTracing)) { 354 switches::kEnableTracing)) {
348 base::FilePath trace_file = 355 base::FilePath trace_file =
349 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( 356 base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
350 switches::kEnableTracingOutput); 357 switches::kEnableTracingOutput);
351 // If there was no file specified, put a hardcoded one in the current 358 // If there was no file specified, put a hardcoded one in the current
352 // working directory. 359 // working directory.
353 if (trace_file.empty()) 360 if (trace_file.empty())
354 trace_file = base::FilePath().AppendASCII("trace.json"); 361 trace_file = base::FilePath().AppendASCII("trace.json");
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 use_software_compositing_ = true; 403 use_software_compositing_ = true;
397 } 404 }
398 405
399 bool BrowserTestBase::UsingOSMesa() const { 406 bool BrowserTestBase::UsingOSMesa() const {
400 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); 407 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess();
401 return cmd->GetSwitchValueASCII(switches::kUseGL) == 408 return cmd->GetSwitchValueASCII(switches::kUseGL) ==
402 gl::kGLImplementationOSMesaName; 409 gl::kGLImplementationOSMesaName;
403 } 410 }
404 411
405 } // namespace content 412 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698