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

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

Issue 2484273003: [Presentation API] (1-UA) fire PresentationConnection onterminate event if receiver page gets destr… (Closed)
Patch Set: rebase Created 3 years, 10 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 15007fe7f8f7b0243d2dc677a155025db995b5e7..16a3fad53ac8151094d84993d1464214efbc852a 100644
--- a/third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js
+++ b/third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js
@@ -25,10 +25,15 @@ let presentationServiceMock = loadMojoModules(
this.pendingResponse_ = null;
this.bindingSet_ = new bindings.BindingSet(
presentationService.PresentationService);
+
+ this.onSetClient = null;
}
setClient(client) {
this.client_ = client;
+
+ if (this.onSetClient)
+ this.onSetClient();
}
startSession(urls) {
@@ -45,6 +50,19 @@ let presentationServiceMock = loadMojoModules(
});
}
+ terminate(presentationUrl, presentationId) {
+ this.client_.onConnectionStateChanged(
+ { url: presentationUrl, id: presentationId },
+ presentationService.PresentationConnectionState.TERMINATED);
+ }
+
+ setPresentationConnection(
+ seesionInfo, controllerConnectionPtr, receiverConnectionRequest) {
+ this.client_.onConnectionStateChanged(
+ seesionInfo,
+ presentationService.PresentationConnectionState.CONNECTED);
+ }
+
onReceiverConnectionAvailable(strUrl, id) {
const mojoUrl = new url.Url();
mojoUrl.url = strUrl;

Powered by Google App Engine
This is Rietveld 408576698