| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ |
| 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ | 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 // When the test is running in --single-process mode, runs the given task on | 116 // When the test is running in --single-process mode, runs the given task on |
| 117 // the in-process renderer thread. A nested message loop is run until it | 117 // the in-process renderer thread. A nested message loop is run until it |
| 118 // returns. | 118 // returns. |
| 119 void PostTaskToInProcessRendererAndWait(const base::Closure& task); | 119 void PostTaskToInProcessRendererAndWait(const base::Closure& task); |
| 120 | 120 |
| 121 // Call this before SetUp() to use real GL contexts in Compositor for the | 121 // Call this before SetUp() to use real GL contexts in Compositor for the |
| 122 // test. | 122 // test. |
| 123 void UseRealGLContexts(); | 123 void UseRealGLContexts(); |
| 124 | 124 |
| 125 // Call this before SetUp() to use real GL drivers instead of OSMesa for the | |
| 126 // test. | |
| 127 void UseRealGLBindings(); | |
| 128 | |
| 129 // Call this before SetUp() to not use GL, but use software compositing | 125 // Call this before SetUp() to not use GL, but use software compositing |
| 130 // instead. | 126 // instead. |
| 131 void UseSoftwareCompositing(); | 127 void UseSoftwareCompositing(); |
| 132 | 128 |
| 133 // Returns true if the test will be using GL acceleration via OSMesa. | 129 // Returns true if the test will be using GL acceleration via OSMesa. |
| 134 bool UsingOSMesa() const; | 130 bool UsingOSMesa() const; |
| 135 | 131 |
| 136 private: | 132 private: |
| 137 void ProxyRunTestOnMainThreadLoop(); | 133 void ProxyRunTestOnMainThreadLoop(); |
| 138 | 134 |
| 139 // Testing server, started on demand. | 135 // Testing server, started on demand. |
| 140 scoped_ptr<net::SpawnedTestServer> test_server_; | 136 scoped_ptr<net::SpawnedTestServer> test_server_; |
| 141 | 137 |
| 142 // Embedded test server, cheap to create, started on demand. | 138 // Embedded test server, cheap to create, started on demand. |
| 143 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_; | 139 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_; |
| 144 | 140 |
| 145 // Host resolver used during tests. | 141 // Host resolver used during tests. |
| 146 scoped_refptr<net::RuleBasedHostResolverProc> rule_based_resolver_; | 142 scoped_refptr<net::RuleBasedHostResolverProc> rule_based_resolver_; |
| 147 | 143 |
| 148 // When false, the ui::Compositor will be forced to use real GL contexts for | 144 // When false, the ui::Compositor will be forced to use real GL contexts for |
| 149 // the test, so that it produces real pixel output. | 145 // the test, so that it produces real pixel output. |
| 150 bool allow_test_contexts_; | 146 bool allow_test_contexts_; |
| 151 | 147 |
| 152 // When false, the GL backend will use a real GPU. When true, it uses OSMesa | |
| 153 // to run GL on the CPU in a way that works across all platforms. | |
| 154 bool allow_osmesa_; | |
| 155 | |
| 156 // When true, do compositing with the software backend instead of using GL. | 148 // When true, do compositing with the software backend instead of using GL. |
| 157 bool use_software_compositing_; | 149 bool use_software_compositing_; |
| 158 | 150 |
| 159 #if defined(OS_POSIX) | 151 #if defined(OS_POSIX) |
| 160 bool handle_sigterm_; | 152 bool handle_sigterm_; |
| 161 #endif | 153 #endif |
| 162 }; | 154 }; |
| 163 | 155 |
| 164 } // namespace content | 156 } // namespace content |
| 165 | 157 |
| 166 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ | 158 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ |
| OLD | NEW |