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

Side by Side Diff: third_party/WebKit/LayoutTests/vibration/resources/vibration-helpers.js

Issue 2776983002: [DeviceService] Move all vibration codes into //services/device (Closed)
Patch Set: Rebase only Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 'use strict'; 1 'use strict';
2 2
3 function vibration_mocks(mojo) { 3 function vibration_mocks(mojo) {
4 return define( 4 return define(
5 'VibrationManager mocks', 5 'VibrationManager mocks',
6 [ 6 [
7 'mojo/public/js/bindings', 7 'mojo/public/js/bindings',
8 'device/vibration/vibration_manager.mojom',
9 'services/device/public/interfaces/constants.mojom', 8 'services/device/public/interfaces/constants.mojom',
9 'services/device/public/interfaces/vibration_manager.mojom',
10 ], 10 ],
11 (bindings, vibrationManager, deviceConstants) => { 11 (bindings, deviceConstants, vibrationManager) => {
12 class MockVibrationManager { 12 class MockVibrationManager {
13 constructor() { 13 constructor() {
14 this.bindingSet = 14 this.bindingSet =
15 new bindings.BindingSet(vibrationManager.VibrationManager); 15 new bindings.BindingSet(vibrationManager.VibrationManager);
16 16
17 this.vibrate_milliseconds_ = -1; 17 this.vibrate_milliseconds_ = -1;
18 this.cancelled_ = false; 18 this.cancelled_ = false;
19 } 19 }
20 20
21 vibrate(milliseconds) { 21 vibrate(milliseconds) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 function vibration_test(func, name, properties) { 61 function vibration_test(func, name, properties) {
62 mojo_test( 62 mojo_test(
63 mojo => vibration_mocks(mojo).then(vibration => { 63 mojo => vibration_mocks(mojo).then(vibration => {
64 let result = Promise.resolve(func(vibration)); 64 let result = Promise.resolve(func(vibration));
65 let cleanUp = () => vibration.mockVibrationManager.reset(); 65 let cleanUp = () => vibration.mockVibrationManager.reset();
66 result.then(cleanUp, cleanUp); 66 result.then(cleanUp, cleanUp);
67 return result; 67 return result;
68 }), 68 }),
69 name, properties); 69 name, properties);
70 } 70 }
OLDNEW
« no previous file with comments | « services/device/vibration/vibration_manager_impl_unittest.cc ('k') | third_party/WebKit/Source/modules/notifications/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698