| 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 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1597 delegate_->SetLocale(""); | 1597 delegate_->SetLocale(""); |
| 1598 delegate_->UseUnfortunateSynchronousResizeMode(false); | 1598 delegate_->UseUnfortunateSynchronousResizeMode(false); |
| 1599 delegate_->DisableAutoResizeMode(WebSize()); | 1599 delegate_->DisableAutoResizeMode(WebSize()); |
| 1600 delegate_->DeleteAllCookies(); | 1600 delegate_->DeleteAllCookies(); |
| 1601 delegate_->SetBluetoothManualChooser(false); | 1601 delegate_->SetBluetoothManualChooser(false); |
| 1602 delegate_->ResetPermissions(); | 1602 delegate_->ResetPermissions(); |
| 1603 ResetDeviceLight(); | 1603 ResetDeviceLight(); |
| 1604 } | 1604 } |
| 1605 | 1605 |
| 1606 dump_as_audio_ = false; | 1606 dump_as_audio_ = false; |
| 1607 dump_create_view_ = false; | |
| 1608 dump_window_status_changes_ = false; | |
| 1609 dump_spell_check_callbacks_ = false; | |
| 1610 dump_back_forward_list_ = false; | 1607 dump_back_forward_list_ = false; |
| 1611 test_repaint_ = false; | 1608 test_repaint_ = false; |
| 1612 sweep_horizontally_ = false; | 1609 sweep_horizontally_ = false; |
| 1613 midi_accessor_result_ = true; | 1610 midi_accessor_result_ = true; |
| 1614 has_custom_text_output_ = false; | 1611 has_custom_text_output_ = false; |
| 1615 custom_text_output_.clear(); | 1612 custom_text_output_.clear(); |
| 1616 | 1613 |
| 1617 http_headers_to_clear_.clear(); | 1614 http_headers_to_clear_.clear(); |
| 1618 | 1615 |
| 1619 platform_name_ = "chromium"; | 1616 platform_name_ = "chromium"; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1770 | 1767 |
| 1771 bool TestRunner::shouldDumpTitleChanges() const { | 1768 bool TestRunner::shouldDumpTitleChanges() const { |
| 1772 return layout_test_runtime_flags_.dump_title_changes(); | 1769 return layout_test_runtime_flags_.dump_title_changes(); |
| 1773 } | 1770 } |
| 1774 | 1771 |
| 1775 bool TestRunner::shouldDumpIconChanges() const { | 1772 bool TestRunner::shouldDumpIconChanges() const { |
| 1776 return layout_test_runtime_flags_.dump_icon_changes(); | 1773 return layout_test_runtime_flags_.dump_icon_changes(); |
| 1777 } | 1774 } |
| 1778 | 1775 |
| 1779 bool TestRunner::shouldDumpCreateView() const { | 1776 bool TestRunner::shouldDumpCreateView() const { |
| 1780 return dump_create_view_; | 1777 return layout_test_runtime_flags_.dump_create_view(); |
| 1781 } | 1778 } |
| 1782 | 1779 |
| 1783 bool TestRunner::canOpenWindows() const { | 1780 bool TestRunner::canOpenWindows() const { |
| 1784 return layout_test_runtime_flags_.can_open_windows(); | 1781 return layout_test_runtime_flags_.can_open_windows(); |
| 1785 } | 1782 } |
| 1786 | 1783 |
| 1787 bool TestRunner::shouldDumpResourceLoadCallbacks() const { | 1784 bool TestRunner::shouldDumpResourceLoadCallbacks() const { |
| 1788 return test_is_running_ && | 1785 return test_is_running_ && |
| 1789 layout_test_runtime_flags_.dump_resource_load_callbacks(); | 1786 layout_test_runtime_flags_.dump_resource_load_callbacks(); |
| 1790 } | 1787 } |
| 1791 | 1788 |
| 1792 bool TestRunner::shouldDumpResourceResponseMIMETypes() const { | 1789 bool TestRunner::shouldDumpResourceResponseMIMETypes() const { |
| 1793 return test_is_running_ && | 1790 return test_is_running_ && |
| 1794 layout_test_runtime_flags_.dump_resource_response_mime_types(); | 1791 layout_test_runtime_flags_.dump_resource_response_mime_types(); |
| 1795 } | 1792 } |
| 1796 | 1793 |
| 1797 WebContentSettingsClient* TestRunner::GetWebContentSettings() const { | 1794 WebContentSettingsClient* TestRunner::GetWebContentSettings() const { |
| 1798 return mock_content_settings_client_.get(); | 1795 return mock_content_settings_client_.get(); |
| 1799 } | 1796 } |
| 1800 | 1797 |
| 1801 void TestRunner::InitializeWebViewWithMocks(blink::WebView* web_view) { | 1798 void TestRunner::InitializeWebViewWithMocks(blink::WebView* web_view) { |
| 1802 web_view->setSpellCheckClient(spellcheck_.get()); | 1799 web_view->setSpellCheckClient(spellcheck_.get()); |
| 1803 web_view->setCredentialManagerClient(credential_manager_client_.get()); | 1800 web_view->setCredentialManagerClient(credential_manager_client_.get()); |
| 1804 } | 1801 } |
| 1805 | 1802 |
| 1806 bool TestRunner::shouldDumpStatusCallbacks() const { | 1803 bool TestRunner::shouldDumpStatusCallbacks() const { |
| 1807 return dump_window_status_changes_; | 1804 return layout_test_runtime_flags_.dump_window_status_changes(); |
| 1808 } | 1805 } |
| 1809 | 1806 |
| 1810 bool TestRunner::shouldDumpSpellCheckCallbacks() const { | 1807 bool TestRunner::shouldDumpSpellCheckCallbacks() const { |
| 1811 return dump_spell_check_callbacks_; | 1808 return layout_test_runtime_flags_.dump_spell_check_callbacks(); |
| 1812 } | 1809 } |
| 1813 | 1810 |
| 1814 bool TestRunner::ShouldDumpBackForwardList() const { | 1811 bool TestRunner::ShouldDumpBackForwardList() const { |
| 1815 return dump_back_forward_list_; | 1812 return dump_back_forward_list_; |
| 1816 } | 1813 } |
| 1817 | 1814 |
| 1818 bool TestRunner::isPrinting() const { | 1815 bool TestRunner::isPrinting() const { |
| 1819 return layout_test_runtime_flags_.is_printing(); | 1816 return layout_test_runtime_flags_.is_printing(); |
| 1820 } | 1817 } |
| 1821 | 1818 |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2421 true); | 2418 true); |
| 2422 OnLayoutTestRuntimeFlagsChanged(); | 2419 OnLayoutTestRuntimeFlagsChanged(); |
| 2423 } | 2420 } |
| 2424 | 2421 |
| 2425 void TestRunner::DumpTitleChanges() { | 2422 void TestRunner::DumpTitleChanges() { |
| 2426 layout_test_runtime_flags_.set_dump_title_changes(true); | 2423 layout_test_runtime_flags_.set_dump_title_changes(true); |
| 2427 OnLayoutTestRuntimeFlagsChanged(); | 2424 OnLayoutTestRuntimeFlagsChanged(); |
| 2428 } | 2425 } |
| 2429 | 2426 |
| 2430 void TestRunner::DumpCreateView() { | 2427 void TestRunner::DumpCreateView() { |
| 2431 dump_create_view_ = true; | 2428 layout_test_runtime_flags_.set_dump_create_view(true); |
| 2429 OnLayoutTestRuntimeFlagsChanged(); |
| 2432 } | 2430 } |
| 2433 | 2431 |
| 2434 void TestRunner::SetCanOpenWindows() { | 2432 void TestRunner::SetCanOpenWindows() { |
| 2435 layout_test_runtime_flags_.set_can_open_windows(true); | 2433 layout_test_runtime_flags_.set_can_open_windows(true); |
| 2436 OnLayoutTestRuntimeFlagsChanged(); | 2434 OnLayoutTestRuntimeFlagsChanged(); |
| 2437 } | 2435 } |
| 2438 | 2436 |
| 2439 void TestRunner::DumpResourceLoadCallbacks() { | 2437 void TestRunner::DumpResourceLoadCallbacks() { |
| 2440 layout_test_runtime_flags_.set_dump_resource_load_callbacks(true); | 2438 layout_test_runtime_flags_.set_dump_resource_load_callbacks(true); |
| 2441 OnLayoutTestRuntimeFlagsChanged(); | 2439 OnLayoutTestRuntimeFlagsChanged(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2481 OnLayoutTestRuntimeFlagsChanged(); | 2479 OnLayoutTestRuntimeFlagsChanged(); |
| 2482 } | 2480 } |
| 2483 | 2481 |
| 2484 void TestRunner::DumpPermissionClientCallbacks() { | 2482 void TestRunner::DumpPermissionClientCallbacks() { |
| 2485 layout_test_runtime_flags_.set_dump_web_content_settings_client_callbacks( | 2483 layout_test_runtime_flags_.set_dump_web_content_settings_client_callbacks( |
| 2486 true); | 2484 true); |
| 2487 OnLayoutTestRuntimeFlagsChanged(); | 2485 OnLayoutTestRuntimeFlagsChanged(); |
| 2488 } | 2486 } |
| 2489 | 2487 |
| 2490 void TestRunner::DumpWindowStatusChanges() { | 2488 void TestRunner::DumpWindowStatusChanges() { |
| 2491 dump_window_status_changes_ = true; | 2489 layout_test_runtime_flags_.set_dump_window_status_changes(true); |
| 2490 OnLayoutTestRuntimeFlagsChanged(); |
| 2492 } | 2491 } |
| 2493 | 2492 |
| 2494 void TestRunner::DumpSpellCheckCallbacks() { | 2493 void TestRunner::DumpSpellCheckCallbacks() { |
| 2495 dump_spell_check_callbacks_ = true; | 2494 layout_test_runtime_flags_.set_dump_spell_check_callbacks(true); |
| 2495 OnLayoutTestRuntimeFlagsChanged(); |
| 2496 } | 2496 } |
| 2497 | 2497 |
| 2498 void TestRunner::DumpBackForwardList() { | 2498 void TestRunner::DumpBackForwardList() { |
| 2499 dump_back_forward_list_ = true; | 2499 dump_back_forward_list_ = true; |
| 2500 } | 2500 } |
| 2501 | 2501 |
| 2502 void TestRunner::DumpSelectionRect() { | 2502 void TestRunner::DumpSelectionRect() { |
| 2503 layout_test_runtime_flags_.set_dump_selection_rect(true); | 2503 layout_test_runtime_flags_.set_dump_selection_rect(true); |
| 2504 OnLayoutTestRuntimeFlagsChanged(); | 2504 OnLayoutTestRuntimeFlagsChanged(); |
| 2505 } | 2505 } |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2718 | 2718 |
| 2719 void TestRunner::NotifyDone() { | 2719 void TestRunner::NotifyDone() { |
| 2720 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2720 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
| 2721 work_queue_.is_empty()) | 2721 work_queue_.is_empty()) |
| 2722 delegate_->TestFinished(); | 2722 delegate_->TestFinished(); |
| 2723 layout_test_runtime_flags_.set_wait_until_done(false); | 2723 layout_test_runtime_flags_.set_wait_until_done(false); |
| 2724 OnLayoutTestRuntimeFlagsChanged(); | 2724 OnLayoutTestRuntimeFlagsChanged(); |
| 2725 } | 2725 } |
| 2726 | 2726 |
| 2727 } // namespace test_runner | 2727 } // namespace test_runner |
| OLD | NEW |