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

Unified Diff: third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js

Issue 2643473002: [Presentation API] Allow PresentationConnection state change to "Connecting" (Closed)
Patch Set: Add a layout test Created 3 years, 11 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/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;
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);

Powered by Google App Engine
This is Rietveld 408576698