OLD | NEW |
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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 { | 342 { |
343 // This can be called from a posted task. Allow nested tasks here, because | 343 // This can be called from a posted task. Allow nested tasks here, because |
344 // otherwise the test body will have to do it in order to use RunLoop for | 344 // otherwise the test body will have to do it in order to use RunLoop for |
345 // waiting. | 345 // waiting. |
346 base::MessageLoop::ScopedNestableTaskAllower allow( | 346 base::MessageLoop::ScopedNestableTaskAllower allow( |
347 base::MessageLoop::current()); | 347 base::MessageLoop::current()); |
348 PreRunTestOnMainThread(); | 348 PreRunTestOnMainThread(); |
349 SetUpOnMainThread(); | 349 SetUpOnMainThread(); |
350 bool old_io_allowed_value = false; | 350 bool old_io_allowed_value = false; |
351 if (!disable_io_checks_) | 351 if (!disable_io_checks_) |
352 base::ThreadRestrictions::SetIOAllowed(false); | 352 old_io_allowed_value = base::ThreadRestrictions::SetIOAllowed(false); |
353 RunTestOnMainThread(); | 353 RunTestOnMainThread(); |
354 if (!disable_io_checks_) | 354 if (!disable_io_checks_) |
355 base::ThreadRestrictions::SetIOAllowed(old_io_allowed_value); | 355 base::ThreadRestrictions::SetIOAllowed(old_io_allowed_value); |
356 TearDownOnMainThread(); | 356 TearDownOnMainThread(); |
357 PostRunTestOnMainThread(); | 357 PostRunTestOnMainThread(); |
358 } | 358 } |
359 | 359 |
360 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 360 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
361 switches::kEnableTracing)) { | 361 switches::kEnableTracing)) { |
362 base::FilePath trace_file = | 362 base::FilePath trace_file = |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 use_software_compositing_ = true; | 410 use_software_compositing_ = true; |
411 } | 411 } |
412 | 412 |
413 bool BrowserTestBase::UsingSoftwareGL() const { | 413 bool BrowserTestBase::UsingSoftwareGL() const { |
414 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 414 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
415 return cmd->GetSwitchValueASCII(switches::kUseGL) == | 415 return cmd->GetSwitchValueASCII(switches::kUseGL) == |
416 gl::GetGLImplementationName(gl::GetSoftwareGLImplementation()); | 416 gl::GetGLImplementationName(gl::GetSoftwareGLImplementation()); |
417 } | 417 } |
418 | 418 |
419 } // namespace content | 419 } // namespace content |
OLD | NEW |