| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 .SetMethod("setStorageAllowed", &TestRunnerBindings::SetStorageAllowed) | 497 .SetMethod("setStorageAllowed", &TestRunnerBindings::SetStorageAllowed) |
| 499 .SetMethod("setPluginsAllowed", &TestRunnerBindings::SetPluginsAllowed) | 498 .SetMethod("setPluginsAllowed", &TestRunnerBindings::SetPluginsAllowed) |
| 500 .SetMethod("setAllowDisplayOfInsecureContent", | 499 .SetMethod("setAllowDisplayOfInsecureContent", |
| 501 &TestRunnerBindings::SetAllowDisplayOfInsecureContent) | 500 &TestRunnerBindings::SetAllowDisplayOfInsecureContent) |
| 502 .SetMethod("setAllowRunningOfInsecureContent", | 501 .SetMethod("setAllowRunningOfInsecureContent", |
| 503 &TestRunnerBindings::SetAllowRunningOfInsecureContent) | 502 &TestRunnerBindings::SetAllowRunningOfInsecureContent) |
| 504 .SetMethod("dumpPermissionClientCallbacks", | 503 .SetMethod("dumpPermissionClientCallbacks", |
| 505 &TestRunnerBindings::DumpPermissionClientCallbacks) | 504 &TestRunnerBindings::DumpPermissionClientCallbacks) |
| 506 .SetMethod("dumpWindowStatusChanges", | 505 .SetMethod("dumpWindowStatusChanges", |
| 507 &TestRunnerBindings::DumpWindowStatusChanges) | 506 &TestRunnerBindings::DumpWindowStatusChanges) |
| 508 .SetMethod("dumpProgressFinishedCallback", | |
| 509 &TestRunnerBindings::DumpProgressFinishedCallback) | |
| 510 .SetMethod("dumpSpellCheckCallbacks", | 507 .SetMethod("dumpSpellCheckCallbacks", |
| 511 &TestRunnerBindings::DumpSpellCheckCallbacks) | 508 &TestRunnerBindings::DumpSpellCheckCallbacks) |
| 512 .SetMethod("dumpBackForwardList", | 509 .SetMethod("dumpBackForwardList", |
| 513 &TestRunnerBindings::DumpBackForwardList) | 510 &TestRunnerBindings::DumpBackForwardList) |
| 514 .SetMethod("dumpSelectionRect", &TestRunnerBindings::DumpSelectionRect) | 511 .SetMethod("dumpSelectionRect", &TestRunnerBindings::DumpSelectionRect) |
| 515 .SetMethod("setPrinting", &TestRunnerBindings::SetPrinting) | 512 .SetMethod("setPrinting", &TestRunnerBindings::SetPrinting) |
| 516 .SetMethod("clearPrinting", &TestRunnerBindings::ClearPrinting) | 513 .SetMethod("clearPrinting", &TestRunnerBindings::ClearPrinting) |
| 517 .SetMethod( | 514 .SetMethod( |
| 518 "setShouldStayOnPageAfterHandlingBeforeUnload", | 515 "setShouldStayOnPageAfterHandlingBeforeUnload", |
| 519 &TestRunnerBindings::SetShouldStayOnPageAfterHandlingBeforeUnload) | 516 &TestRunnerBindings::SetShouldStayOnPageAfterHandlingBeforeUnload) |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 void TestRunnerBindings::DumpPermissionClientCallbacks() { | 1199 void TestRunnerBindings::DumpPermissionClientCallbacks() { |
| 1203 if (runner_) | 1200 if (runner_) |
| 1204 runner_->DumpPermissionClientCallbacks(); | 1201 runner_->DumpPermissionClientCallbacks(); |
| 1205 } | 1202 } |
| 1206 | 1203 |
| 1207 void TestRunnerBindings::DumpWindowStatusChanges() { | 1204 void TestRunnerBindings::DumpWindowStatusChanges() { |
| 1208 if (runner_) | 1205 if (runner_) |
| 1209 runner_->DumpWindowStatusChanges(); | 1206 runner_->DumpWindowStatusChanges(); |
| 1210 } | 1207 } |
| 1211 | 1208 |
| 1212 void TestRunnerBindings::DumpProgressFinishedCallback() { | |
| 1213 if (runner_) | |
| 1214 runner_->DumpProgressFinishedCallback(); | |
| 1215 } | |
| 1216 | |
| 1217 void TestRunnerBindings::DumpSpellCheckCallbacks() { | 1209 void TestRunnerBindings::DumpSpellCheckCallbacks() { |
| 1218 if (runner_) | 1210 if (runner_) |
| 1219 runner_->DumpSpellCheckCallbacks(); | 1211 runner_->DumpSpellCheckCallbacks(); |
| 1220 } | 1212 } |
| 1221 | 1213 |
| 1222 void TestRunnerBindings::DumpBackForwardList() { | 1214 void TestRunnerBindings::DumpBackForwardList() { |
| 1223 if (runner_) | 1215 if (runner_) |
| 1224 runner_->DumpBackForwardList(); | 1216 runner_->DumpBackForwardList(); |
| 1225 } | 1217 } |
| 1226 | 1218 |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1703 dump_frame_load_callbacks_ = false; | 1695 dump_frame_load_callbacks_ = false; |
| 1704 dump_ping_loader_callbacks_ = false; | 1696 dump_ping_loader_callbacks_ = false; |
| 1705 dump_user_gesture_in_frame_load_callbacks_ = false; | 1697 dump_user_gesture_in_frame_load_callbacks_ = false; |
| 1706 dump_title_changes_ = false; | 1698 dump_title_changes_ = false; |
| 1707 dump_create_view_ = false; | 1699 dump_create_view_ = false; |
| 1708 can_open_windows_ = false; | 1700 can_open_windows_ = false; |
| 1709 dump_resource_load_callbacks_ = false; | 1701 dump_resource_load_callbacks_ = false; |
| 1710 dump_resource_request_callbacks_ = false; | 1702 dump_resource_request_callbacks_ = false; |
| 1711 dump_resource_response_mime_types_ = false; | 1703 dump_resource_response_mime_types_ = false; |
| 1712 dump_window_status_changes_ = false; | 1704 dump_window_status_changes_ = false; |
| 1713 dump_progress_finished_callback_ = false; | |
| 1714 dump_spell_check_callbacks_ = false; | 1705 dump_spell_check_callbacks_ = false; |
| 1715 dump_back_forward_list_ = false; | 1706 dump_back_forward_list_ = false; |
| 1716 dump_selection_rect_ = false; | 1707 dump_selection_rect_ = false; |
| 1717 dump_drag_image_ = false; | 1708 dump_drag_image_ = false; |
| 1718 dump_navigation_policy_ = false; | 1709 dump_navigation_policy_ = false; |
| 1719 test_repaint_ = false; | 1710 test_repaint_ = false; |
| 1720 sweep_horizontally_ = false; | 1711 sweep_horizontally_ = false; |
| 1721 is_printing_ = false; | 1712 is_printing_ = false; |
| 1722 midi_accessor_result_ = true; | 1713 midi_accessor_result_ = true; |
| 1723 should_stay_on_page_after_handling_before_unload_ = false; | 1714 should_stay_on_page_after_handling_before_unload_ = false; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1877 } | 1868 } |
| 1878 | 1869 |
| 1879 WebContentSettingsClient* TestRunner::GetWebContentSettings() const { | 1870 WebContentSettingsClient* TestRunner::GetWebContentSettings() const { |
| 1880 return web_content_settings_.get(); | 1871 return web_content_settings_.get(); |
| 1881 } | 1872 } |
| 1882 | 1873 |
| 1883 bool TestRunner::shouldDumpStatusCallbacks() const { | 1874 bool TestRunner::shouldDumpStatusCallbacks() const { |
| 1884 return dump_window_status_changes_; | 1875 return dump_window_status_changes_; |
| 1885 } | 1876 } |
| 1886 | 1877 |
| 1887 bool TestRunner::shouldDumpProgressFinishedCallback() const { | |
| 1888 return dump_progress_finished_callback_; | |
| 1889 } | |
| 1890 | |
| 1891 bool TestRunner::shouldDumpSpellCheckCallbacks() const { | 1878 bool TestRunner::shouldDumpSpellCheckCallbacks() const { |
| 1892 return dump_spell_check_callbacks_; | 1879 return dump_spell_check_callbacks_; |
| 1893 } | 1880 } |
| 1894 | 1881 |
| 1895 bool TestRunner::ShouldDumpBackForwardList() const { | 1882 bool TestRunner::ShouldDumpBackForwardList() const { |
| 1896 return dump_back_forward_list_; | 1883 return dump_back_forward_list_; |
| 1897 } | 1884 } |
| 1898 | 1885 |
| 1899 bool TestRunner::shouldDumpSelectionRect() const { | 1886 bool TestRunner::shouldDumpSelectionRect() const { |
| 1900 return dump_selection_rect_; | 1887 return dump_selection_rect_; |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2728 } | 2715 } |
| 2729 | 2716 |
| 2730 void TestRunner::DumpPermissionClientCallbacks() { | 2717 void TestRunner::DumpPermissionClientCallbacks() { |
| 2731 web_content_settings_->SetDumpCallbacks(true); | 2718 web_content_settings_->SetDumpCallbacks(true); |
| 2732 } | 2719 } |
| 2733 | 2720 |
| 2734 void TestRunner::DumpWindowStatusChanges() { | 2721 void TestRunner::DumpWindowStatusChanges() { |
| 2735 dump_window_status_changes_ = true; | 2722 dump_window_status_changes_ = true; |
| 2736 } | 2723 } |
| 2737 | 2724 |
| 2738 void TestRunner::DumpProgressFinishedCallback() { | |
| 2739 dump_progress_finished_callback_ = true; | |
| 2740 } | |
| 2741 | |
| 2742 void TestRunner::DumpSpellCheckCallbacks() { | 2725 void TestRunner::DumpSpellCheckCallbacks() { |
| 2743 dump_spell_check_callbacks_ = true; | 2726 dump_spell_check_callbacks_ = true; |
| 2744 } | 2727 } |
| 2745 | 2728 |
| 2746 void TestRunner::DumpBackForwardList() { | 2729 void TestRunner::DumpBackForwardList() { |
| 2747 dump_back_forward_list_ = true; | 2730 dump_back_forward_list_ = true; |
| 2748 } | 2731 } |
| 2749 | 2732 |
| 2750 void TestRunner::DumpSelectionRect() { | 2733 void TestRunner::DumpSelectionRect() { |
| 2751 dump_selection_rect_ = true; | 2734 dump_selection_rect_ = true; |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3136 } | 3119 } |
| 3137 | 3120 |
| 3138 void TestRunner::DidLosePointerLockInternal() { | 3121 void TestRunner::DidLosePointerLockInternal() { |
| 3139 bool was_locked = pointer_locked_; | 3122 bool was_locked = pointer_locked_; |
| 3140 pointer_locked_ = false; | 3123 pointer_locked_ = false; |
| 3141 if (was_locked) | 3124 if (was_locked) |
| 3142 web_view_->didLosePointerLock(); | 3125 web_view_->didLosePointerLock(); |
| 3143 } | 3126 } |
| 3144 | 3127 |
| 3145 } // namespace test_runner | 3128 } // namespace test_runner |
| OLD | NEW |