| 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 "content/shell/renderer/test_runner/test_runner.h" | 5 #include "content/shell/renderer/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 "content/public/test/layouttest_support.h" | 10 #include "content/public/test/layouttest_support.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 void SetWindowIsKey(bool value); | 266 void SetWindowIsKey(bool value); |
| 267 std::string PathToLocalResource(const std::string& path); | 267 std::string PathToLocalResource(const std::string& path); |
| 268 void SetBackingScaleFactor(double value, v8::Handle<v8::Function> callback); | 268 void SetBackingScaleFactor(double value, v8::Handle<v8::Function> callback); |
| 269 void SetColorProfile(const std::string& name, | 269 void SetColorProfile(const std::string& name, |
| 270 v8::Handle<v8::Function> callback); | 270 v8::Handle<v8::Function> callback); |
| 271 void SetPOSIXLocale(const std::string& locale); | 271 void SetPOSIXLocale(const std::string& locale); |
| 272 void SetMIDIAccessorResult(bool result); | 272 void SetMIDIAccessorResult(bool result); |
| 273 void SetMIDISysexPermission(bool value); | 273 void SetMIDISysexPermission(bool value); |
| 274 void GrantWebNotificationPermission(gin::Arguments* args); | 274 void GrantWebNotificationPermission(gin::Arguments* args); |
| 275 void ClearWebNotificationPermissions(); | 275 void ClearWebNotificationPermissions(); |
| 276 bool SimulateWebNotificationClick(const std::string& value); | 276 void SimulateWebNotificationClick(const std::string& title); |
| 277 void AddMockSpeechRecognitionResult(const std::string& transcript, | 277 void AddMockSpeechRecognitionResult(const std::string& transcript, |
| 278 double confidence); | 278 double confidence); |
| 279 void SetMockSpeechRecognitionError(const std::string& error, | 279 void SetMockSpeechRecognitionError(const std::string& error, |
| 280 const std::string& message); | 280 const std::string& message); |
| 281 bool WasMockSpeechRecognitionAborted(); | 281 bool WasMockSpeechRecognitionAborted(); |
| 282 void AddMockCredentialManagerResponse(const std::string& id, | 282 void AddMockCredentialManagerResponse(const std::string& id, |
| 283 const std::string& name, | 283 const std::string& name, |
| 284 const std::string& avatar, | 284 const std::string& avatar, |
| 285 const std::string& password); | 285 const std::string& password); |
| 286 void AddWebPageOverlay(); | 286 void AddWebPageOverlay(); |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1300 return runner_->GrantWebNotificationPermission(GURL(origin), | 1300 return runner_->GrantWebNotificationPermission(GURL(origin), |
| 1301 permission_granted); | 1301 permission_granted); |
| 1302 } | 1302 } |
| 1303 } | 1303 } |
| 1304 | 1304 |
| 1305 void TestRunnerBindings::ClearWebNotificationPermissions() { | 1305 void TestRunnerBindings::ClearWebNotificationPermissions() { |
| 1306 if (runner_) | 1306 if (runner_) |
| 1307 runner_->ClearWebNotificationPermissions(); | 1307 runner_->ClearWebNotificationPermissions(); |
| 1308 } | 1308 } |
| 1309 | 1309 |
| 1310 bool TestRunnerBindings::SimulateWebNotificationClick( | 1310 void TestRunnerBindings::SimulateWebNotificationClick( |
| 1311 const std::string& value) { | 1311 const std::string& title) { |
| 1312 if (runner_) | 1312 if (runner_) |
| 1313 return runner_->SimulateWebNotificationClick(value); | 1313 runner_->SimulateWebNotificationClick(title); |
| 1314 return false; | |
| 1315 } | 1314 } |
| 1316 | 1315 |
| 1317 void TestRunnerBindings::AddMockSpeechRecognitionResult( | 1316 void TestRunnerBindings::AddMockSpeechRecognitionResult( |
| 1318 const std::string& transcript, double confidence) { | 1317 const std::string& transcript, double confidence) { |
| 1319 if (runner_) | 1318 if (runner_) |
| 1320 runner_->AddMockSpeechRecognitionResult(transcript, confidence); | 1319 runner_->AddMockSpeechRecognitionResult(transcript, confidence); |
| 1321 } | 1320 } |
| 1322 | 1321 |
| 1323 void TestRunnerBindings::SetMockSpeechRecognitionError( | 1322 void TestRunnerBindings::SetMockSpeechRecognitionError( |
| 1324 const std::string& error, const std::string& message) { | 1323 const std::string& error, const std::string& message) { |
| (...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2746 | 2745 |
| 2747 void TestRunner::GrantWebNotificationPermission(const GURL& origin, | 2746 void TestRunner::GrantWebNotificationPermission(const GURL& origin, |
| 2748 bool permission_granted) { | 2747 bool permission_granted) { |
| 2749 delegate_->GrantWebNotificationPermission(origin, permission_granted); | 2748 delegate_->GrantWebNotificationPermission(origin, permission_granted); |
| 2750 } | 2749 } |
| 2751 | 2750 |
| 2752 void TestRunner::ClearWebNotificationPermissions() { | 2751 void TestRunner::ClearWebNotificationPermissions() { |
| 2753 delegate_->ClearWebNotificationPermissions(); | 2752 delegate_->ClearWebNotificationPermissions(); |
| 2754 } | 2753 } |
| 2755 | 2754 |
| 2756 bool TestRunner::SimulateWebNotificationClick(const std::string& value) { | 2755 void TestRunner::SimulateWebNotificationClick(const std::string& title) { |
| 2757 return notification_presenter_->SimulateClick(value); | 2756 delegate_->SimulateWebNotificationClick(title); |
| 2757 |
| 2758 // TODO(peter): Remove this call once Web Notifications switch away from the |
| 2759 // WebFrame-based code path. |
| 2760 notification_presenter_->SimulateClick(title); |
| 2758 } | 2761 } |
| 2759 | 2762 |
| 2760 void TestRunner::AddMockSpeechRecognitionResult(const std::string& transcript, | 2763 void TestRunner::AddMockSpeechRecognitionResult(const std::string& transcript, |
| 2761 double confidence) { | 2764 double confidence) { |
| 2762 proxy_->GetSpeechRecognizerMock()->AddMockResult( | 2765 proxy_->GetSpeechRecognizerMock()->AddMockResult( |
| 2763 WebString::fromUTF8(transcript), confidence); | 2766 WebString::fromUTF8(transcript), confidence); |
| 2764 } | 2767 } |
| 2765 | 2768 |
| 2766 void TestRunner::SetMockSpeechRecognitionError(const std::string& error, | 2769 void TestRunner::SetMockSpeechRecognitionError(const std::string& error, |
| 2767 const std::string& message) { | 2770 const std::string& message) { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2945 } | 2948 } |
| 2946 | 2949 |
| 2947 void TestRunner::DidLosePointerLockInternal() { | 2950 void TestRunner::DidLosePointerLockInternal() { |
| 2948 bool was_locked = pointer_locked_; | 2951 bool was_locked = pointer_locked_; |
| 2949 pointer_locked_ = false; | 2952 pointer_locked_ = false; |
| 2950 if (was_locked) | 2953 if (was_locked) |
| 2951 web_view_->didLosePointerLock(); | 2954 web_view_->didLosePointerLock(); |
| 2952 } | 2955 } |
| 2953 | 2956 |
| 2954 } // namespace content | 2957 } // namespace content |
| OLD | NEW |