| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_ | 5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_ |
| 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_ | 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> |
| 9 #include <ostream> | 10 #include <ostream> |
| 10 #include <string> | 11 #include <string> |
| 11 | 12 |
| 12 #include "base/cancelable_callback.h" | 13 #include "base/cancelable_callback.h" |
| 13 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/memory/scoped_ptr.h" | |
| 16 #include "base/scoped_observer.h" | 16 #include "base/scoped_observer.h" |
| 17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 18 #include "base/threading/non_thread_safe.h" | 18 #include "base/threading/non_thread_safe.h" |
| 19 #include "base/values.h" | 19 #include "base/values.h" |
| 20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 21 #include "content/public/browser/bluetooth_chooser.h" | 21 #include "content/public/browser/bluetooth_chooser.h" |
| 22 #include "content/public/browser/gpu_data_manager_observer.h" | 22 #include "content/public/browser/gpu_data_manager_observer.h" |
| 23 #include "content/public/browser/notification_observer.h" | 23 #include "content/public/browser/notification_observer.h" |
| 24 #include "content/public/browser/notification_registrar.h" | 24 #include "content/public/browser/notification_registrar.h" |
| 25 #include "content/public/browser/render_process_host_observer.h" | 25 #include "content/public/browser/render_process_host_observer.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 const std::string& expected_pixel_hash); | 132 const std::string& expected_pixel_hash); |
| 133 // True if the controller was reset successfully. | 133 // True if the controller was reset successfully. |
| 134 bool ResetAfterLayoutTest(); | 134 bool ResetAfterLayoutTest(); |
| 135 | 135 |
| 136 void SetTempPath(const base::FilePath& temp_path); | 136 void SetTempPath(const base::FilePath& temp_path); |
| 137 void RendererUnresponsive(); | 137 void RendererUnresponsive(); |
| 138 void OverrideWebkitPrefs(WebPreferences* prefs); | 138 void OverrideWebkitPrefs(WebPreferences* prefs); |
| 139 void OpenURL(const GURL& url); | 139 void OpenURL(const GURL& url); |
| 140 void TestFinishedInSecondaryRenderer(); | 140 void TestFinishedInSecondaryRenderer(); |
| 141 bool IsMainWindow(WebContents* web_contents) const; | 141 bool IsMainWindow(WebContents* web_contents) const; |
| 142 scoped_ptr<BluetoothChooser> RunBluetoothChooser( | 142 std::unique_ptr<BluetoothChooser> RunBluetoothChooser( |
| 143 RenderFrameHost* frame, | 143 RenderFrameHost* frame, |
| 144 const BluetoothChooser::EventHandler& event_handler); | 144 const BluetoothChooser::EventHandler& event_handler); |
| 145 | 145 |
| 146 BlinkTestResultPrinter* printer() { return printer_.get(); } | 146 BlinkTestResultPrinter* printer() { return printer_.get(); } |
| 147 void set_printer(BlinkTestResultPrinter* printer) { printer_.reset(printer); } | 147 void set_printer(BlinkTestResultPrinter* printer) { printer_.reset(printer); } |
| 148 | 148 |
| 149 void DevToolsProcessCrashed(); | 149 void DevToolsProcessCrashed(); |
| 150 | 150 |
| 151 // WebContentsObserver implementation. | 151 // WebContentsObserver implementation. |
| 152 bool OnMessageReceived(const IPC::Message& message) override; | 152 bool OnMessageReceived(const IPC::Message& message) override; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 void OnLoadURLForFrame(const GURL& url, const std::string& frame_name); | 209 void OnLoadURLForFrame(const GURL& url, const std::string& frame_name); |
| 210 void OnCaptureSessionHistory(); | 210 void OnCaptureSessionHistory(); |
| 211 void OnCloseRemainingWindows(); | 211 void OnCloseRemainingWindows(); |
| 212 void OnResetDone(); | 212 void OnResetDone(); |
| 213 void OnLeakDetectionDone(const content::LeakDetectionResult& result); | 213 void OnLeakDetectionDone(const content::LeakDetectionResult& result); |
| 214 void OnSetBluetoothManualChooser(bool enable); | 214 void OnSetBluetoothManualChooser(bool enable); |
| 215 void OnGetBluetoothManualChooserEvents(); | 215 void OnGetBluetoothManualChooserEvents(); |
| 216 void OnSendBluetoothManualChooserEvent(const std::string& event, | 216 void OnSendBluetoothManualChooserEvent(const std::string& event, |
| 217 const std::string& argument); | 217 const std::string& argument); |
| 218 | 218 |
| 219 scoped_ptr<BlinkTestResultPrinter> printer_; | 219 std::unique_ptr<BlinkTestResultPrinter> printer_; |
| 220 | 220 |
| 221 base::FilePath current_working_directory_; | 221 base::FilePath current_working_directory_; |
| 222 base::FilePath temp_path_; | 222 base::FilePath temp_path_; |
| 223 | 223 |
| 224 Shell* main_window_; | 224 Shell* main_window_; |
| 225 | 225 |
| 226 // The PID of the render process of the render view host of main_window_. | 226 // The PID of the render process of the render view host of main_window_. |
| 227 int current_pid_; | 227 int current_pid_; |
| 228 | 228 |
| 229 // Tracks if (during the current test) we have already sent *initial* test | 229 // Tracks if (during the current test) we have already sent *initial* test |
| (...skipping 19 matching lines...) Expand all Loading... |
| 249 bool should_override_prefs_; | 249 bool should_override_prefs_; |
| 250 WebPreferences prefs_; | 250 WebPreferences prefs_; |
| 251 | 251 |
| 252 NotificationRegistrar registrar_; | 252 NotificationRegistrar registrar_; |
| 253 | 253 |
| 254 const bool is_leak_detection_enabled_; | 254 const bool is_leak_detection_enabled_; |
| 255 bool crash_when_leak_found_; | 255 bool crash_when_leak_found_; |
| 256 | 256 |
| 257 LayoutTestDevToolsFrontend* devtools_frontend_; | 257 LayoutTestDevToolsFrontend* devtools_frontend_; |
| 258 | 258 |
| 259 scoped_ptr<LayoutTestBluetoothChooserFactory> bluetooth_chooser_factory_; | 259 std::unique_ptr<LayoutTestBluetoothChooserFactory> bluetooth_chooser_factory_; |
| 260 | 260 |
| 261 // Map from frame_tree_node_id into frame-specific dumps. | 261 // Map from frame_tree_node_id into frame-specific dumps. |
| 262 std::map<int, std::string> frame_to_layout_dump_map_; | 262 std::map<int, std::string> frame_to_layout_dump_map_; |
| 263 // Number of ShellViewHostMsg_LayoutDumpResponse messages we are waiting for. | 263 // Number of ShellViewHostMsg_LayoutDumpResponse messages we are waiting for. |
| 264 int pending_layout_dumps_; | 264 int pending_layout_dumps_; |
| 265 | 265 |
| 266 // Renderer processes are observed to detect crashes. | 266 // Renderer processes are observed to detect crashes. |
| 267 ScopedObserver<RenderProcessHost, RenderProcessHostObserver> | 267 ScopedObserver<RenderProcessHost, RenderProcessHostObserver> |
| 268 render_process_host_observer_; | 268 render_process_host_observer_; |
| 269 | 269 |
| 270 // Changes reported by OnLayoutTestRuntimeFlagsChanged that have accumulated | 270 // Changes reported by OnLayoutTestRuntimeFlagsChanged that have accumulated |
| 271 // since PrepareForLayoutTest (i.e. changes that need to be send to a fresh | 271 // since PrepareForLayoutTest (i.e. changes that need to be send to a fresh |
| 272 // renderer created while test is in progress). | 272 // renderer created while test is in progress). |
| 273 base::DictionaryValue accumulated_layout_test_runtime_flags_changes_; | 273 base::DictionaryValue accumulated_layout_test_runtime_flags_changes_; |
| 274 | 274 |
| 275 #if defined(OS_ANDROID) | 275 #if defined(OS_ANDROID) |
| 276 // Because of the nested message pump implementation, Android needs to allow | 276 // Because of the nested message pump implementation, Android needs to allow |
| 277 // waiting on the UI thread while layout tests are being ran. | 277 // waiting on the UI thread while layout tests are being ran. |
| 278 ScopedAllowWaitForAndroidLayoutTests reduced_restrictions_; | 278 ScopedAllowWaitForAndroidLayoutTests reduced_restrictions_; |
| 279 #endif | 279 #endif |
| 280 | 280 |
| 281 DISALLOW_COPY_AND_ASSIGN(BlinkTestController); | 281 DISALLOW_COPY_AND_ASSIGN(BlinkTestController); |
| 282 }; | 282 }; |
| 283 | 283 |
| 284 } // namespace content | 284 } // namespace content |
| 285 | 285 |
| 286 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_ | 286 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_ |
| OLD | NEW |