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

Unified Diff: chrome/test/data/media/html/utils.js

Issue 9290008: Introduce new basic playback test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review fixes. PYAUTO_TESTS. Created 8 years, 11 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
« no previous file with comments | « chrome/test/data/media/html/media_basic_playback.html ('k') | chrome/test/functional/PYAUTO_TESTS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/media/html/utils.js
diff --git a/chrome/test/data/media/html/utils.js b/chrome/test/data/media/html/utils.js
new file mode 100644
index 0000000000000000000000000000000000000000..7dff4bab7d66dce4fb7f86a73a17d439c884d93f
--- /dev/null
+++ b/chrome/test/data/media/html/utils.js
@@ -0,0 +1,29 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Miscellaneous utility functions for HTML media tests. Loading this script
+// should not modify the page in any way.
+//
+
+var QueryString = function () {
+ // Allows access to query parameters on the URL; e.g., given a URL like:
+ //
+ // http://<url>/my.html?test=123&bob=123
+ //
+ // parameters can now be accessed via QueryString.test or QueryString.bob.
+ var params = {};
+
+ // RegEx to split out values by &.
+ var r = /([^&=]+)=?([^&]*)/g;
+
+ // Lambda function for decoding extracted match values. Replaces '+' with
+ // space so decodeURIComponent functions properly.
+ function d(s) { return decodeURIComponent(s.replace(/\+/g, ' ')); }
+
+ var match;
+ while (match = r.exec(window.location.search.substring(1)))
+ params[d(match[1])] = d(match[2]);
+
+ return params;
+} ();
« no previous file with comments | « chrome/test/data/media/html/media_basic_playback.html ('k') | chrome/test/functional/PYAUTO_TESTS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698