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

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

Issue 2491693003: Add tests for PresentationConnectionAvailable constructor. (Closed)
Patch Set: review comments Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/LayoutTests/presentation/presentationconnectionavailableevent-ctor-mock.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Mock implementation of mojo PresentationService.
3 */
4
5 "use strict";
6
7 let presentationServiceMock = loadMojoModules(
8 'presentationServiceMock',
9 [
10 'third_party/WebKit/public/platform/modules/presentation/presentation.mojo m',
11 'mojo/public/js/router',
12 ]).then(mojo => {
13 let [ presentationService, router ] = mojo.modules;
14
15 class PresentationServiceMock {
16 constructor(interfaceProvider) {
17 interfaceProvider.addInterfaceOverrideForTesting(
18 presentationService.PresentationService.name,
19 handle => this.connectPresentationService_(handle));
20 this.interfaceProvider_ = interfaceProvider;
21 this.pendingResponse_ = null;
22 }
23
24 connectPresentationService_(handle) {
25 this.presentationServiceStub_ = new presentationService.PresentationSe rvice.stubClass(this);
26 this.presentationServiceRouter_ = new router.Router(handle);
27 this.presentationServiceRouter_.setIncomingReceiver(this.presentationS erviceStub_);
28 }
29
30 startSession(urls) {
31 return Promise.resolve({
32 sessionInfo: { url: urls[0], id: 'fakesession' },
33 error: null,
34 });
35 }
36 }
37
38 return new PresentationServiceMock(mojo.frameInterfaces);
39 });
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/presentation/presentationconnectionavailableevent-ctor-mock.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698