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

Unified 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, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/resources/media/new/media_internals_integration_test.html
diff --git a/content/browser/resources/media/new/media_internals_integration_test.html b/content/browser/resources/media/new/media_internals_integration_test.html
new file mode 100644
index 0000000000000000000000000000000000000000..a13b34e1e607162776d05009083d928cdbb6d45e
--- /dev/null
+++ b/content/browser/resources/media/new/media_internals_integration_test.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
scherkus (not reviewing) 2013/07/29 20:35:54 copyright
Ty Overby 2013/07/29 21:53:31 Done.
+<html>
+ <head>
+ <script src="webui_resource_test.js"></script>
+ <script src="goog.js"></script>
+ <script src="player_manager.js"></script>
+ <script src="player_info.js"></script>
+ <script src="main.js"></script>
+ </head>
+ <body>
+ <script>
+ 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.
+ window.pm = media.manager;
+ window.pm.removeAllForDebug();
+ };
+
+ // Correctly use the information from a media event.
+ window.testOnMediaEvent = function () {
+ var event = {
+ ticksMillis: 132,
+ renderer: 12,
+ player: 4,
+ params: {
+ fps: 60,
+ other: 'hi'
+ }
+ },
+ 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.
+
+ window.media.onMediaEvent(event);
+ var info = window.pm.players_[name];
+
+ assertEquals(event.ticksMillis, info.firstTimestamp_);
+ assertEquals(name, info.id);
+ assertEquals(event.params.fps, info.properties.fps);
+ };
+
+ // Remove a player.
+ window.testOnRenderTerminated = function () {
+ window.testOnMediaEvent();
+
+ window.pm.shouldRemovePlayer_ = function () {
+ return true;
+ };
+
+ // '12' is the renderer passed in the test above
+ 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.
+ assertEquals(undefined, pm.players_['12:4']);
+ };
+
+ // Audio Streams are weird, they are handled separately
+ window.testAddAudioStream = function () {
+ var event = {
+ id: 'ID',
+ status: 'created',
+ playing: true
+ };
+
+ window.media.addAudioStream(event);
+
+ assertTrue(undefined !== pm.players_[event.id]);
+ assertEquals(event.playing, pm.players_[event.id].properties['playing'])
+ };
+
+ runTests();
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698