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

Unified Diff: third_party/WebKit/LayoutTests/presentation/presentation-controller-terminate-connection.html

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/presentation-controller-terminate-connection.html
diff --git a/third_party/WebKit/LayoutTests/presentation/presentation-controller-terminate-connection.html b/third_party/WebKit/LayoutTests/presentation/presentation-controller-terminate-connection.html
new file mode 100644
index 0000000000000000000000000000000000000000..c6f339fc8413042f0ea8d7c6a6d09f43ad227946
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/presentation/presentation-controller-terminate-connection.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../resources/mojo-helpers.js"></script>
+<script src="resources/presentation-service-mock.js"></script>
+<button>click me</button>
+<script>
+
+async_test(t => {
+ presentationServiceMock.then(mockService => {
+ var button = document.querySelector('button');
+ // This is receiving the user gesture and runs the callback.
+ waitForClick(() => {
+ new PresentationRequest('https://example.com').start().then(
+ connection => {
+ connection.onterminate = t.step_func_done();
+ connection.onconnect = () => {
+ connection.terminate();
+ };
+ });
+ }, button);
+ });
+}, "Test that controller connection.terminate() fires onterminate event handler.");
+
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698