| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // returns. | 114 // returns. |
| 115 void PostTaskToInProcessRendererAndWait(const base::Closure& task); | 115 void PostTaskToInProcessRendererAndWait(const base::Closure& task); |
| 116 | 116 |
| 117 // Call this before SetUp() to cause the test to generate pixel output. | 117 // Call this before SetUp() to cause the test to generate pixel output. |
| 118 void EnablePixelOutput(); | 118 void EnablePixelOutput(); |
| 119 | 119 |
| 120 // Call this before SetUp() to not use GL, but use software compositing | 120 // Call this before SetUp() to not use GL, but use software compositing |
| 121 // instead. | 121 // instead. |
| 122 void UseSoftwareCompositing(); | 122 void UseSoftwareCompositing(); |
| 123 | 123 |
| 124 // Call this before SetUp to run without kAllowFileAccessFromFiles. |
| 125 void RevokeFileAccessFromFiles(); |
| 126 |
| 124 // Returns true if the test will be using GL acceleration via OSMesa. | 127 // Returns true if the test will be using GL acceleration via OSMesa. |
| 125 bool UsingOSMesa() const; | 128 bool UsingOSMesa() const; |
| 126 | 129 |
| 127 private: | 130 private: |
| 128 void ProxyRunTestOnMainThreadLoop(); | 131 void ProxyRunTestOnMainThreadLoop(); |
| 129 | 132 |
| 130 // Testing server, started on demand. | 133 // Testing server, started on demand. |
| 131 std::unique_ptr<net::SpawnedTestServer> spawned_test_server_; | 134 std::unique_ptr<net::SpawnedTestServer> spawned_test_server_; |
| 132 | 135 |
| 133 // Embedded test server, cheap to create, started on demand. | 136 // Embedded test server, cheap to create, started on demand. |
| 134 std::unique_ptr<net::EmbeddedTestServer> embedded_test_server_; | 137 std::unique_ptr<net::EmbeddedTestServer> embedded_test_server_; |
| 135 | 138 |
| 136 // Host resolver used during tests. | 139 // Host resolver used during tests. |
| 137 scoped_refptr<net::RuleBasedHostResolverProc> rule_based_resolver_; | 140 scoped_refptr<net::RuleBasedHostResolverProc> rule_based_resolver_; |
| 138 | 141 |
| 139 // Expected exit code (default is 0). | 142 // Expected exit code (default is 0). |
| 140 int expected_exit_code_; | 143 int expected_exit_code_; |
| 141 | 144 |
| 142 // When true, the compositor will produce pixel output that can be read back | 145 // When true, the compositor will produce pixel output that can be read back |
| 143 // for pixel tests. | 146 // for pixel tests. |
| 144 bool enable_pixel_output_; | 147 bool enable_pixel_output_; |
| 145 | 148 |
| 146 // When true, do compositing with the software backend instead of using GL. | 149 // When true, do compositing with the software backend instead of using GL. |
| 147 bool use_software_compositing_; | 150 bool use_software_compositing_; |
| 148 | 151 |
| 152 // Controls the presence of the kAllowFileAccessFromFiles command line switch. |
| 153 bool allow_file_access_from_files_; |
| 154 |
| 149 // Whether SetUp was called. This value is checked in the destructor of this | 155 // Whether SetUp was called. This value is checked in the destructor of this |
| 150 // class to ensure that SetUp was called. If it's not called, the test will | 156 // class to ensure that SetUp was called. If it's not called, the test will |
| 151 // not run and report a false positive result. | 157 // not run and report a false positive result. |
| 152 bool set_up_called_; | 158 bool set_up_called_; |
| 153 | 159 |
| 154 #if defined(OS_POSIX) | 160 #if defined(OS_POSIX) |
| 155 bool handle_sigterm_; | 161 bool handle_sigterm_; |
| 156 #endif | 162 #endif |
| 157 }; | 163 }; |
| 158 | 164 |
| 159 } // namespace content | 165 } // namespace content |
| 160 | 166 |
| 161 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ | 167 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ |
| OLD | NEW |