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

Side by Side Diff: content/browser/resources/media/new/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: Fixed style issues, slightly modified how the media singleton is tested" 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 <!--
2 Copyright 2013 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file.
5 -->
6 <!DOCTYPE html>
7 <html>
8 <head>
9 <script src="webui_resource_test.js"></script>
10 <script src="goog.js"></script>
11 <script src="player_manager.js"></script>
12 <script src="player_info.js"></script>
13 <script src="main.js"></script>
14 </head>
15 <body>
16 <script>
17 window.setUp = function() {
18 media.refreshManagerForTest();
19 window.pm = media.getManager();
scherkus (not reviewing) 2013/07/29 22:16:28 s/pm/somethingWayMoreDescriptive/ for example ...
Ty Overby 2013/07/29 22:47:22 Done.
20 };
21
22 // The renderer and player ids are completely arbitrarily
scherkus (not reviewing) 2013/07/29 22:16:28 periods!
Ty Overby 2013/07/29 22:47:22 Done.
23 var TEST_RENDERER = 12;
24 var TEST_PLAYER = 4;
25 var TEST_NAME = TEST_RENDERER + ':' + TEST_PLAYER;
26
27 // Correctly use the information from a media event.
28 window.testOnMediaEvent = function() {
29 var event = {
30 ticksMillis: 132,
scherkus (not reviewing) 2013/07/29 22:16:28 this block should be de-indented by two spaces th
Ty Overby 2013/07/29 22:47:22 Done.
31 renderer: TEST_RENDERER,
32 player: TEST_PLAYER,
33 params: {
34 fps: 60,
35 other: 'hi'
36 }
37 };
38
39 window.media.onMediaEvent(event);
40 var info = window.pm.players_[TEST_NAME];
41
42 assertEquals(event.ticksMillis, info.firstTimestamp_);
43 assertEquals(TEST_NAME, info.id);
44 assertEquals(event.params.fps, info.properties.fps);
45 };
46
47 // Remove a player.
48 window.testOnRenderTerminated = function() {
49 window.testOnMediaEvent();
50
51 window.pm.shouldRemovePlayer_ = function() {
52 return true;
53 };
54
55 window.media.onRendererTerminated(TEST_RENDERER);
56 assertEquals(undefined, pm.players_[TEST_NAME]);
57 };
58
59 // Audio Streams are weird, they are handled separately
60 window.testAddAudioStream = function() {
61 var event = {
62 id: 'ID',
63 status: 'created',
64 playing: true
65 };
66
67 window.media.addAudioStream(event);
68
69 assertTrue(undefined !== pm.players_[event.id]);
70 assertEquals(event.playing, pm.players_[event.id].properties['playing'])
71 };
72
73 runTests();
74 </script>
75 </body>
76 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698