| 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 <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 void DumpResourceResponseMIMETypes(); | 240 void DumpResourceResponseMIMETypes(); |
| 241 void SetImagesAllowed(bool allowed); | 241 void SetImagesAllowed(bool allowed); |
| 242 void SetMediaAllowed(bool allowed); | 242 void SetMediaAllowed(bool allowed); |
| 243 void SetScriptsAllowed(bool allowed); | 243 void SetScriptsAllowed(bool allowed); |
| 244 void SetStorageAllowed(bool allowed); | 244 void SetStorageAllowed(bool allowed); |
| 245 void SetPluginsAllowed(bool allowed); | 245 void SetPluginsAllowed(bool allowed); |
| 246 void SetAllowDisplayOfInsecureContent(bool allowed); | 246 void SetAllowDisplayOfInsecureContent(bool allowed); |
| 247 void SetAllowRunningOfInsecureContent(bool allowed); | 247 void SetAllowRunningOfInsecureContent(bool allowed); |
| 248 void DumpPermissionClientCallbacks(); | 248 void DumpPermissionClientCallbacks(); |
| 249 void DumpWindowStatusChanges(); | 249 void DumpWindowStatusChanges(); |
| 250 void DumpProgressFinishedCallback(); | |
| 251 void DumpSpellCheckCallbacks(); | 250 void DumpSpellCheckCallbacks(); |
| 252 void DumpBackForwardList(); | 251 void DumpBackForwardList(); |
| 253 void DumpSelectionRect(); | 252 void DumpSelectionRect(); |
| 254 void SetPrinting(); | 253 void SetPrinting(); |
| 255 void ClearPrinting(); | 254 void ClearPrinting(); |
| 256 void SetShouldStayOnPageAfterHandlingBeforeUnload(bool value); | 255 void SetShouldStayOnPageAfterHandlingBeforeUnload(bool value); |
| 257 void SetWillSendRequestClearHeader(const std::string& header); | 256 void SetWillSendRequestClearHeader(const std::string& header); |
| 258 void DumpResourceRequestPriorities(); | 257 void DumpResourceRequestPriorities(); |
| 259 void SetUseMockTheme(bool use); | 258 void SetUseMockTheme(bool use); |
| 260 void WaitUntilExternalURLLoad(); | 259 void WaitUntilExternalURLLoad(); |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 .SetMethod("setStorageAllowed", &TestRunnerBindings::SetStorageAllowed) | 498 .SetMethod("setStorageAllowed", &TestRunnerBindings::SetStorageAllowed) |
| 500 .SetMethod("setPluginsAllowed", &TestRunnerBindings::SetPluginsAllowed) | 499 .SetMethod("setPluginsAllowed", &TestRunnerBindings::SetPluginsAllowed) |
| 501 .SetMethod("setAllowDisplayOfInsecureContent", | 500 .SetMethod("setAllowDisplayOfInsecureContent", |
| 502 &TestRunnerBindings::SetAllowDisplayOfInsecureContent) | 501 &TestRunnerBindings::SetAllowDisplayOfInsecureContent) |
| 503 .SetMethod("setAllowRunningOfInsecureContent", | 502 .SetMethod("setAllowRunningOfInsecureContent", |
| 504 &TestRunnerBindings::SetAllowRunningOfInsecureContent) | 503 &TestRunnerBindings::SetAllowRunningOfInsecureContent) |
| 505 .SetMethod("dumpPermissionClientCallbacks", | 504 .SetMethod("dumpPermissionClientCallbacks", |
| 506 &TestRunnerBindings::DumpPermissionClientCallbacks) | 505 &TestRunnerBindings::DumpPermissionClientCallbacks) |
| 507 .SetMethod("dumpWindowStatusChanges", | 506 .SetMethod("dumpWindowStatusChanges", |
| 508 &TestRunnerBindings::DumpWindowStatusChanges) | 507 &TestRunnerBindings::DumpWindowStatusChanges) |
| 509 .SetMethod("dumpProgressFinishedCallback", | |
| 510 &TestRunnerBindings::DumpProgressFinishedCallback) | |
| 511 .SetMethod("dumpSpellCheckCallbacks", | 508 .SetMethod("dumpSpellCheckCallbacks", |
| 512 &TestRunnerBindings::DumpSpellCheckCallbacks) | 509 &TestRunnerBindings::DumpSpellCheckCallbacks) |
| 513 .SetMethod("dumpBackForwardList", | 510 .SetMethod("dumpBackForwardList", |
| 514 &TestRunnerBindings::DumpBackForwardList) | 511 &TestRunnerBindings::DumpBackForwardList) |
| 515 .SetMethod("dumpSelectionRect", &TestRunnerBindings::DumpSelectionRect) | 512 .SetMethod("dumpSelectionRect", &TestRunnerBindings::DumpSelectionRect) |
| 516 .SetMethod("setPrinting", &TestRunnerBindings::SetPrinting) | 513 .SetMethod("setPrinting", &TestRunnerBindings::SetPrinting) |
| 517 .SetMethod("clearPrinting", &TestRunnerBindings::ClearPrinting) | 514 .SetMethod("clearPrinting", &TestRunnerBindings::ClearPrinting) |
| 518 .SetMethod( | 515 .SetMethod( |
| 519 "setShouldStayOnPageAfterHandlingBeforeUnload", | 516 "setShouldStayOnPageAfterHandlingBeforeUnload", |
| 520 &TestRunnerBindings::SetShouldStayOnPageAfterHandlingBeforeUnload) | 517 &TestRunnerBindings::SetShouldStayOnPageAfterHandlingBeforeUnload) |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 void TestRunnerBindings::DumpPermissionClientCallbacks() { | 1202 void TestRunnerBindings::DumpPermissionClientCallbacks() { |
| 1206 if (runner_) | 1203 if (runner_) |
| 1207 runner_->DumpPermissionClientCallbacks(); | 1204 runner_->DumpPermissionClientCallbacks(); |
| 1208 } | 1205 } |
| 1209 | 1206 |
| 1210 void TestRunnerBindings::DumpWindowStatusChanges() { | 1207 void TestRunnerBindings::DumpWindowStatusChanges() { |
| 1211 if (runner_) | 1208 if (runner_) |
| 1212 runner_->DumpWindowStatusChanges(); | 1209 runner_->DumpWindowStatusChanges(); |
| 1213 } | 1210 } |
| 1214 | 1211 |
| 1215 void TestRunnerBindings::DumpProgressFinishedCallback() { | |
| 1216 if (runner_) | |
| 1217 runner_->DumpProgressFinishedCallback(); | |
| 1218 } | |
| 1219 | |
| 1220 void TestRunnerBindings::DumpSpellCheckCallbacks() { | 1212 void TestRunnerBindings::DumpSpellCheckCallbacks() { |
| 1221 if (runner_) | 1213 if (runner_) |
| 1222 runner_->DumpSpellCheckCallbacks(); | 1214 runner_->DumpSpellCheckCallbacks(); |
| 1223 } | 1215 } |
| 1224 | 1216 |
| 1225 void TestRunnerBindings::DumpBackForwardList() { | 1217 void TestRunnerBindings::DumpBackForwardList() { |
| 1226 if (runner_) | 1218 if (runner_) |
| 1227 runner_->DumpBackForwardList(); | 1219 runner_->DumpBackForwardList(); |
| 1228 } | 1220 } |
| 1229 | 1221 |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1714 dump_frame_load_callbacks_ = false; | 1706 dump_frame_load_callbacks_ = false; |
| 1715 dump_ping_loader_callbacks_ = false; | 1707 dump_ping_loader_callbacks_ = false; |
| 1716 dump_user_gesture_in_frame_load_callbacks_ = false; | 1708 dump_user_gesture_in_frame_load_callbacks_ = false; |
| 1717 dump_title_changes_ = false; | 1709 dump_title_changes_ = false; |
| 1718 dump_create_view_ = false; | 1710 dump_create_view_ = false; |
| 1719 can_open_windows_ = false; | 1711 can_open_windows_ = false; |
| 1720 dump_resource_load_callbacks_ = false; | 1712 dump_resource_load_callbacks_ = false; |
| 1721 dump_resource_request_callbacks_ = false; | 1713 dump_resource_request_callbacks_ = false; |
| 1722 dump_resource_response_mime_types_ = false; | 1714 dump_resource_response_mime_types_ = false; |
| 1723 dump_window_status_changes_ = false; | 1715 dump_window_status_changes_ = false; |
| 1724 dump_progress_finished_callback_ = false; | |
| 1725 dump_spell_check_callbacks_ = false; | 1716 dump_spell_check_callbacks_ = false; |
| 1726 dump_back_forward_list_ = false; | 1717 dump_back_forward_list_ = false; |
| 1727 dump_selection_rect_ = false; | 1718 dump_selection_rect_ = false; |
| 1728 dump_drag_image_ = false; | 1719 dump_drag_image_ = false; |
| 1729 dump_navigation_policy_ = false; | 1720 dump_navigation_policy_ = false; |
| 1730 test_repaint_ = false; | 1721 test_repaint_ = false; |
| 1731 sweep_horizontally_ = false; | 1722 sweep_horizontally_ = false; |
| 1732 is_printing_ = false; | 1723 is_printing_ = false; |
| 1733 midi_accessor_result_ = true; | 1724 midi_accessor_result_ = true; |
| 1734 should_stay_on_page_after_handling_before_unload_ = false; | 1725 should_stay_on_page_after_handling_before_unload_ = false; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1888 } | 1879 } |
| 1889 | 1880 |
| 1890 WebContentSettingsClient* TestRunner::GetWebContentSettings() const { | 1881 WebContentSettingsClient* TestRunner::GetWebContentSettings() const { |
| 1891 return web_content_settings_.get(); | 1882 return web_content_settings_.get(); |
| 1892 } | 1883 } |
| 1893 | 1884 |
| 1894 bool TestRunner::shouldDumpStatusCallbacks() const { | 1885 bool TestRunner::shouldDumpStatusCallbacks() const { |
| 1895 return dump_window_status_changes_; | 1886 return dump_window_status_changes_; |
| 1896 } | 1887 } |
| 1897 | 1888 |
| 1898 bool TestRunner::shouldDumpProgressFinishedCallback() const { | |
| 1899 return dump_progress_finished_callback_; | |
| 1900 } | |
| 1901 | |
| 1902 bool TestRunner::shouldDumpSpellCheckCallbacks() const { | 1889 bool TestRunner::shouldDumpSpellCheckCallbacks() const { |
| 1903 return dump_spell_check_callbacks_; | 1890 return dump_spell_check_callbacks_; |
| 1904 } | 1891 } |
| 1905 | 1892 |
| 1906 bool TestRunner::ShouldDumpBackForwardList() const { | 1893 bool TestRunner::ShouldDumpBackForwardList() const { |
| 1907 return dump_back_forward_list_; | 1894 return dump_back_forward_list_; |
| 1908 } | 1895 } |
| 1909 | 1896 |
| 1910 bool TestRunner::shouldDumpSelectionRect() const { | 1897 bool TestRunner::shouldDumpSelectionRect() const { |
| 1911 return dump_selection_rect_; | 1898 return dump_selection_rect_; |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2739 } | 2726 } |
| 2740 | 2727 |
| 2741 void TestRunner::DumpPermissionClientCallbacks() { | 2728 void TestRunner::DumpPermissionClientCallbacks() { |
| 2742 web_content_settings_->SetDumpCallbacks(true); | 2729 web_content_settings_->SetDumpCallbacks(true); |
| 2743 } | 2730 } |
| 2744 | 2731 |
| 2745 void TestRunner::DumpWindowStatusChanges() { | 2732 void TestRunner::DumpWindowStatusChanges() { |
| 2746 dump_window_status_changes_ = true; | 2733 dump_window_status_changes_ = true; |
| 2747 } | 2734 } |
| 2748 | 2735 |
| 2749 void TestRunner::DumpProgressFinishedCallback() { | |
| 2750 dump_progress_finished_callback_ = true; | |
| 2751 } | |
| 2752 | |
| 2753 void TestRunner::DumpSpellCheckCallbacks() { | 2736 void TestRunner::DumpSpellCheckCallbacks() { |
| 2754 dump_spell_check_callbacks_ = true; | 2737 dump_spell_check_callbacks_ = true; |
| 2755 } | 2738 } |
| 2756 | 2739 |
| 2757 void TestRunner::DumpBackForwardList() { | 2740 void TestRunner::DumpBackForwardList() { |
| 2758 dump_back_forward_list_ = true; | 2741 dump_back_forward_list_ = true; |
| 2759 } | 2742 } |
| 2760 | 2743 |
| 2761 void TestRunner::DumpSelectionRect() { | 2744 void TestRunner::DumpSelectionRect() { |
| 2762 dump_selection_rect_ = true; | 2745 dump_selection_rect_ = true; |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3152 } | 3135 } |
| 3153 | 3136 |
| 3154 void TestRunner::DidLosePointerLockInternal() { | 3137 void TestRunner::DidLosePointerLockInternal() { |
| 3155 bool was_locked = pointer_locked_; | 3138 bool was_locked = pointer_locked_; |
| 3156 pointer_locked_ = false; | 3139 pointer_locked_ = false; |
| 3157 if (was_locked) | 3140 if (was_locked) |
| 3158 web_view_->didLosePointerLock(); | 3141 web_view_->didLosePointerLock(); |
| 3159 } | 3142 } |
| 3160 | 3143 |
| 3161 } // namespace test_runner | 3144 } // namespace test_runner |
| OLD | NEW |