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

Side by Side Diff: third_party/WebKit/LayoutTests/media/mediasession/resources/mediasessionservice-mock.js

Issue 2401013002: Make MediaSession per frame as an attribute of Navigator (Closed)
Patch Set: fixed tests Created 4 years, 2 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
(Empty)
1 /*
2 * mediasessionservice-mock contains a mock implementation of MediaSessionServic e.
3 */
4
5 "use strict";
6
7 let mediaSessionServiceMock = loadMojoModules(
8 'mediaSessionServiceMock',
9 ['third_party/WebKit/public/platform/modules/mediasession/media_session.mojo m',
10 'mojo/public/js/router',
11 ]).then(mojo => {
12 let [mediaSessionService, router] = mojo.modules;
13
14 class MediaSessionServiceMock {
15 constructor(interfaceProvider) {
16 interfaceProvider.addInterfaceOverrideForTesting(
17 mediaSessionService.MediaSessionService.name,
18 handle => this.connectMediaSessionService_(handle));
19 this.interfaceProvider_ = interfaceProvider;
20 this.pendingResponse_ = null;
21 }
22
23 connectMediaSessionService_(handle) {
24 this.mediaSessionServiceStub_ = new mediaSessionService.MediaSessionSe rvice.stubClass(this);
25 this.mediaSessionServiceRouter_ = new router.Router(handle);
26 this.mediaSessionServiceRouter_.setIncomingReceiver(this.mediaSessionS erviceStub_);
27 }
28
29 setMetadata(metadata) {
30 if (!!this.setMetadataStub) {
mlamouri (slow - plz ping) 2016/10/10 20:30:34 That's odd. Did you copy this behaviour from anoth
Zhiqiang Zhang (Slow) 2016/10/11 10:56:04 Done.
31 this.setMetadataStub(metadata);
32 }
33 }
34 }
35
36 return new MediaSessionServiceMock(mojo.frameInterfaces);
37 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698