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

Side by Side Diff: third_party/WebKit/LayoutTests/battery-status/resources/mock-battery-monitor.js

Issue 2818673003: [DeviceService] Expose battery monitoring solely via the Device Service (Closed)
Patch Set: Java file format change Created 3 years, 7 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 let mockBatteryMonitor = loadMojoModules('mockBatteryMonitor', [ 3 let mockBatteryMonitor = loadMojoModules('mockBatteryMonitor', [
4 'device/battery/battery_monitor.mojom', 4 'services/device/public/interfaces/battery_monitor.mo jom',
5 'device/battery/battery_status.mojom', 5 'services/device/public/interfaces/battery_status.moj om',
6 'services/device/public/interfaces/constants.mojom', 6 'services/device/public/interfaces/constants.mojom',
7 'mojo/public/js/bindings', 7 'mojo/public/js/bindings',
8 ]).then(mojo => { 8 ]).then(mojo => {
9 let [batteryMonitor, batteryStatus, deviceConstants, bindings] = mojo.modules; 9 let [batteryMonitor, batteryStatus, deviceConstants, bindings] = mojo.modules;
10 10
11 class MockBatteryMonitor { 11 class MockBatteryMonitor {
12 constructor(connector) { 12 constructor(connector) {
13 connector.addInterfaceOverrideForTesting( 13 connector.addInterfaceOverrideForTesting(
14 deviceConstants.kServiceName, batteryMonitor.BatteryMonitor.name, 14 deviceConstants.kServiceName, batteryMonitor.BatteryMonitor.name,
15 handle => this.bindingSet_.addBinding(this, handle)); 15 handle => this.bindingSet_.addBinding(this, handle));
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 'lastSetMockBatteryInfo.dischargingTime'); 71 'lastSetMockBatteryInfo.dischargingTime');
72 shouldBe('batteryInfo.level', 'lastSetMockBatteryInfo.level'); 72 shouldBe('batteryInfo.level', 'lastSetMockBatteryInfo.level');
73 } 73 }
74 74
75 function batteryStatusFailure() { 75 function batteryStatusFailure() {
76 testFailed('failed to successfully resolve the promise'); 76 testFailed('failed to successfully resolve the promise');
77 setTimeout(finishJSTest, 0); 77 setTimeout(finishJSTest, 0);
78 } 78 }
79 79
80 var mockBatteryMonitorReady = mockBatteryMonitor.then(); 80 var mockBatteryMonitorReady = mockBatteryMonitor.then();
OLDNEW
« no previous file with comments | « services/device/public/interfaces/battery_status.mojom ('k') | third_party/WebKit/Source/modules/battery/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698