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 23 matching lines...) Expand all Loading... |
34 #include "third_party/WebKit/public/web/WebArrayBufferConverter.h" | 34 #include "third_party/WebKit/public/web/WebArrayBufferConverter.h" |
35 #include "third_party/WebKit/public/web/WebBindings.h" | 35 #include "third_party/WebKit/public/web/WebBindings.h" |
36 #include "third_party/WebKit/public/web/WebDataSource.h" | 36 #include "third_party/WebKit/public/web/WebDataSource.h" |
37 #include "third_party/WebKit/public/web/WebDocument.h" | 37 #include "third_party/WebKit/public/web/WebDocument.h" |
38 #include "third_party/WebKit/public/web/WebFindOptions.h" | 38 #include "third_party/WebKit/public/web/WebFindOptions.h" |
39 #include "third_party/WebKit/public/web/WebFrame.h" | 39 #include "third_party/WebKit/public/web/WebFrame.h" |
40 #include "third_party/WebKit/public/web/WebGraphicsContext.h" | 40 #include "third_party/WebKit/public/web/WebGraphicsContext.h" |
41 #include "third_party/WebKit/public/web/WebInputElement.h" | 41 #include "third_party/WebKit/public/web/WebInputElement.h" |
42 #include "third_party/WebKit/public/web/WebKit.h" | 42 #include "third_party/WebKit/public/web/WebKit.h" |
43 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 43 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
44 #include "third_party/WebKit/public/web/WebMIDIClientMock.h" | |
45 #include "third_party/WebKit/public/web/WebPageOverlay.h" | 44 #include "third_party/WebKit/public/web/WebPageOverlay.h" |
46 #include "third_party/WebKit/public/web/WebScriptSource.h" | 45 #include "third_party/WebKit/public/web/WebScriptSource.h" |
47 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 46 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
48 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" | 47 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" |
49 #include "third_party/WebKit/public/web/WebSettings.h" | 48 #include "third_party/WebKit/public/web/WebSettings.h" |
50 #include "third_party/WebKit/public/web/WebSurroundingText.h" | 49 #include "third_party/WebKit/public/web/WebSurroundingText.h" |
51 #include "third_party/WebKit/public/web/WebView.h" | 50 #include "third_party/WebKit/public/web/WebView.h" |
52 #include "third_party/skia/include/core/SkBitmap.h" | 51 #include "third_party/skia/include/core/SkBitmap.h" |
53 #include "third_party/skia/include/core/SkCanvas.h" | 52 #include "third_party/skia/include/core/SkCanvas.h" |
54 #include "ui/gfx/geometry/rect.h" | 53 #include "ui/gfx/geometry/rect.h" |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 if (runner_) | 1323 if (runner_) |
1325 runner_->SetPOSIXLocale(locale); | 1324 runner_->SetPOSIXLocale(locale); |
1326 } | 1325 } |
1327 | 1326 |
1328 void TestRunnerBindings::SetMIDIAccessorResult(bool result) { | 1327 void TestRunnerBindings::SetMIDIAccessorResult(bool result) { |
1329 if (runner_) | 1328 if (runner_) |
1330 runner_->SetMIDIAccessorResult(result); | 1329 runner_->SetMIDIAccessorResult(result); |
1331 } | 1330 } |
1332 | 1331 |
1333 void TestRunnerBindings::SetMIDISysexPermission(bool value) { | 1332 void TestRunnerBindings::SetMIDISysexPermission(bool value) { |
1334 if (runner_) | |
1335 runner_->SetMIDISysexPermission(value); | |
1336 } | 1333 } |
1337 | 1334 |
1338 void TestRunnerBindings::GrantWebNotificationPermission(gin::Arguments* args) { | 1335 void TestRunnerBindings::GrantWebNotificationPermission(gin::Arguments* args) { |
1339 if (runner_) { | 1336 if (runner_) { |
1340 std::string origin; | 1337 std::string origin; |
1341 bool permission_granted = true; | 1338 bool permission_granted = true; |
1342 args->GetNext(&origin); | 1339 args->GetNext(&origin); |
1343 args->GetNext(&permission_granted); | 1340 args->GetNext(&permission_granted); |
1344 return runner_->GrantWebNotificationPermission(GURL(origin), | 1341 return runner_->GrantWebNotificationPermission(GURL(origin), |
1345 permission_granted); | 1342 permission_granted); |
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2831 } | 2828 } |
2832 | 2829 |
2833 void TestRunner::SetPOSIXLocale(const std::string& locale) { | 2830 void TestRunner::SetPOSIXLocale(const std::string& locale) { |
2834 delegate_->SetLocale(locale); | 2831 delegate_->SetLocale(locale); |
2835 } | 2832 } |
2836 | 2833 |
2837 void TestRunner::SetMIDIAccessorResult(bool result) { | 2834 void TestRunner::SetMIDIAccessorResult(bool result) { |
2838 midi_accessor_result_ = result; | 2835 midi_accessor_result_ = result; |
2839 } | 2836 } |
2840 | 2837 |
2841 void TestRunner::SetMIDISysexPermission(bool value) { | |
2842 for (auto* window : test_interfaces_->GetWindowList()) | |
2843 window->GetMIDIClientMock()->setSysexPermission(value); | |
2844 } | |
2845 | |
2846 void TestRunner::GrantWebNotificationPermission(const GURL& origin, | 2838 void TestRunner::GrantWebNotificationPermission(const GURL& origin, |
2847 bool permission_granted) { | 2839 bool permission_granted) { |
2848 delegate_->GrantWebNotificationPermission(origin, permission_granted); | 2840 delegate_->GrantWebNotificationPermission(origin, permission_granted); |
2849 } | 2841 } |
2850 | 2842 |
2851 void TestRunner::ClearWebNotificationPermissions() { | 2843 void TestRunner::ClearWebNotificationPermissions() { |
2852 delegate_->ClearWebNotificationPermissions(); | 2844 delegate_->ClearWebNotificationPermissions(); |
2853 } | 2845 } |
2854 | 2846 |
2855 void TestRunner::SimulateWebNotificationClick(const std::string& title) { | 2847 void TestRunner::SimulateWebNotificationClick(const std::string& title) { |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3040 } | 3032 } |
3041 | 3033 |
3042 void TestRunner::DidLosePointerLockInternal() { | 3034 void TestRunner::DidLosePointerLockInternal() { |
3043 bool was_locked = pointer_locked_; | 3035 bool was_locked = pointer_locked_; |
3044 pointer_locked_ = false; | 3036 pointer_locked_ = false; |
3045 if (was_locked) | 3037 if (was_locked) |
3046 web_view_->didLosePointerLock(); | 3038 web_view_->didLosePointerLock(); |
3047 } | 3039 } |
3048 | 3040 |
3049 } // namespace content | 3041 } // namespace content |
OLD | NEW |