| 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();
|
| +}
|
|
|