| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 base::SequencedWorkerPool::DisableForProcessForTesting(); | 175 base::SequencedWorkerPool::DisableForProcessForTesting(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 BrowserTestBase::~BrowserTestBase() { | 178 BrowserTestBase::~BrowserTestBase() { |
| 179 #if defined(OS_ANDROID) | 179 #if defined(OS_ANDROID) |
| 180 // RemoteTestServer can cause wait on the UI thread. | 180 // RemoteTestServer can cause wait on the UI thread. |
| 181 base::ThreadRestrictions::ScopedAllowWait allow_wait; | 181 base::ThreadRestrictions::ScopedAllowWait allow_wait; |
| 182 spawned_test_server_.reset(NULL); | 182 spawned_test_server_.reset(NULL); |
| 183 #endif | 183 #endif |
| 184 | 184 |
| 185 CHECK(set_up_called_) << "SetUp was not called. This probably means that the " | 185 // SetUp was not called. This probably means that the developer has overridden |
| 186 "developer has overridden the method and not called " | 186 // the method and not called the superclass version. In this case, the test |
| 187 "the superclass version. In this case, the test " | 187 // does not run and reports a false positive result. |
| 188 "does not run and reports a false positive result."; | 188 CHECK(set_up_called_); |
| 189 } | 189 } |
| 190 | 190 |
| 191 void BrowserTestBase::SetUp() { | 191 void BrowserTestBase::SetUp() { |
| 192 set_up_called_ = true; | 192 set_up_called_ = true; |
| 193 // ContentTestSuiteBase might have already initialized | 193 // ContentTestSuiteBase might have already initialized |
| 194 // MaterialDesignController in browser_tests suite. | 194 // MaterialDesignController in browser_tests suite. |
| 195 // Uninitialize here to let the browser process do it. | 195 // Uninitialize here to let the browser process do it. |
| 196 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); | 196 ui::test::MaterialDesignControllerTestAPI::Uninitialize(); |
| 197 | 197 |
| 198 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 198 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 use_software_compositing_ = true; | 396 use_software_compositing_ = true; |
| 397 } | 397 } |
| 398 | 398 |
| 399 bool BrowserTestBase::UsingOSMesa() const { | 399 bool BrowserTestBase::UsingOSMesa() const { |
| 400 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 400 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
| 401 return cmd->GetSwitchValueASCII(switches::kUseGL) == | 401 return cmd->GetSwitchValueASCII(switches::kUseGL) == |
| 402 gl::kGLImplementationOSMesaName; | 402 gl::kGLImplementationOSMesaName; |
| 403 } | 403 } |
| 404 | 404 |
| 405 } // namespace content | 405 } // namespace content |
| OLD | NEW |