Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Unified Diff: third_party/WebKit/LayoutTests/vibration/vibration-iframe.html

Issue 2755363002: [DeviceService] Port VibrationManager to be hosted in Device Service (Closed)
Patch Set: Rebase only Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/vibration/vibration-iframe.html
diff --git a/third_party/WebKit/LayoutTests/vibration/vibration-iframe.html b/third_party/WebKit/LayoutTests/vibration/vibration-iframe.html
index 1426def3e7a39a048f068bc315aa53a1ea8159eb..2c6c3ba5283d65a681a545aadf5610317e400901 100644
--- a/third_party/WebKit/LayoutTests/vibration/vibration-iframe.html
+++ b/third_party/WebKit/LayoutTests/vibration/vibration-iframe.html
@@ -13,22 +13,9 @@ if (!window.testRunner)
// TODO(leonhsl): Add more test cases http://crbug.com/701288
vibration_test(vibration => {
- let mockForSubFrame = new vibration.MockVibrationManager;
let promise = new Promise(resolve => {
let iframe = document.createElement('iframe');
iframe.src = 'resources/vibrate-from-iframe.html';
- iframe.onload = () => {
- iframe.contentWindow.gin.define(
- 'Mojo Service Registry', ['content/public/renderer/frame_interfaces'],
- (frameInterfaces) => {
- frameInterfaces.addInterfaceOverrideForTesting(
- vibration.VibrationManager.name, handle => {
- mockForSubFrame.bindingSet.addBinding(
- mockForSubFrame, handle);
- });
- iframe.contentWindow.postMessage('Ready', '*');
- });
- };
document.body.appendChild(iframe);
@@ -45,29 +32,15 @@ vibration_test(vibration => {
return promise.then(msgData => {
assert_equals(msgData, 'Cancel');
- assert_equals(mockForSubFrame.getDuration(), 1234);
- assert_true(mockForSubFrame.isCancelled());
+ assert_equals(vibration.mockVibrationManager.getDuration(), 1234);
+ assert_true(vibration.mockVibrationManager.isCancelled());
});
}, 'Iframe reload cancels vibration started by it before.');
vibration_test(vibration => {
- let mockForSubFrame = new vibration.MockVibrationManager;
let promise = new Promise(resolve => {
let iframe = document.createElement('iframe');
iframe.src = 'resources/vibrate-from-iframe.html';
- iframe.onload = () => {
- iframe.contentWindow.gin.define(
- 'Mojo Service Registry', ['content/public/renderer/frame_interfaces'],
- (frameInterfaces) => {
- frameInterfaces.addInterfaceOverrideForTesting(
- vibration.VibrationManager.name, handle => {
- mockForSubFrame.bindingSet.addBinding(
- mockForSubFrame, handle);
- });
- iframe.contentWindow.postMessage('Ready', '*');
- });
- };
-
document.body.appendChild(iframe);
window.onmessage = msg => {
@@ -83,8 +56,8 @@ vibration_test(vibration => {
return promise.then(msgData => {
assert_equals(msgData, 'Cancel');
- assert_equals(mockForSubFrame.getDuration(), 1234);
- assert_true(mockForSubFrame.isCancelled());
+ assert_equals(vibration.mockVibrationManager.getDuration(), 1234);
+ assert_true(vibration.mockVibrationManager.isCancelled());
});
}, 'Iframe destroy cancels vibration started by it before.');

Powered by Google App Engine
This is Rietveld 408576698