| 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> |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 ~BlinkTestController() override; | 127 ~BlinkTestController() override; |
| 128 | 128 |
| 129 // True if the controller is ready for testing. | 129 // True if the controller is ready for testing. |
| 130 bool PrepareForLayoutTest(const GURL& test_url, | 130 bool PrepareForLayoutTest(const GURL& test_url, |
| 131 const base::FilePath& current_working_directory, | 131 const base::FilePath& current_working_directory, |
| 132 bool enable_pixel_dumping, | 132 bool enable_pixel_dumping, |
| 133 const std::string& expected_pixel_hash); | 133 const std::string& expected_pixel_hash); |
| 134 // True if the controller was reset successfully. | 134 // True if the controller was reset successfully. |
| 135 bool ResetAfterLayoutTest(); | 135 bool ResetAfterLayoutTest(); |
| 136 | 136 |
| 137 // IPC messages forwarded from elsewhere. |
| 138 void OnLayoutTestRuntimeFlagsChanged( |
| 139 int sender_process_host_id, |
| 140 const base::DictionaryValue& changed_layout_test_runtime_flags); |
| 141 void OnTestFinishedInSecondaryRenderer(); |
| 142 |
| 137 // Makes sure that the potentially new renderer associated with |frame| is 1) | 143 // Makes sure that the potentially new renderer associated with |frame| is 1) |
| 138 // initialized for the test, 2) kept-up-to-date wrt test flags and 3) | 144 // initialized for the test, 2) kept-up-to-date wrt test flags and 3) |
| 139 // monitored for crashes. | 145 // monitored for crashes. |
| 140 void HandleNewRenderFrameHost(RenderFrameHost* frame); | 146 void HandleNewRenderFrameHost(RenderFrameHost* frame); |
| 141 | 147 |
| 142 void SetTempPath(const base::FilePath& temp_path); | 148 void SetTempPath(const base::FilePath& temp_path); |
| 143 void RendererUnresponsive(); | 149 void RendererUnresponsive(); |
| 144 void OverrideWebkitPrefs(WebPreferences* prefs); | 150 void OverrideWebkitPrefs(WebPreferences* prefs); |
| 145 void OpenURL(const GURL& url); | 151 void OpenURL(const GURL& url); |
| 146 void TestFinishedInSecondaryRenderer(); | |
| 147 bool IsMainWindow(WebContents* web_contents) const; | 152 bool IsMainWindow(WebContents* web_contents) const; |
| 148 std::unique_ptr<BluetoothChooser> RunBluetoothChooser( | 153 std::unique_ptr<BluetoothChooser> RunBluetoothChooser( |
| 149 RenderFrameHost* frame, | 154 RenderFrameHost* frame, |
| 150 const BluetoothChooser::EventHandler& event_handler); | 155 const BluetoothChooser::EventHandler& event_handler); |
| 151 | 156 |
| 152 BlinkTestResultPrinter* printer() { return printer_.get(); } | 157 BlinkTestResultPrinter* printer() { return printer_.get(); } |
| 153 void set_printer(BlinkTestResultPrinter* printer) { printer_.reset(printer); } | 158 void set_printer(BlinkTestResultPrinter* printer) { printer_.reset(printer); } |
| 154 | 159 |
| 155 void DevToolsProcessCrashed(); | 160 void DevToolsProcessCrashed(); |
| 156 | 161 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 194 |
| 190 static BlinkTestController* instance_; | 195 static BlinkTestController* instance_; |
| 191 | 196 |
| 192 void DiscardMainWindow(); | 197 void DiscardMainWindow(); |
| 193 | 198 |
| 194 // Message handlers. | 199 // Message handlers. |
| 195 void OnAudioDump(const std::vector<unsigned char>& audio_dump); | 200 void OnAudioDump(const std::vector<unsigned char>& audio_dump); |
| 196 void OnImageDump(const std::string& actual_pixel_hash, const SkBitmap& image); | 201 void OnImageDump(const std::string& actual_pixel_hash, const SkBitmap& image); |
| 197 void OnTextDump(const std::string& dump); | 202 void OnTextDump(const std::string& dump); |
| 198 void OnInitiateLayoutDump(); | 203 void OnInitiateLayoutDump(); |
| 199 void OnLayoutTestRuntimeFlagsChanged( | |
| 200 RenderFrameHost* sender, | |
| 201 const base::DictionaryValue& changed_layout_test_runtime_flags); | |
| 202 void OnLayoutDumpResponse(RenderFrameHost* sender, const std::string& dump); | 204 void OnLayoutDumpResponse(RenderFrameHost* sender, const std::string& dump); |
| 203 void OnPrintMessage(const std::string& message); | 205 void OnPrintMessage(const std::string& message); |
| 204 void OnOverridePreferences(const WebPreferences& prefs); | 206 void OnOverridePreferences(const WebPreferences& prefs); |
| 205 void OnTestFinished(); | 207 void OnTestFinished(); |
| 206 void OnClearDevToolsLocalStorage(); | 208 void OnClearDevToolsLocalStorage(); |
| 207 void OnShowDevTools(const std::string& settings, | 209 void OnShowDevTools(const std::string& settings, |
| 208 const std::string& frontend_url); | 210 const std::string& frontend_url); |
| 209 void OnEvaluateInDevTools(int call_id, const std::string& script); | 211 void OnEvaluateInDevTools(int call_id, const std::string& script); |
| 210 void OnCloseDevTools(); | 212 void OnCloseDevTools(); |
| 211 void OnGoToOffset(int offset); | 213 void OnGoToOffset(int offset); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 // waiting on the UI thread while layout tests are being ran. | 285 // waiting on the UI thread while layout tests are being ran. |
| 284 ScopedAllowWaitForAndroidLayoutTests reduced_restrictions_; | 286 ScopedAllowWaitForAndroidLayoutTests reduced_restrictions_; |
| 285 #endif | 287 #endif |
| 286 | 288 |
| 287 DISALLOW_COPY_AND_ASSIGN(BlinkTestController); | 289 DISALLOW_COPY_AND_ASSIGN(BlinkTestController); |
| 288 }; | 290 }; |
| 289 | 291 |
| 290 } // namespace content | 292 } // namespace content |
| 291 | 293 |
| 292 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_ | 294 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_BLINK_TEST_CONTROLLER_H_ |
| OLD | NEW |