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

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

Issue 2552343009: [Presentation API] Adds DOMString[] constructor to PresentationRequest. (Closed)
Patch Set: resolve code review comments from foolip 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..3db3d1ea3ca4bddcb83bb9f1701627cd94f5f5a6 100644
--- a/third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js
+++ b/third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js
@@ -40,3 +40,18 @@ let presentationServiceMock = loadMojoModules(
return new PresentationServiceMock(mojo.frameInterfaces);
});
+
+function waitForClick(callback, button) {
+ button.addEventListener('click', callback, { once: true });
+
+ if (!('eventSender' in window))
+ return;
+
+ var boundingRect = button.getBoundingClientRect();
+ var x = boundingRect.left + boundingRect.width / 2;
+ var y = boundingRect.top + boundingRect.height / 2;
+
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+}

Powered by Google App Engine
This is Rietveld 408576698