| 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 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "components/test_runner/app_banner_client.h" |
| 17 #include "components/test_runner/mock_credential_manager_client.h" | 18 #include "components/test_runner/mock_credential_manager_client.h" |
| 18 #include "components/test_runner/mock_web_speech_recognizer.h" | 19 #include "components/test_runner/mock_web_speech_recognizer.h" |
| 19 #include "components/test_runner/test_interfaces.h" | 20 #include "components/test_runner/test_interfaces.h" |
| 20 #include "components/test_runner/test_preferences.h" | 21 #include "components/test_runner/test_preferences.h" |
| 21 #include "components/test_runner/web_content_settings.h" | 22 #include "components/test_runner/web_content_settings.h" |
| 22 #include "components/test_runner/web_test_delegate.h" | 23 #include "components/test_runner/web_test_delegate.h" |
| 23 #include "components/test_runner/web_test_proxy.h" | 24 #include "components/test_runner/web_test_proxy.h" |
| 24 #include "gin/arguments.h" | 25 #include "gin/arguments.h" |
| 25 #include "gin/array_buffer.h" | 26 #include "gin/array_buffer.h" |
| 26 #include "gin/handle.h" | 27 #include "gin/handle.h" |
| (...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1544 return runner_->DispatchBeforeInstallPromptEvent(request_id, event_platforms, | 1545 return runner_->DispatchBeforeInstallPromptEvent(request_id, event_platforms, |
| 1545 callback); | 1546 callback); |
| 1546 } | 1547 } |
| 1547 | 1548 |
| 1548 void TestRunnerBindings::ResolveBeforeInstallPromptPromise( | 1549 void TestRunnerBindings::ResolveBeforeInstallPromptPromise( |
| 1549 int request_id, | 1550 int request_id, |
| 1550 const std::string& platform) { | 1551 const std::string& platform) { |
| 1551 if (!runner_) | 1552 if (!runner_) |
| 1552 return; | 1553 return; |
| 1553 | 1554 |
| 1554 return runner_->ResolveBeforeInstallPromptPromise(request_id, platform); | 1555 runner_->ResolveBeforeInstallPromptPromise(request_id, platform); |
| 1555 } | 1556 } |
| 1556 | 1557 |
| 1557 std::string TestRunnerBindings::PlatformName() { | 1558 std::string TestRunnerBindings::PlatformName() { |
| 1558 if (runner_) | 1559 if (runner_) |
| 1559 return runner_->platform_name_; | 1560 return runner_->platform_name_; |
| 1560 return std::string(); | 1561 return std::string(); |
| 1561 } | 1562 } |
| 1562 | 1563 |
| 1563 std::string TestRunnerBindings::TooltipText() { | 1564 std::string TestRunnerBindings::TooltipText() { |
| 1564 if (runner_) | 1565 if (runner_) |
| (...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2927 | 2928 |
| 2928 delegate_->DispatchBeforeInstallPromptEvent( | 2929 delegate_->DispatchBeforeInstallPromptEvent( |
| 2929 request_id, event_platforms, | 2930 request_id, event_platforms, |
| 2930 base::Bind(&TestRunner::DispatchBeforeInstallPromptCallback, | 2931 base::Bind(&TestRunner::DispatchBeforeInstallPromptCallback, |
| 2931 weak_factory_.GetWeakPtr(), base::Passed(&task))); | 2932 weak_factory_.GetWeakPtr(), base::Passed(&task))); |
| 2932 } | 2933 } |
| 2933 | 2934 |
| 2934 void TestRunner::ResolveBeforeInstallPromptPromise( | 2935 void TestRunner::ResolveBeforeInstallPromptPromise( |
| 2935 int request_id, | 2936 int request_id, |
| 2936 const std::string& platform) { | 2937 const std::string& platform) { |
| 2937 delegate_->ResolveBeforeInstallPromptPromise(request_id, platform); | 2938 test_interfaces_->GetAppBannerClient()->ResolvePromise(request_id, platform); |
| 2938 } | 2939 } |
| 2939 | 2940 |
| 2940 void TestRunner::SetPOSIXLocale(const std::string& locale) { | 2941 void TestRunner::SetPOSIXLocale(const std::string& locale) { |
| 2941 delegate_->SetLocale(locale); | 2942 delegate_->SetLocale(locale); |
| 2942 } | 2943 } |
| 2943 | 2944 |
| 2944 void TestRunner::SetMIDIAccessorResult(bool result) { | 2945 void TestRunner::SetMIDIAccessorResult(bool result) { |
| 2945 midi_accessor_result_ = result; | 2946 midi_accessor_result_ = result; |
| 2946 } | 2947 } |
| 2947 | 2948 |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3202 } | 3203 } |
| 3203 | 3204 |
| 3204 void TestRunner::DidLosePointerLockInternal() { | 3205 void TestRunner::DidLosePointerLockInternal() { |
| 3205 bool was_locked = pointer_locked_; | 3206 bool was_locked = pointer_locked_; |
| 3206 pointer_locked_ = false; | 3207 pointer_locked_ = false; |
| 3207 if (was_locked) | 3208 if (was_locked) |
| 3208 web_view_->didLosePointerLock(); | 3209 web_view_->didLosePointerLock(); |
| 3209 } | 3210 } |
| 3210 | 3211 |
| 3211 } // namespace test_runner | 3212 } // namespace test_runner |
| OLD | NEW |