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 "net/test/spawned_test_server/spawned_test_server.h" | 10 #include "net/test/spawned_test_server/spawned_test_server.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // this. | 102 // this. |
103 // |test_server_base| is the path, relative to src, to give to the test HTTP | 103 // |test_server_base| is the path, relative to src, to give to the test HTTP |
104 // server. | 104 // server. |
105 void CreateTestServer(const base::FilePath& test_server_base); | 105 void CreateTestServer(const base::FilePath& test_server_base); |
106 | 106 |
107 // When the test is running in --single-process mode, runs the given task on | 107 // When the test is running in --single-process mode, runs the given task on |
108 // the in-process renderer thread. A nested message loop is run until it | 108 // the in-process renderer thread. A nested message loop is run until it |
109 // returns. | 109 // returns. |
110 void PostTaskToInProcessRendererAndWait(const base::Closure& task); | 110 void PostTaskToInProcessRendererAndWait(const base::Closure& task); |
111 | 111 |
112 // Call this before SetUp() to use real GL contexts in Compositor for the | |
113 // test. | |
114 void UseRealGLContexts() { allow_test_contexts_ = false; } | |
115 | |
116 // Call this before SetUp() to use real GL drivers instead of OSMesa for the | |
117 // test. | |
118 void UseRealGLBindings() { allow_osmesa_ = false; } | |
119 | |
120 private: | 112 private: |
121 void ProxyRunTestOnMainThreadLoop(); | 113 void ProxyRunTestOnMainThreadLoop(); |
122 | 114 |
123 // Testing server, started on demand. | 115 // Testing server, started on demand. |
124 scoped_ptr<net::SpawnedTestServer> test_server_; | 116 scoped_ptr<net::SpawnedTestServer> test_server_; |
125 | 117 |
126 // Embedded test server, cheap to create, started on demand. | 118 // Embedded test server, cheap to create, started on demand. |
127 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_; | 119 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_; |
128 | 120 |
129 // When false, the ui::Compositor will be forced to use real GL contexts for | |
130 // the test, so that it produces real pixel output. | |
131 bool allow_test_contexts_; | |
132 | |
133 // When false, the GL backend will use a real GPU. When true, it uses OSMesa | |
134 // to run GL on the CPU in a way that works across all platforms. | |
135 bool allow_osmesa_; | |
136 | |
137 #if defined(OS_POSIX) | 121 #if defined(OS_POSIX) |
138 bool handle_sigterm_; | 122 bool handle_sigterm_; |
139 #endif | 123 #endif |
140 }; | 124 }; |
141 | 125 |
142 } // namespace content | 126 } // namespace content |
143 | 127 |
144 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ | 128 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ |
OLD | NEW |