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 "content/shell/test_runner/test_runner.h" | 5 #include "content/shell/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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 DumpResourceResponseMIMETypes(); | 153 void DumpResourceResponseMIMETypes(); |
154 void DumpSelectionRect(); | 154 void DumpSelectionRect(); |
155 void DumpSpellCheckCallbacks(); | 155 void DumpSpellCheckCallbacks(); |
156 void DumpTitleChanges(); | 156 void DumpTitleChanges(); |
157 void DumpUserGestureInFrameLoadCallbacks(); | 157 void DumpUserGestureInFrameLoadCallbacks(); |
158 void DumpWindowStatusChanges(); | |
159 void EnableUseZoomForDSF(v8::Local<v8::Function> callback); | 158 void EnableUseZoomForDSF(v8::Local<v8::Function> callback); |
160 void EvaluateInWebInspector(int call_id, const std::string& script); | 159 void EvaluateInWebInspector(int call_id, const std::string& script); |
161 void EvaluateScriptInIsolatedWorld(int world_id, const std::string& script); | 160 void EvaluateScriptInIsolatedWorld(int world_id, const std::string& script); |
162 void ExecCommand(gin::Arguments* args); | 161 void ExecCommand(gin::Arguments* args); |
163 void ForceNextDrawingBufferCreationToFail(); | 162 void ForceNextDrawingBufferCreationToFail(); |
164 void ForceNextWebGLContextCreationToFail(); | 163 void ForceNextWebGLContextCreationToFail(); |
165 void ForceRedSelectionColors(); | 164 void ForceRedSelectionColors(); |
166 void GetBluetoothManualChooserEvents(v8::Local<v8::Function> callback); | 165 void GetBluetoothManualChooserEvents(v8::Local<v8::Function> callback); |
167 void GetManifestThen(v8::Local<v8::Function> callback); | 166 void GetManifestThen(v8::Local<v8::Function> callback); |
168 void InsertStyleSheet(const std::string& source_code); | 167 void InsertStyleSheet(const std::string& source_code); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 &TestRunnerBindings::DumpPermissionClientCallbacks) | 431 &TestRunnerBindings::DumpPermissionClientCallbacks) |
433 .SetMethod("dumpPingLoaderCallbacks", | 432 .SetMethod("dumpPingLoaderCallbacks", |
434 &TestRunnerBindings::DumpPingLoaderCallbacks) | 433 &TestRunnerBindings::DumpPingLoaderCallbacks) |
435 .SetMethod("dumpResourceLoadCallbacks", | 434 .SetMethod("dumpResourceLoadCallbacks", |
436 &TestRunnerBindings::DumpResourceLoadCallbacks) | 435 &TestRunnerBindings::DumpResourceLoadCallbacks) |
437 .SetMethod("dumpResourceResponseMIMETypes", | 436 .SetMethod("dumpResourceResponseMIMETypes", |
438 &TestRunnerBindings::DumpResourceResponseMIMETypes) | 437 &TestRunnerBindings::DumpResourceResponseMIMETypes) |
439 .SetMethod("dumpSelectionRect", &TestRunnerBindings::DumpSelectionRect) | 438 .SetMethod("dumpSelectionRect", &TestRunnerBindings::DumpSelectionRect) |
440 .SetMethod("dumpSpellCheckCallbacks", | 439 .SetMethod("dumpSpellCheckCallbacks", |
441 &TestRunnerBindings::DumpSpellCheckCallbacks) | 440 &TestRunnerBindings::DumpSpellCheckCallbacks) |
442 | |
443 // Used at fast/dom/assign-to-window-status.html | |
444 .SetMethod("dumpStatusCallbacks", | |
445 &TestRunnerBindings::DumpWindowStatusChanges) | |
446 .SetMethod("dumpTitleChanges", &TestRunnerBindings::DumpTitleChanges) | 441 .SetMethod("dumpTitleChanges", &TestRunnerBindings::DumpTitleChanges) |
447 .SetMethod("dumpUserGestureInFrameLoadCallbacks", | 442 .SetMethod("dumpUserGestureInFrameLoadCallbacks", |
448 &TestRunnerBindings::DumpUserGestureInFrameLoadCallbacks) | 443 &TestRunnerBindings::DumpUserGestureInFrameLoadCallbacks) |
449 .SetMethod("enableAutoResizeMode", | 444 .SetMethod("enableAutoResizeMode", |
450 &TestRunnerBindings::EnableAutoResizeMode) | 445 &TestRunnerBindings::EnableAutoResizeMode) |
451 .SetMethod("enableUseZoomForDSF", | 446 .SetMethod("enableUseZoomForDSF", |
452 &TestRunnerBindings::EnableUseZoomForDSF) | 447 &TestRunnerBindings::EnableUseZoomForDSF) |
453 .SetMethod("evaluateInWebInspector", | 448 .SetMethod("evaluateInWebInspector", |
454 &TestRunnerBindings::EvaluateInWebInspector) | 449 &TestRunnerBindings::EvaluateInWebInspector) |
455 .SetMethod("evaluateInWebInspectorOverlay", | 450 .SetMethod("evaluateInWebInspectorOverlay", |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1194 void TestRunnerBindings::SetAutoplayAllowed(bool allowed) { | 1189 void TestRunnerBindings::SetAutoplayAllowed(bool allowed) { |
1195 if (runner_) | 1190 if (runner_) |
1196 runner_->SetAutoplayAllowed(allowed); | 1191 runner_->SetAutoplayAllowed(allowed); |
1197 } | 1192 } |
1198 | 1193 |
1199 void TestRunnerBindings::DumpPermissionClientCallbacks() { | 1194 void TestRunnerBindings::DumpPermissionClientCallbacks() { |
1200 if (runner_) | 1195 if (runner_) |
1201 runner_->DumpPermissionClientCallbacks(); | 1196 runner_->DumpPermissionClientCallbacks(); |
1202 } | 1197 } |
1203 | 1198 |
1204 void TestRunnerBindings::DumpWindowStatusChanges() { | |
1205 if (runner_) | |
1206 runner_->DumpWindowStatusChanges(); | |
1207 } | |
1208 | |
1209 void TestRunnerBindings::DumpSpellCheckCallbacks() { | 1199 void TestRunnerBindings::DumpSpellCheckCallbacks() { |
1210 if (runner_) | 1200 if (runner_) |
1211 runner_->DumpSpellCheckCallbacks(); | 1201 runner_->DumpSpellCheckCallbacks(); |
1212 } | 1202 } |
1213 | 1203 |
1214 void TestRunnerBindings::DumpBackForwardList() { | 1204 void TestRunnerBindings::DumpBackForwardList() { |
1215 if (runner_) | 1205 if (runner_) |
1216 runner_->DumpBackForwardList(); | 1206 runner_->DumpBackForwardList(); |
1217 } | 1207 } |
1218 | 1208 |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 } | 1865 } |
1876 | 1866 |
1877 WebTextCheckClient* TestRunner::GetWebTextCheckClient() const { | 1867 WebTextCheckClient* TestRunner::GetWebTextCheckClient() const { |
1878 return spellcheck_.get(); | 1868 return spellcheck_.get(); |
1879 } | 1869 } |
1880 | 1870 |
1881 void TestRunner::InitializeWebViewWithMocks(blink::WebView* web_view) { | 1871 void TestRunner::InitializeWebViewWithMocks(blink::WebView* web_view) { |
1882 web_view->SetCredentialManagerClient(credential_manager_client_.get()); | 1872 web_view->SetCredentialManagerClient(credential_manager_client_.get()); |
1883 } | 1873 } |
1884 | 1874 |
1885 bool TestRunner::shouldDumpStatusCallbacks() const { | |
1886 return layout_test_runtime_flags_.dump_window_status_changes(); | |
1887 } | |
1888 | |
1889 bool TestRunner::shouldDumpSpellCheckCallbacks() const { | 1875 bool TestRunner::shouldDumpSpellCheckCallbacks() const { |
1890 return layout_test_runtime_flags_.dump_spell_check_callbacks(); | 1876 return layout_test_runtime_flags_.dump_spell_check_callbacks(); |
1891 } | 1877 } |
1892 | 1878 |
1893 bool TestRunner::ShouldDumpBackForwardList() const { | 1879 bool TestRunner::ShouldDumpBackForwardList() const { |
1894 return dump_back_forward_list_; | 1880 return dump_back_forward_list_; |
1895 } | 1881 } |
1896 | 1882 |
1897 bool TestRunner::isPrinting() const { | 1883 bool TestRunner::isPrinting() const { |
1898 return layout_test_runtime_flags_.is_printing(); | 1884 return layout_test_runtime_flags_.is_printing(); |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2557 OnLayoutTestRuntimeFlagsChanged(); | 2543 OnLayoutTestRuntimeFlagsChanged(); |
2558 } | 2544 } |
2559 | 2545 |
2560 void TestRunner::SetDisallowedSubresourcePathSuffixes( | 2546 void TestRunner::SetDisallowedSubresourcePathSuffixes( |
2561 const std::vector<std::string>& suffixes) { | 2547 const std::vector<std::string>& suffixes) { |
2562 DCHECK(main_view_); | 2548 DCHECK(main_view_); |
2563 main_view_->MainFrame()->DataSource()->SetSubresourceFilter( | 2549 main_view_->MainFrame()->DataSource()->SetSubresourceFilter( |
2564 new MockWebDocumentSubresourceFilter(suffixes)); | 2550 new MockWebDocumentSubresourceFilter(suffixes)); |
2565 } | 2551 } |
2566 | 2552 |
2567 void TestRunner::DumpWindowStatusChanges() { | |
2568 layout_test_runtime_flags_.set_dump_window_status_changes(true); | |
2569 OnLayoutTestRuntimeFlagsChanged(); | |
2570 } | |
2571 | |
2572 void TestRunner::DumpSpellCheckCallbacks() { | 2553 void TestRunner::DumpSpellCheckCallbacks() { |
2573 layout_test_runtime_flags_.set_dump_spell_check_callbacks(true); | 2554 layout_test_runtime_flags_.set_dump_spell_check_callbacks(true); |
2574 OnLayoutTestRuntimeFlagsChanged(); | 2555 OnLayoutTestRuntimeFlagsChanged(); |
2575 } | 2556 } |
2576 | 2557 |
2577 void TestRunner::DumpBackForwardList() { | 2558 void TestRunner::DumpBackForwardList() { |
2578 dump_back_forward_list_ = true; | 2559 dump_back_forward_list_ = true; |
2579 } | 2560 } |
2580 | 2561 |
2581 void TestRunner::DumpSelectionRect() { | 2562 void TestRunner::DumpSelectionRect() { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2813 | 2794 |
2814 void TestRunner::NotifyDone() { | 2795 void TestRunner::NotifyDone() { |
2815 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2796 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
2816 !will_navigate_ && work_queue_.is_empty()) | 2797 !will_navigate_ && work_queue_.is_empty()) |
2817 delegate_->TestFinished(); | 2798 delegate_->TestFinished(); |
2818 layout_test_runtime_flags_.set_wait_until_done(false); | 2799 layout_test_runtime_flags_.set_wait_until_done(false); |
2819 OnLayoutTestRuntimeFlagsChanged(); | 2800 OnLayoutTestRuntimeFlagsChanged(); |
2820 } | 2801 } |
2821 | 2802 |
2822 } // namespace test_runner | 2803 } // namespace test_runner |
OLD | NEW |