OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "components/test_runner/test_runner.h" | 5 #include "components/test_runner/test_runner.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <limits> | 8 #include <limits> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 void DumpCreateView(); | 143 void DumpCreateView(); |
144 void DumpDragImage(); | 144 void DumpDragImage(); |
145 void DumpEditingCallbacks(); | 145 void DumpEditingCallbacks(); |
146 void DumpFrameLoadCallbacks(); | 146 void DumpFrameLoadCallbacks(); |
147 void DumpIconChanges(); | 147 void DumpIconChanges(); |
148 void DumpNavigationPolicy(); | 148 void DumpNavigationPolicy(); |
149 void DumpPageImportanceSignals(); | 149 void DumpPageImportanceSignals(); |
150 void DumpPermissionClientCallbacks(); | 150 void DumpPermissionClientCallbacks(); |
151 void DumpPingLoaderCallbacks(); | 151 void DumpPingLoaderCallbacks(); |
152 void DumpResourceLoadCallbacks(); | 152 void DumpResourceLoadCallbacks(); |
153 void DumpResourceRequestPriorities(); | |
154 void DumpResourceResponseMIMETypes(); | 153 void DumpResourceResponseMIMETypes(); |
155 void DumpSelectionRect(); | 154 void DumpSelectionRect(); |
156 void DumpSpellCheckCallbacks(); | 155 void DumpSpellCheckCallbacks(); |
157 void DumpTitleChanges(); | 156 void DumpTitleChanges(); |
158 void DumpUserGestureInFrameLoadCallbacks(); | 157 void DumpUserGestureInFrameLoadCallbacks(); |
159 void DumpWindowStatusChanges(); | 158 void DumpWindowStatusChanges(); |
160 void EnableUseZoomForDSF(v8::Local<v8::Function> callback); | 159 void EnableUseZoomForDSF(v8::Local<v8::Function> callback); |
161 void EvaluateInWebInspector(int call_id, const std::string& script); | 160 void EvaluateInWebInspector(int call_id, const std::string& script); |
162 void EvaluateScriptInIsolatedWorld(int world_id, const std::string& script); | 161 void EvaluateScriptInIsolatedWorld(int world_id, const std::string& script); |
163 void ExecCommand(gin::Arguments* args); | 162 void ExecCommand(gin::Arguments* args); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 .SetMethod("dumpNavigationPolicy", | 392 .SetMethod("dumpNavigationPolicy", |
394 &TestRunnerBindings::DumpNavigationPolicy) | 393 &TestRunnerBindings::DumpNavigationPolicy) |
395 .SetMethod("dumpPageImportanceSignals", | 394 .SetMethod("dumpPageImportanceSignals", |
396 &TestRunnerBindings::DumpPageImportanceSignals) | 395 &TestRunnerBindings::DumpPageImportanceSignals) |
397 .SetMethod("dumpPermissionClientCallbacks", | 396 .SetMethod("dumpPermissionClientCallbacks", |
398 &TestRunnerBindings::DumpPermissionClientCallbacks) | 397 &TestRunnerBindings::DumpPermissionClientCallbacks) |
399 .SetMethod("dumpPingLoaderCallbacks", | 398 .SetMethod("dumpPingLoaderCallbacks", |
400 &TestRunnerBindings::DumpPingLoaderCallbacks) | 399 &TestRunnerBindings::DumpPingLoaderCallbacks) |
401 .SetMethod("dumpResourceLoadCallbacks", | 400 .SetMethod("dumpResourceLoadCallbacks", |
402 &TestRunnerBindings::DumpResourceLoadCallbacks) | 401 &TestRunnerBindings::DumpResourceLoadCallbacks) |
403 .SetMethod("dumpResourceRequestPriorities", | |
404 &TestRunnerBindings::DumpResourceRequestPriorities) | |
405 .SetMethod("dumpResourceResponseMIMETypes", | 402 .SetMethod("dumpResourceResponseMIMETypes", |
406 &TestRunnerBindings::DumpResourceResponseMIMETypes) | 403 &TestRunnerBindings::DumpResourceResponseMIMETypes) |
407 .SetMethod("dumpSelectionRect", &TestRunnerBindings::DumpSelectionRect) | 404 .SetMethod("dumpSelectionRect", &TestRunnerBindings::DumpSelectionRect) |
408 .SetMethod("dumpSpellCheckCallbacks", | 405 .SetMethod("dumpSpellCheckCallbacks", |
409 &TestRunnerBindings::DumpSpellCheckCallbacks) | 406 &TestRunnerBindings::DumpSpellCheckCallbacks) |
410 | 407 |
411 // Used at fast/dom/assign-to-window-status.html | 408 // Used at fast/dom/assign-to-window-status.html |
412 .SetMethod("dumpStatusCallbacks", | 409 .SetMethod("dumpStatusCallbacks", |
413 &TestRunnerBindings::DumpWindowStatusChanges) | 410 &TestRunnerBindings::DumpWindowStatusChanges) |
414 .SetMethod("dumpTitleChanges", &TestRunnerBindings::DumpTitleChanges) | 411 .SetMethod("dumpTitleChanges", &TestRunnerBindings::DumpTitleChanges) |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 if (runner_) | 1179 if (runner_) |
1183 runner_->SetShouldStayOnPageAfterHandlingBeforeUnload(value); | 1180 runner_->SetShouldStayOnPageAfterHandlingBeforeUnload(value); |
1184 } | 1181 } |
1185 | 1182 |
1186 void TestRunnerBindings::SetWillSendRequestClearHeader( | 1183 void TestRunnerBindings::SetWillSendRequestClearHeader( |
1187 const std::string& header) { | 1184 const std::string& header) { |
1188 if (runner_) | 1185 if (runner_) |
1189 runner_->SetWillSendRequestClearHeader(header); | 1186 runner_->SetWillSendRequestClearHeader(header); |
1190 } | 1187 } |
1191 | 1188 |
1192 void TestRunnerBindings::DumpResourceRequestPriorities() { | |
1193 if (runner_) | |
1194 runner_->DumpResourceRequestPriorities(); | |
1195 } | |
1196 | |
1197 void TestRunnerBindings::SetUseMockTheme(bool use) { | 1189 void TestRunnerBindings::SetUseMockTheme(bool use) { |
1198 if (runner_) | 1190 if (runner_) |
1199 runner_->SetUseMockTheme(use); | 1191 runner_->SetUseMockTheme(use); |
1200 } | 1192 } |
1201 | 1193 |
1202 void TestRunnerBindings::WaitUntilExternalURLLoad() { | 1194 void TestRunnerBindings::WaitUntilExternalURLLoad() { |
1203 if (runner_) | 1195 if (runner_) |
1204 runner_->WaitUntilExternalURLLoad(); | 1196 runner_->WaitUntilExternalURLLoad(); |
1205 } | 1197 } |
1206 | 1198 |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 } | 1882 } |
1891 | 1883 |
1892 bool TestRunner::policyDelegateIsPermissive() const { | 1884 bool TestRunner::policyDelegateIsPermissive() const { |
1893 return layout_test_runtime_flags_.policy_delegate_is_permissive(); | 1885 return layout_test_runtime_flags_.policy_delegate_is_permissive(); |
1894 } | 1886 } |
1895 | 1887 |
1896 bool TestRunner::policyDelegateShouldNotifyDone() const { | 1888 bool TestRunner::policyDelegateShouldNotifyDone() const { |
1897 return layout_test_runtime_flags_.policy_delegate_should_notify_done(); | 1889 return layout_test_runtime_flags_.policy_delegate_should_notify_done(); |
1898 } | 1890 } |
1899 | 1891 |
1900 bool TestRunner::shouldDumpResourcePriorities() const { | |
1901 return layout_test_runtime_flags_.dump_resource_priorities(); | |
1902 } | |
1903 | |
1904 void TestRunner::setToolTipText(const WebString& text) { | 1892 void TestRunner::setToolTipText(const WebString& text) { |
1905 tooltip_text_ = text.utf8(); | 1893 tooltip_text_ = text.utf8(); |
1906 } | 1894 } |
1907 | 1895 |
1908 void TestRunner::setDragImage( | 1896 void TestRunner::setDragImage( |
1909 const blink::WebImage& drag_image) { | 1897 const blink::WebImage& drag_image) { |
1910 if (layout_test_runtime_flags_.dump_drag_image()) { | 1898 if (layout_test_runtime_flags_.dump_drag_image()) { |
1911 if (drag_image_.isNull()) | 1899 if (drag_image_.isNull()) |
1912 drag_image_ = drag_image; | 1900 drag_image_ = drag_image; |
1913 } | 1901 } |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2544 layout_test_runtime_flags_.set_stay_on_page_after_handling_before_unload( | 2532 layout_test_runtime_flags_.set_stay_on_page_after_handling_before_unload( |
2545 value); | 2533 value); |
2546 OnLayoutTestRuntimeFlagsChanged(); | 2534 OnLayoutTestRuntimeFlagsChanged(); |
2547 } | 2535 } |
2548 | 2536 |
2549 void TestRunner::SetWillSendRequestClearHeader(const std::string& header) { | 2537 void TestRunner::SetWillSendRequestClearHeader(const std::string& header) { |
2550 if (!header.empty()) | 2538 if (!header.empty()) |
2551 http_headers_to_clear_.insert(header); | 2539 http_headers_to_clear_.insert(header); |
2552 } | 2540 } |
2553 | 2541 |
2554 void TestRunner::DumpResourceRequestPriorities() { | |
2555 layout_test_runtime_flags_.set_dump_resource_priorities(true); | |
2556 OnLayoutTestRuntimeFlagsChanged(); | |
2557 } | |
2558 | |
2559 void TestRunner::SetUseMockTheme(bool use) { | 2542 void TestRunner::SetUseMockTheme(bool use) { |
2560 use_mock_theme_ = use; | 2543 use_mock_theme_ = use; |
2561 blink::setMockThemeEnabledForTest(use); | 2544 blink::setMockThemeEnabledForTest(use); |
2562 } | 2545 } |
2563 | 2546 |
2564 void TestRunner::ShowWebInspector(const std::string& str, | 2547 void TestRunner::ShowWebInspector(const std::string& str, |
2565 const std::string& frontend_url) { | 2548 const std::string& frontend_url) { |
2566 ShowDevTools(str, frontend_url); | 2549 ShowDevTools(str, frontend_url); |
2567 } | 2550 } |
2568 | 2551 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2744 | 2727 |
2745 void TestRunner::NotifyDone() { | 2728 void TestRunner::NotifyDone() { |
2746 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2729 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
2747 !will_navigate_ && work_queue_.is_empty()) | 2730 !will_navigate_ && work_queue_.is_empty()) |
2748 delegate_->TestFinished(); | 2731 delegate_->TestFinished(); |
2749 layout_test_runtime_flags_.set_wait_until_done(false); | 2732 layout_test_runtime_flags_.set_wait_until_done(false); |
2750 OnLayoutTestRuntimeFlagsChanged(); | 2733 OnLayoutTestRuntimeFlagsChanged(); |
2751 } | 2734 } |
2752 | 2735 |
2753 } // namespace test_runner | 2736 } // namespace test_runner |
OLD | NEW |