| 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 <memory> |
| 10 #include <ostream> | 10 #include <ostream> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/cancelable_callback.h" | 14 #include "base/cancelable_callback.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/scoped_observer.h" | 17 #include "base/scoped_observer.h" |
| 18 #include "base/sequence_checker.h" |
| 18 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
| 19 #include "base/threading/non_thread_safe.h" | |
| 20 #include "base/values.h" | 20 #include "base/values.h" |
| 21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "content/public/browser/bluetooth_chooser.h" | 22 #include "content/public/browser/bluetooth_chooser.h" |
| 23 #include "content/public/browser/gpu_data_manager_observer.h" | 23 #include "content/public/browser/gpu_data_manager_observer.h" |
| 24 #include "content/public/browser/notification_observer.h" | 24 #include "content/public/browser/notification_observer.h" |
| 25 #include "content/public/browser/notification_registrar.h" | 25 #include "content/public/browser/notification_registrar.h" |
| 26 #include "content/public/browser/render_process_host_observer.h" | 26 #include "content/public/browser/render_process_host_observer.h" |
| 27 #include "content/public/browser/web_contents_observer.h" | 27 #include "content/public/browser/web_contents_observer.h" |
| 28 #include "content/public/common/web_preferences.h" | 28 #include "content/public/common/web_preferences.h" |
| 29 #include "content/shell/common/layout_test.mojom.h" | 29 #include "content/shell/common/layout_test.mojom.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 bool capture_text_only_; | 107 bool capture_text_only_; |
| 108 bool encode_binary_data_; | 108 bool encode_binary_data_; |
| 109 | 109 |
| 110 std::ostream* output_; | 110 std::ostream* output_; |
| 111 std::ostream* error_; | 111 std::ostream* error_; |
| 112 | 112 |
| 113 DISALLOW_COPY_AND_ASSIGN(BlinkTestResultPrinter); | 113 DISALLOW_COPY_AND_ASSIGN(BlinkTestResultPrinter); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 class BlinkTestController : public base::NonThreadSafe, | 116 class BlinkTestController : public WebContentsObserver, |
| 117 public WebContentsObserver, | |
| 118 public RenderProcessHostObserver, | 117 public RenderProcessHostObserver, |
| 119 public NotificationObserver, | 118 public NotificationObserver, |
| 120 public GpuDataManagerObserver { | 119 public GpuDataManagerObserver { |
| 121 public: | 120 public: |
| 122 static BlinkTestController* Get(); | 121 static BlinkTestController* Get(); |
| 123 | 122 |
| 124 BlinkTestController(); | 123 BlinkTestController(); |
| 125 ~BlinkTestController() override; | 124 ~BlinkTestController() override; |
| 126 | 125 |
| 127 // True if the controller is ready for testing. | 126 // True if the controller is ready for testing. |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 | 291 |
| 293 // Map from one frame to one mojo pipe. | 292 // Map from one frame to one mojo pipe. |
| 294 std::map<RenderFrameHost*, mojom::LayoutTestControlAssociatedPtr> | 293 std::map<RenderFrameHost*, mojom::LayoutTestControlAssociatedPtr> |
| 295 layout_test_control_map_; | 294 layout_test_control_map_; |
| 296 #if defined(OS_ANDROID) | 295 #if defined(OS_ANDROID) |
| 297 // Because of the nested message pump implementation, Android needs to allow | 296 // Because of the nested message pump implementation, Android needs to allow |
| 298 // waiting on the UI thread while layout tests are being ran. | 297 // waiting on the UI thread while layout tests are being ran. |
| 299 ScopedAllowWaitForAndroidLayoutTests reduced_restrictions_; | 298 ScopedAllowWaitForAndroidLayoutTests reduced_restrictions_; |
| 300 #endif | 299 #endif |
| 301 | 300 |
| 301 SEQUENCE_CHECKER(sequence_checker_); |
| 302 |
| 302 DISALLOW_COPY_AND_ASSIGN(BlinkTestController); | 303 DISALLOW_COPY_AND_ASSIGN(BlinkTestController); |
| 303 }; | 304 }; |
| 304 | 305 |
| 305 } // namespace content | 306 } // namespace content |
| 306 | 307 |
| 307 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_ | 308 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_ |
| OLD | NEW |