Chromium Code Reviews| 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> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "components/test_runner/test_preferences.h" | 15 #include "components/test_runner/test_preferences.h" |
| 16 #include "components/test_runner/web_test_delegate.h" | 16 #include "components/test_runner/web_test_delegate.h" |
| 17 #include "content/public/common/page_state.h" | 17 #include "content/public/common/page_state.h" |
| 18 #include "content/public/renderer/render_view_observer.h" | 18 #include "content/public/renderer/render_view_observer.h" |
| 19 #include "content/public/renderer/render_view_observer_tracker.h" | 19 #include "content/public/renderer/render_view_observer_tracker.h" |
| 20 #include "content/shell/common/layout_test.mojom.h" | |
| 20 #include "content/shell/common/layout_test/layout_test_bluetooth_fake_adapter_se tter.mojom.h" | 21 #include "content/shell/common/layout_test/layout_test_bluetooth_fake_adapter_se tter.mojom.h" |
| 21 #include "content/shell/common/shell_test_configuration.h" | |
| 22 #include "v8/include/v8.h" | 22 #include "v8/include/v8.h" |
| 23 | 23 |
| 24 class SkBitmap; | 24 class SkBitmap; |
| 25 | 25 |
| 26 namespace base { | 26 namespace base { |
| 27 class DictionaryValue; | 27 class DictionaryValue; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace blink { | 30 namespace blink { |
| 31 class WebDeviceMotionData; | 31 class WebDeviceMotionData; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 // Resets a RenderView to a known state for layout tests. It is used both when | 166 // Resets a RenderView to a known state for layout tests. It is used both when |
| 167 // a RenderView is created and when reusing an existing RenderView for the | 167 // a RenderView is created and when reusing an existing RenderView for the |
| 168 // next test case. | 168 // next test case. |
| 169 // When reusing an existing RenderView, |for_new_test| should be true, which | 169 // When reusing an existing RenderView, |for_new_test| should be true, which |
| 170 // also resets additional state, like the main frame's name and opener. | 170 // also resets additional state, like the main frame's name and opener. |
| 171 void Reset(bool for_new_test); | 171 void Reset(bool for_new_test); |
| 172 | 172 |
| 173 void ReportLeakDetectionResult(const LeakDetectionResult& result); | 173 void ReportLeakDetectionResult(const LeakDetectionResult& result); |
| 174 | 174 |
| 175 // Message handlers forwarded by LayoutTestRenderFrameObserver. | 175 // Message handlers forwarded by LayoutTestRenderFrameObserver. |
| 176 void OnSetTestConfiguration(const ShellTestConfiguration& params); | 176 void OnSetTestConfiguration(const mojom::ShellTestConfigurationPtr& params); |
|
Sam McNally
2017/01/26 23:24:08
Pass these by value.
Jia
2017/01/29 23:14:35
Done. I used const ref to avoid Clone in some oper
| |
| 177 void OnReplicateTestConfiguration(const ShellTestConfiguration& params); | 177 void OnReplicateTestConfiguration( |
| 178 const mojom::ShellTestConfigurationPtr& params); | |
| 178 void OnSetupSecondaryRenderer(); | 179 void OnSetupSecondaryRenderer(); |
| 179 | 180 |
| 180 private: | 181 private: |
| 181 // Message handlers. | 182 // Message handlers. |
| 182 void OnSessionHistory( | 183 void OnSessionHistory( |
| 183 const std::vector<int>& routing_ids, | 184 const std::vector<int>& routing_ids, |
| 184 const std::vector<std::vector<PageState> >& session_histories, | 185 const std::vector<std::vector<PageState> >& session_histories, |
| 185 const std::vector<unsigned>& current_entry_indexes); | 186 const std::vector<unsigned>& current_entry_indexes); |
| 186 void OnReset(); | 187 void OnReset(); |
| 187 void OnTestFinishedInSecondaryRenderer(); | 188 void OnTestFinishedInSecondaryRenderer(); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 200 void OnPixelsDumpCompleted(const SkBitmap& snapshot); | 201 void OnPixelsDumpCompleted(const SkBitmap& snapshot); |
| 201 void CaptureDumpComplete(); | 202 void CaptureDumpComplete(); |
| 202 std::string DumpHistoryForWindow(blink::WebView* web_view); | 203 std::string DumpHistoryForWindow(blink::WebView* web_view); |
| 203 | 204 |
| 204 mojom::LayoutTestBluetoothFakeAdapterSetter& | 205 mojom::LayoutTestBluetoothFakeAdapterSetter& |
| 205 GetBluetoothFakeAdapterSetter(); | 206 GetBluetoothFakeAdapterSetter(); |
| 206 mojom::LayoutTestBluetoothFakeAdapterSetterPtr bluetooth_fake_adapter_setter_; | 207 mojom::LayoutTestBluetoothFakeAdapterSetterPtr bluetooth_fake_adapter_setter_; |
| 207 | 208 |
| 208 test_runner::TestPreferences prefs_; | 209 test_runner::TestPreferences prefs_; |
| 209 | 210 |
| 210 ShellTestConfiguration test_config_; | 211 mojom::ShellTestConfigurationPtr test_config_; |
| 211 | 212 |
| 212 std::vector<int> routing_ids_; | 213 std::vector<int> routing_ids_; |
| 213 std::vector<std::vector<PageState> > session_histories_; | 214 std::vector<std::vector<PageState> > session_histories_; |
| 214 std::vector<unsigned> current_entry_indexes_; | 215 std::vector<unsigned> current_entry_indexes_; |
| 215 | 216 |
| 216 std::deque<base::Callback<void(const std::vector<std::string>&)>> | 217 std::deque<base::Callback<void(const std::vector<std::string>&)>> |
| 217 get_bluetooth_events_callbacks_; | 218 get_bluetooth_events_callbacks_; |
| 218 | 219 |
| 219 bool is_main_window_; | 220 bool is_main_window_; |
| 220 | 221 |
| 221 bool focus_on_next_commit_; | 222 bool focus_on_next_commit_; |
| 222 | 223 |
| 223 std::unique_ptr<test_runner::AppBannerService> app_banner_service_; | 224 std::unique_ptr<test_runner::AppBannerService> app_banner_service_; |
| 224 | 225 |
| 225 std::unique_ptr<LeakDetector> leak_detector_; | 226 std::unique_ptr<LeakDetector> leak_detector_; |
| 226 | 227 |
| 227 DISALLOW_COPY_AND_ASSIGN(BlinkTestRunner); | 228 DISALLOW_COPY_AND_ASSIGN(BlinkTestRunner); |
| 228 }; | 229 }; |
| 229 | 230 |
| 230 } // namespace content | 231 } // namespace content |
| 231 | 232 |
| 232 #endif // CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_ | 233 #endif // CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_ |
| OLD | NEW |