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 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1342 if (view_runner_) | 1342 if (view_runner_) |
1343 view_runner_->SendBluetoothManualChooserEvent(event, argument); | 1343 view_runner_->SendBluetoothManualChooserEvent(event, argument); |
1344 } | 1344 } |
1345 | 1345 |
1346 void TestRunnerBindings::SetPOSIXLocale(const std::string& locale) { | 1346 void TestRunnerBindings::SetPOSIXLocale(const std::string& locale) { |
1347 if (runner_) | 1347 if (runner_) |
1348 runner_->SetPOSIXLocale(locale); | 1348 runner_->SetPOSIXLocale(locale); |
1349 } | 1349 } |
1350 | 1350 |
1351 void TestRunnerBindings::SetMIDIAccessorResult(bool result) { | 1351 void TestRunnerBindings::SetMIDIAccessorResult(bool result) { |
1352 if (runner_) | 1352 if (runner_) { |
1353 runner_->SetMIDIAccessorResult(result); | 1353 runner_->SetMIDIAccessorResult( |
| 1354 result ? media::midi::Result::OK |
| 1355 : media::midi::Result::INITIALIZATION_ERROR); |
| 1356 } |
1354 } | 1357 } |
1355 | 1358 |
1356 void TestRunnerBindings::SimulateWebNotificationClick(const std::string& title, | 1359 void TestRunnerBindings::SimulateWebNotificationClick(const std::string& title, |
1357 int action_index) { | 1360 int action_index) { |
1358 if (!runner_) | 1361 if (!runner_) |
1359 return; | 1362 return; |
1360 runner_->SimulateWebNotificationClick(title, action_index); | 1363 runner_->SimulateWebNotificationClick(title, action_index); |
1361 } | 1364 } |
1362 | 1365 |
1363 void TestRunnerBindings::SimulateWebNotificationClose(const std::string& title, | 1366 void TestRunnerBindings::SimulateWebNotificationClose(const std::string& title, |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1638 delegate_->DeleteAllCookies(); | 1641 delegate_->DeleteAllCookies(); |
1639 delegate_->SetBluetoothManualChooser(false); | 1642 delegate_->SetBluetoothManualChooser(false); |
1640 delegate_->ResetPermissions(); | 1643 delegate_->ResetPermissions(); |
1641 ResetDeviceLight(); | 1644 ResetDeviceLight(); |
1642 } | 1645 } |
1643 | 1646 |
1644 dump_as_audio_ = false; | 1647 dump_as_audio_ = false; |
1645 dump_back_forward_list_ = false; | 1648 dump_back_forward_list_ = false; |
1646 test_repaint_ = false; | 1649 test_repaint_ = false; |
1647 sweep_horizontally_ = false; | 1650 sweep_horizontally_ = false; |
1648 midi_accessor_result_ = true; | 1651 midi_accessor_result_ = media::midi::Result::OK; |
1649 has_custom_text_output_ = false; | 1652 has_custom_text_output_ = false; |
1650 custom_text_output_.clear(); | 1653 custom_text_output_.clear(); |
1651 | 1654 |
1652 http_headers_to_clear_.clear(); | 1655 http_headers_to_clear_.clear(); |
1653 | 1656 |
1654 platform_name_ = "chromium"; | 1657 platform_name_ = "chromium"; |
1655 tooltip_text_ = std::string(); | 1658 tooltip_text_ = std::string(); |
1656 web_history_item_count_ = 0; | 1659 web_history_item_count_ = 0; |
1657 | 1660 |
1658 SetUseMockTheme(true); | 1661 SetUseMockTheme(true); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1935 if (layout_test_runtime_flags_.dump_drag_image()) { | 1938 if (layout_test_runtime_flags_.dump_drag_image()) { |
1936 if (drag_image_.isNull()) | 1939 if (drag_image_.isNull()) |
1937 drag_image_ = drag_image; | 1940 drag_image_ = drag_image; |
1938 } | 1941 } |
1939 } | 1942 } |
1940 | 1943 |
1941 bool TestRunner::shouldDumpNavigationPolicy() const { | 1944 bool TestRunner::shouldDumpNavigationPolicy() const { |
1942 return layout_test_runtime_flags_.dump_navigation_policy(); | 1945 return layout_test_runtime_flags_.dump_navigation_policy(); |
1943 } | 1946 } |
1944 | 1947 |
1945 bool TestRunner::midiAccessorResult() { | 1948 media::midi::Result TestRunner::midiAccessorResult() { |
1946 return midi_accessor_result_; | 1949 return midi_accessor_result_; |
1947 } | 1950 } |
1948 | 1951 |
1949 void TestRunner::ClearDevToolsLocalStorage() { | 1952 void TestRunner::ClearDevToolsLocalStorage() { |
1950 delegate_->ClearDevToolsLocalStorage(); | 1953 delegate_->ClearDevToolsLocalStorage(); |
1951 } | 1954 } |
1952 | 1955 |
1953 void TestRunner::ShowDevTools(const std::string& settings, | 1956 void TestRunner::ShowDevTools(const std::string& settings, |
1954 const std::string& frontend_url) { | 1957 const std::string& frontend_url) { |
1955 delegate_->ShowDevTools(settings, frontend_url); | 1958 delegate_->ShowDevTools(settings, frontend_url); |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2674 const std::string& platform) { | 2677 const std::string& platform) { |
2675 if (!test_interfaces_->GetAppBannerClient()) | 2678 if (!test_interfaces_->GetAppBannerClient()) |
2676 return; | 2679 return; |
2677 test_interfaces_->GetAppBannerClient()->ResolvePromise(request_id, platform); | 2680 test_interfaces_->GetAppBannerClient()->ResolvePromise(request_id, platform); |
2678 } | 2681 } |
2679 | 2682 |
2680 void TestRunner::SetPOSIXLocale(const std::string& locale) { | 2683 void TestRunner::SetPOSIXLocale(const std::string& locale) { |
2681 delegate_->SetLocale(locale); | 2684 delegate_->SetLocale(locale); |
2682 } | 2685 } |
2683 | 2686 |
2684 void TestRunner::SetMIDIAccessorResult(bool result) { | 2687 void TestRunner::SetMIDIAccessorResult(media::midi::Result result) { |
2685 midi_accessor_result_ = result; | 2688 midi_accessor_result_ = result; |
2686 } | 2689 } |
2687 | 2690 |
2688 void TestRunner::SimulateWebNotificationClick(const std::string& title, | 2691 void TestRunner::SimulateWebNotificationClick(const std::string& title, |
2689 int action_index) { | 2692 int action_index) { |
2690 delegate_->SimulateWebNotificationClick(title, action_index); | 2693 delegate_->SimulateWebNotificationClick(title, action_index); |
2691 } | 2694 } |
2692 | 2695 |
2693 void TestRunner::SimulateWebNotificationClose(const std::string& title, | 2696 void TestRunner::SimulateWebNotificationClose(const std::string& title, |
2694 bool by_user) { | 2697 bool by_user) { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2770 | 2773 |
2771 void TestRunner::NotifyDone() { | 2774 void TestRunner::NotifyDone() { |
2772 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && | 2775 if (layout_test_runtime_flags_.wait_until_done() && !topLoadingFrame() && |
2773 !will_navigate_ && work_queue_.is_empty()) | 2776 !will_navigate_ && work_queue_.is_empty()) |
2774 delegate_->TestFinished(); | 2777 delegate_->TestFinished(); |
2775 layout_test_runtime_flags_.set_wait_until_done(false); | 2778 layout_test_runtime_flags_.set_wait_until_done(false); |
2776 OnLayoutTestRuntimeFlagsChanged(); | 2779 OnLayoutTestRuntimeFlagsChanged(); |
2777 } | 2780 } |
2778 | 2781 |
2779 } // namespace test_runner | 2782 } // namespace test_runner |
OLD | NEW |