Chromium Code Reviews| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 // server. | 113 // server. |
| 114 void CreateTestServer(const base::FilePath& test_server_base); | 114 void CreateTestServer(const base::FilePath& test_server_base); |
| 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() { allow_test_contexts_ = false; } | 123 void UseRealGLContexts(); |
|
sky
2013/12/19 21:35:32
Can we have one setter here? Maybe SetCompositingM
danakj
2013/12/19 21:40:54
Hm, this is a good idea, thanks. I'm actually goin
| |
| 124 | 124 |
| 125 // Call this before SetUp() to use real GL drivers instead of OSMesa for the | 125 // Call this before SetUp() to use real GL drivers instead of OSMesa for the |
| 126 // test. | 126 // test. |
| 127 void UseRealGLBindings() { allow_osmesa_ = false; } | 127 void UseRealGLBindings(); |
| 128 | |
| 129 // Call this before SetUp() to not use GL, but use software compositing | |
| 130 // instead. | |
| 131 void UseSoftwareCompositing(); | |
| 128 | 132 |
| 129 private: | 133 private: |
| 130 void ProxyRunTestOnMainThreadLoop(); | 134 void ProxyRunTestOnMainThreadLoop(); |
| 131 | 135 |
| 132 // Testing server, started on demand. | 136 // Testing server, started on demand. |
| 133 scoped_ptr<net::SpawnedTestServer> test_server_; | 137 scoped_ptr<net::SpawnedTestServer> test_server_; |
| 134 | 138 |
| 135 // Embedded test server, cheap to create, started on demand. | 139 // Embedded test server, cheap to create, started on demand. |
| 136 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_; | 140 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_; |
| 137 | 141 |
| 138 // Host resolver used during tests. | 142 // Host resolver used during tests. |
| 139 scoped_refptr<net::RuleBasedHostResolverProc> rule_based_resolver_; | 143 scoped_refptr<net::RuleBasedHostResolverProc> rule_based_resolver_; |
| 140 | 144 |
| 141 // When false, the ui::Compositor will be forced to use real GL contexts for | 145 // When false, the ui::Compositor will be forced to use real GL contexts for |
| 142 // the test, so that it produces real pixel output. | 146 // the test, so that it produces real pixel output. |
| 143 bool allow_test_contexts_; | 147 bool allow_test_contexts_; |
| 144 | 148 |
| 145 // When false, the GL backend will use a real GPU. When true, it uses OSMesa | 149 // When false, the GL backend will use a real GPU. When true, it uses OSMesa |
| 146 // to run GL on the CPU in a way that works across all platforms. | 150 // to run GL on the CPU in a way that works across all platforms. |
| 147 bool allow_osmesa_; | 151 bool allow_osmesa_; |
| 148 | 152 |
| 153 // When true, do compositing with the software backend instead of using GL. | |
| 154 bool use_software_compositing_; | |
| 155 | |
| 149 #if defined(OS_POSIX) | 156 #if defined(OS_POSIX) |
| 150 bool handle_sigterm_; | 157 bool handle_sigterm_; |
| 151 #endif | 158 #endif |
| 152 }; | 159 }; |
| 153 | 160 |
| 154 } // namespace content | 161 } // namespace content |
| 155 | 162 |
| 156 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ | 163 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ |
| OLD | NEW |