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

Unified Diff: media/test/data/player.html

Issue 2360443002: [Chromecast] Add CastMediaBlocker and BrowserTest (Closed)
Patch Set: Fix double stop bug Created 4 years, 3 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: media/test/data/player.html
diff --git a/media/test/data/player.html b/media/test/data/player.html
index fa50d731e1a3610e1f9db825f5cb6f104bb072df..f04901f666ff5687257845ef54b50e94d3963792 100644
--- a/media/test/data/player.html
+++ b/media/test/data/player.html
@@ -47,14 +47,32 @@ function RunTest() {
if (url_parts.length != 2)
return Failed();
- var query_parts = url_parts[1].split('=');
- if (query_parts.length != 2)
- return Failed();
-
- var tag = query_parts[0];
- var media_url = query_parts[1];
- if (tag != 'audio' && tag != 'video')
+ var tag = '';
+ var media_url = '';
+ var loop = false;
+
+ var query_params = url_parts[1].split('&');
+ for (var query_param in query_params) {
+ var query_parts = query_params[query_param].split('=');
+ if (query_parts.length != 2) {
+ return Failed();
+ }
+
+ if (query_parts[0] == 'audio' || query_parts[0] == 'video') {
+ tag = query_parts[0];
+ media_url = query_parts[1];
+ continue;
+ }
+
+ if (query_parts[0] == 'loop') {
+ loop = (query_parts[1] == 'true');
+ continue;
+ }
+ }
+
+ if (tag != 'audio' && tag != 'video') {
return Failed();
+ }
xhwang 2016/09/21 21:33:18 Could you please update the comment above this fun
derekjchow1 2016/09/21 22:06:12 Done.
// Create player and insert into DOM.
player = document.createElement(tag);
@@ -74,6 +92,7 @@ function RunTest() {
InstallTitleEventHandler(player, 'error');
// Starts the player.
+ player.loop = loop;
player.src = media_url;
player.play();
}

Powered by Google App Engine
This is Rietveld 408576698