| Index: third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js
|
| diff --git a/third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js b/third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js
|
| index 3db3d1ea3ca4bddcb83bb9f1701627cd94f5f5a6..eee573bdd50411abd5d3bfece1382dd3f850e1b0 100644
|
| --- a/third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js
|
| +++ b/third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js
|
| @@ -4,13 +4,12 @@
|
|
|
| "use strict";
|
|
|
| -let presentationServiceMock = loadMojoModules(
|
| - 'presentationServiceMock',
|
| - [
|
| +const presentationServiceMock =
|
| + loadMojoModules('presentationServiceMock', [
|
| 'third_party/WebKit/public/platform/modules/presentation/presentation.mojom',
|
| 'mojo/public/js/bindings',
|
| ]).then(mojo => {
|
| - let [ presentationService, bindings ] = mojo.modules;
|
| + const [presentationService, bindings] = mojo.modules;
|
|
|
| class PresentationServiceMock {
|
| constructor(interfaceProvider) {
|
| @@ -23,6 +22,8 @@ let presentationServiceMock = loadMojoModules(
|
| presentationService.PresentationService);
|
| }
|
|
|
| + setClient(client) { this.client_ = client; }
|
| +
|
| startSession(urls) {
|
| return Promise.resolve({
|
| sessionInfo: { url: urls[0], id: 'fakesession' },
|
| @@ -36,6 +37,12 @@ let presentationServiceMock = loadMojoModules(
|
| error: null,
|
| });
|
| }
|
| +
|
| + closeConnection(url, id) {
|
| + this.client_.onConnectionClosed(
|
| + {url: url, id: id},
|
| + presentationService.PresentationConnectionCloseReason.CLOSED, '');
|
| + }
|
| }
|
|
|
| return new PresentationServiceMock(mojo.frameInterfaces);
|
| @@ -47,9 +54,9 @@ function waitForClick(callback, button) {
|
| if (!('eventSender' in window))
|
| return;
|
|
|
| - var boundingRect = button.getBoundingClientRect();
|
| - var x = boundingRect.left + boundingRect.width / 2;
|
| - var y = boundingRect.top + boundingRect.height / 2;
|
| + const boundingRect = button.getBoundingClientRect();
|
| + const x = boundingRect.left + boundingRect.width / 2;
|
| + const y = boundingRect.top + boundingRect.height / 2;
|
|
|
| eventSender.mouseMoveTo(x, y);
|
| eventSender.mouseDown();
|
|
|