| 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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1881 } | 1873 } |
| 1882 | 1874 |
| 1883 bool TestRunner::policyDelegateIsPermissive() const { | 1875 bool TestRunner::policyDelegateIsPermissive() const { |
| 1884 return layout_test_runtime_flags_.policy_delegate_is_permissive(); | 1876 return layout_test_runtime_flags_.policy_delegate_is_permissive(); |
| 1885 } | 1877 } |
| 1886 | 1878 |
| 1887 bool TestRunner::policyDelegateShouldNotifyDone() const { | 1879 bool TestRunner::policyDelegateShouldNotifyDone() const { |
| 1888 return layout_test_runtime_flags_.policy_delegate_should_notify_done(); | 1880 return layout_test_runtime_flags_.policy_delegate_should_notify_done(); |
| 1889 } | 1881 } |
| 1890 | 1882 |
| 1891 bool TestRunner::shouldDumpResourcePriorities() const { | |
| 1892 return layout_test_runtime_flags_.dump_resource_priorities(); | |
| 1893 } | |
| 1894 | |
| 1895 void TestRunner::setToolTipText(const WebString& text) { | 1883 void TestRunner::setToolTipText(const WebString& text) { |
| 1896 tooltip_text_ = text.utf8(); | 1884 tooltip_text_ = text.utf8(); |
| 1897 } | 1885 } |
| 1898 | 1886 |
| 1899 void TestRunner::setDragImage( | 1887 void TestRunner::setDragImage( |
| 1900 const blink::WebImage& drag_image) { | 1888 const blink::WebImage& drag_image) { |
| 1901 if (layout_test_runtime_flags_.dump_drag_image()) { | 1889 if (layout_test_runtime_flags_.dump_drag_image()) { |
| 1902 if (drag_image_.isNull()) | 1890 if (drag_image_.isNull()) |
| 1903 drag_image_ = drag_image; | 1891 drag_image_ = drag_image; |
| 1904 } | 1892 } |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2535 layout_test_runtime_flags_.set_stay_on_page_after_handling_before_unload( | 2523 layout_test_runtime_flags_.set_stay_on_page_after_handling_before_unload( |
| 2536 value); | 2524 value); |
| 2537 OnLayoutTestRuntimeFlagsChanged(); | 2525 OnLayoutTestRuntimeFlagsChanged(); |
| 2538 } | 2526 } |
| 2539 | 2527 |
| 2540 void TestRunner::SetWillSendRequestClearHeader(const std::string& header) { | 2528 void TestRunner::SetWillSendRequestClearHeader(const std::string& header) { |
| 2541 if (!header.empty()) | 2529 if (!header.empty()) |
| 2542 http_headers_to_clear_.insert(header); | 2530 http_headers_to_clear_.insert(header); |
| 2543 } | 2531 } |
| 2544 | 2532 |
| 2545 void TestRunner::DumpResourceRequestPriorities() { | |
| 2546 layout_test_runtime_flags_.set_dump_resource_priorities(true); | |
| 2547 OnLayoutTestRuntimeFlagsChanged(); | |
| 2548 } | |
| 2549 | |
| 2550 void TestRunner::SetUseMockTheme(bool use) { | 2533 void TestRunner::SetUseMockTheme(bool use) { |
| 2551 use_mock_theme_ = use; | 2534 use_mock_theme_ = use; |
| 2552 blink::setMockThemeEnabledForTest(use); | 2535 blink::setMockThemeEnabledForTest(use); |
| 2553 } | 2536 } |
| 2554 | 2537 |
| 2555 void TestRunner::ShowWebInspector(const std::string& str, | 2538 void TestRunner::ShowWebInspector(const std::string& str, |
| 2556 const std::string& frontend_url) { | 2539 const std::string& frontend_url) { |
| 2557 ShowDevTools(str, frontend_url); | 2540 ShowDevTools(str, frontend_url); |
| 2558 } | 2541 } |
| 2559 | 2542 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2735 | 2718 |
| 2736 void TestRunner::NotifyDone() { | 2719 void TestRunner::NotifyDone() { |
| 2737 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2720 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
| 2738 work_queue_.is_empty()) | 2721 work_queue_.is_empty()) |
| 2739 delegate_->TestFinished(); | 2722 delegate_->TestFinished(); |
| 2740 layout_test_runtime_flags_.set_wait_until_done(false); | 2723 layout_test_runtime_flags_.set_wait_until_done(false); |
| 2741 OnLayoutTestRuntimeFlagsChanged(); | 2724 OnLayoutTestRuntimeFlagsChanged(); |
| 2742 } | 2725 } |
| 2743 | 2726 |
| 2744 } // namespace test_runner | 2727 } // namespace test_runner |
| OLD | NEW |