| 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 in SetUp() to use real GL contexts in Compositor for the test. |
| 113 void DoNotUseTestContexts() { allow_test_contexts_ = false; } |
| 114 |
| 112 private: | 115 private: |
| 113 void ProxyRunTestOnMainThreadLoop(); | 116 void ProxyRunTestOnMainThreadLoop(); |
| 114 | 117 |
| 115 // Testing server, started on demand. | 118 // Testing server, started on demand. |
| 116 scoped_ptr<net::SpawnedTestServer> test_server_; | 119 scoped_ptr<net::SpawnedTestServer> test_server_; |
| 117 | 120 |
| 118 // Embedded test server, cheap to create, started on demand. | 121 // Embedded test server, cheap to create, started on demand. |
| 119 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_; | 122 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_; |
| 120 | 123 |
| 124 // When false, the ui::Compositor will be forced to use real GL contexts for |
| 125 // the test, so that it produces real pixel output. |
| 126 bool allow_test_contexts_; |
| 127 |
| 121 #if defined(OS_POSIX) | 128 #if defined(OS_POSIX) |
| 122 bool handle_sigterm_; | 129 bool handle_sigterm_; |
| 123 #endif | 130 #endif |
| 124 }; | 131 }; |
| 125 | 132 |
| 126 } // namespace content | 133 } // namespace content |
| 127 | 134 |
| 128 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ | 135 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ |
| OLD | NEW |