| 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_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_ |
| 6 #define CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_ | 6 #define CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 const base::Callback<void(bool)>& callback) override; | 156 const base::Callback<void(bool)>& callback) override; |
| 157 void ResolveBeforeInstallPromptPromise( | 157 void ResolveBeforeInstallPromptPromise( |
| 158 const std::string& platform) override; | 158 const std::string& platform) override; |
| 159 blink::WebPlugin* CreatePluginPlaceholder( | 159 blink::WebPlugin* CreatePluginPlaceholder( |
| 160 const blink::WebPluginParams& params) override; | 160 const blink::WebPluginParams& params) override; |
| 161 float GetDeviceScaleFactor() const override; | 161 float GetDeviceScaleFactor() const override; |
| 162 void RunIdleTasks(const base::Closure& callback) override; | 162 void RunIdleTasks(const base::Closure& callback) override; |
| 163 void ForceTextInputStateUpdate(blink::WebLocalFrame* frame) override; | 163 void ForceTextInputStateUpdate(blink::WebLocalFrame* frame) override; |
| 164 bool IsNavigationInitiatedByRenderer( | 164 bool IsNavigationInitiatedByRenderer( |
| 165 const blink::WebURLRequest& request) override; | 165 const blink::WebURLRequest& request) override; |
| 166 void DumpPixelsAsync( |
| 167 base::OnceCallback<void(const SkBitmap&)> callback) override; |
| 166 | 168 |
| 167 // Resets a RenderView to a known state for layout tests. It is used both when | 169 // Resets a RenderView to a known state for layout tests. It is used both when |
| 168 // a RenderView is created and when reusing an existing RenderView for the | 170 // a RenderView is created and when reusing an existing RenderView for the |
| 169 // next test case. | 171 // next test case. |
| 170 // When reusing an existing RenderView, |for_new_test| should be true, which | 172 // When reusing an existing RenderView, |for_new_test| should be true, which |
| 171 // also resets additional state, like the main frame's name and opener. | 173 // also resets additional state, like the main frame's name and opener. |
| 172 void Reset(bool for_new_test); | 174 void Reset(bool for_new_test); |
| 173 | 175 |
| 174 void ReportLeakDetectionResult(const LeakDetectionResult& result); | 176 void ReportLeakDetectionResult(const LeakDetectionResult& result); |
| 175 | 177 |
| 176 // Message handlers forwarded by LayoutTestRenderFrameObserver. | 178 // Message handlers forwarded by LayoutTestRenderFrameObserver. |
| 177 void OnSetTestConfiguration(mojom::ShellTestConfigurationPtr params); | 179 void OnSetTestConfiguration(mojom::ShellTestConfigurationPtr params); |
| 178 void OnReplicateTestConfiguration(mojom::ShellTestConfigurationPtr params); | 180 void OnReplicateTestConfiguration(mojom::ShellTestConfigurationPtr params); |
| 179 void OnSetupSecondaryRenderer(); | 181 void OnSetupSecondaryRenderer(); |
| 180 | 182 |
| 181 private: | 183 private: |
| 182 // Message handlers. | 184 // Message handlers. |
| 183 void OnSessionHistory( | 185 void OnSessionHistory( |
| 184 const std::vector<int>& routing_ids, | 186 const std::vector<int>& routing_ids, |
| 185 const std::vector<std::vector<PageState> >& session_histories, | 187 const std::vector<std::vector<PageState> >& session_histories, |
| 186 const std::vector<unsigned>& current_entry_indexes); | 188 const std::vector<unsigned>& current_entry_indexes); |
| 187 void OnReset(); | 189 void OnReset(); |
| 188 void OnTestFinishedInSecondaryRenderer(); | 190 void OnTestFinishedInSecondaryRenderer(); |
| 189 void OnTryLeakDetection(); | 191 void OnTryLeakDetection(); |
| 190 void OnReplyBluetoothManualChooserEvents( | 192 void OnReplyBluetoothManualChooserEvents( |
| 191 const std::vector<std::string>& events); | 193 const std::vector<std::string>& events); |
| 194 void OnPixelsDumpResult(const SkBitmap& result); |
| 192 | 195 |
| 193 // RenderViewObserver implementation. | 196 // RenderViewObserver implementation. |
| 194 void OnDestruct() override; | 197 void OnDestruct() override; |
| 195 | 198 |
| 196 // After finishing the test, retrieves the audio, text, and pixel dumps from | 199 // After finishing the test, retrieves the audio, text, and pixel dumps from |
| 197 // the TestRunner library and sends them to the browser process. | 200 // the TestRunner library and sends them to the browser process. |
| 198 void CaptureDump(); | 201 void CaptureDump(); |
| 199 void OnLayoutDumpCompleted(std::string completed_layout_dump); | 202 void OnLayoutDumpCompleted(std::string completed_layout_dump); |
| 200 void CaptureDumpContinued(); | 203 void CaptureDumpContinued(); |
| 201 void OnPixelsDumpCompleted(const SkBitmap& snapshot); | 204 void OnPixelsDumpCompleted(const SkBitmap& snapshot); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 216 | 219 |
| 217 std::deque<base::Callback<void(const std::vector<std::string>&)>> | 220 std::deque<base::Callback<void(const std::vector<std::string>&)>> |
| 218 get_bluetooth_events_callbacks_; | 221 get_bluetooth_events_callbacks_; |
| 219 | 222 |
| 220 bool is_main_window_; | 223 bool is_main_window_; |
| 221 | 224 |
| 222 bool focus_on_next_commit_; | 225 bool focus_on_next_commit_; |
| 223 | 226 |
| 224 std::unique_ptr<test_runner::AppBannerService> app_banner_service_; | 227 std::unique_ptr<test_runner::AppBannerService> app_banner_service_; |
| 225 | 228 |
| 229 base::OnceCallback<void(const SkBitmap&)> pixels_dump_callback_; |
| 230 |
| 226 std::unique_ptr<LeakDetector> leak_detector_; | 231 std::unique_ptr<LeakDetector> leak_detector_; |
| 227 | 232 |
| 228 DISALLOW_COPY_AND_ASSIGN(BlinkTestRunner); | 233 DISALLOW_COPY_AND_ASSIGN(BlinkTestRunner); |
| 229 }; | 234 }; |
| 230 | 235 |
| 231 } // namespace content | 236 } // namespace content |
| 232 | 237 |
| 233 #endif // CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_ | 238 #endif // CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_ |
| OLD | NEW |