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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Mock implementation of mojo PresentationService. 2 * Mock implementation of mojo PresentationService.
3 */ 3 */
4 4
5 "use strict"; 5 "use strict";
6 6
7 let presentationServiceMock = loadMojoModules( 7 let presentationServiceMock = loadMojoModules(
8 'presentationServiceMock', 8 'presentationServiceMock',
9 [ 9 [
10 'third_party/WebKit/public/platform/modules/presentation/presentation.mojo m', 10 'third_party/WebKit/public/platform/modules/presentation/presentation.mojo m',
(...skipping 22 matching lines...) Expand all
33 joinSession(urls) { 33 joinSession(urls) {
34 return Promise.resolve({ 34 return Promise.resolve({
35 sessionInfo: { url: urls[0], id: 'fakeSessionId' }, 35 sessionInfo: { url: urls[0], id: 'fakeSessionId' },
36 error: null, 36 error: null,
37 }); 37 });
38 } 38 }
39 } 39 }
40 40
41 return new PresentationServiceMock(mojo.frameInterfaces); 41 return new PresentationServiceMock(mojo.frameInterfaces);
42 }); 42 });
43
44 function waitForClick(callback, button) {
45 button.addEventListener('click', callback, { once: true });
46
47 if (!('eventSender' in window))
48 return;
49
50 var boundingRect = button.getBoundingClientRect();
51 var x = boundingRect.left + boundingRect.width / 2;
52 var y = boundingRect.top + boundingRect.height / 2;
53
54 eventSender.mouseMoveTo(x, y);
55 eventSender.mouseDown();
56 eventSender.mouseUp();
57 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698