Chromium Code Reviews| 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 790bba54640068ec5d79729cf1d15bbfcbd931b9..3ffc27b999359c6ad5d03987b458af9e380d7fdd 100644 |
| --- a/third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js |
| +++ b/third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js |
| @@ -10,17 +10,21 @@ let presentationServiceMock = loadMojoModules( |
| 'third_party/WebKit/public/platform/modules/presentation/presentation.mojom', |
| 'mojo/public/js/bindings', |
| ]).then(mojo => { |
| - let [ presentationService, bindings ] = mojo.modules; |
| + let [ presentation, bindings ] = mojo.modules; |
|
mark a. foltz
2017/01/20 18:48:22
nit: Can you leave this as presentationService, so
takumif
2017/01/23 19:58:12
Done.
|
| class PresentationServiceMock { |
| constructor(interfaceProvider) { |
| interfaceProvider.addInterfaceOverrideForTesting( |
| - presentationService.PresentationService.name, |
| + presentation.PresentationService.name, |
| handle => this.bindingSet_.addBinding(this, handle)); |
| this.interfaceProvider_ = interfaceProvider; |
| this.pendingResponse_ = null; |
| this.bindingSet_ = new bindings.BindingSet( |
| - presentationService.PresentationService); |
| + presentation.PresentationService); |
| + } |
| + |
| + setClient(client) { |
| + this.client_ = client; |
| } |
| startSession(urls) { |
| @@ -36,6 +40,14 @@ let presentationServiceMock = loadMojoModules( |
| error: null, |
| }); |
| } |
| + |
| + closeConnection(url, id) { |
| + this.client_.onConnectionClosed( |
| + { url: url, id: id }, |
| + presentation.PresentationConnectionCloseReason.CLOSED, |
| + '' |
| + ); |
| + } |
| } |
| return new PresentationServiceMock(mojo.frameInterfaces); |