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

Side by Side Diff: content/browser/resources/media/new/media_internals_integration_test.html

Issue 20804002: Added the next series of files that go into media-internals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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 <!DOCTYPE html>
scherkus (not reviewing) 2013/07/29 20:35:54 copyright
Ty Overby 2013/07/29 21:53:31 Done.
2 <html>
3 <head>
4 <script src="webui_resource_test.js"></script>
5 <script src="goog.js"></script>
6 <script src="player_manager.js"></script>
7 <script src="player_info.js"></script>
8 <script src="main.js"></script>
9 </head>
10 <body>
11 <script>
12 window.setUp = function () {
scherkus (not reviewing) 2013/07/29 20:35:54 remove spaces between function and ( here + below
Ty Overby 2013/07/29 21:53:31 Done.
13 window.pm = media.manager;
14 window.pm.removeAllForDebug();
15 };
16
17 // Correctly use the information from a media event.
18 window.testOnMediaEvent = function () {
19 var event = {
20 ticksMillis: 132,
21 renderer: 12,
22 player: 4,
23 params: {
24 fps: 60,
25 other: 'hi'
26 }
27 },
28 name = event.renderer + ':' + event.player;
scherkus (not reviewing) 2013/07/29 20:35:54 just use a separate var statement here
Ty Overby 2013/07/29 21:53:31 Done.
29
30 window.media.onMediaEvent(event);
31 var info = window.pm.players_[name];
32
33 assertEquals(event.ticksMillis, info.firstTimestamp_);
34 assertEquals(name, info.id);
35 assertEquals(event.params.fps, info.properties.fps);
36 };
37
38 // Remove a player.
39 window.testOnRenderTerminated = function () {
40 window.testOnMediaEvent();
41
42 window.pm.shouldRemovePlayer_ = function () {
43 return true;
44 };
45
46 // '12' is the renderer passed in the test above
47 window.media.onRendererTerminated(12);
scherkus (not reviewing) 2013/07/29 20:35:54 instead of documenting the magic number 12 (and 4)
Ty Overby 2013/07/29 21:53:31 Done.
48 assertEquals(undefined, pm.players_['12:4']);
49 };
50
51 // Audio Streams are weird, they are handled separately
52 window.testAddAudioStream = function () {
53 var event = {
54 id: 'ID',
55 status: 'created',
56 playing: true
57 };
58
59 window.media.addAudioStream(event);
60
61 assertTrue(undefined !== pm.players_[event.id]);
62 assertEquals(event.playing, pm.players_[event.id].properties['playing'])
63 };
64
65 runTests();
66 </script>
67 </body>
68 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698