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

Unified Diff: chrome/test/data/media/html/media_seek.html

Issue 9960063: CNS seek tests for <video>. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 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: chrome/test/data/media/html/media_seek.html
diff --git a/chrome/test/data/media/html/media_seek.html b/chrome/test/data/media/html/media_seek.html
new file mode 100644
index 0000000000000000000000000000000000000000..99ef10f400bfe2e9b28d6baf988aab6b9c6352cd
--- /dev/null
+++ b/chrome/test/data/media/html/media_seek.html
@@ -0,0 +1,59 @@
+<!-- Used by media_constrained_network_perf to record perf metrics. -->
DaleCurtis 2012/04/10 23:00:06 Name?
shadi 2012/04/18 02:03:17 Done.
+<!DOCTYPE html>
+<html lang="en-US">
+ <head>
+ <title>CNS Seek Tests</title>
+ <script src="benchmark.js" type="text/javascript"></script>
+ </head>
+
+ <body>
+ <video autoplay controls></video>
+ <div id="l"></div>
DaleCurtis 2012/04/10 23:00:06 Choose a better ID here.
shadi 2012/04/18 02:03:17 Done.
+ </body>
+
+ <script type="text/javascript">
+ var v = document.querySelector('video');
+ var l = document.getElementById("l");
DaleCurtis 2012/04/10 23:00:06 Does .querySelector('div') not work?
shadi 2012/04/18 02:03:17 It does since this is the only div.
+ var endTest = false;
+ var shortSeeks = [];
+ var longSeeks = [];
+ var errorMsg = '';
+
+ // Called by the PyAuto controller to initiate testing.
+ function startTest(src) {
+ var perf = new Benchmark(v, src);
+ shortSeeks = [];
+ longSeeks = [];
+ endTest = false;
+ errorMsg = '';
+
+ // Tell the PyAuto controller that the test has started.
+ if (window.domAutomationController)
+ window.domAutomationController.send(true);
+
+ log('Starting seeking tests on ' + src);
DaleCurtis 2012/04/10 23:00:06 Benchmark seems to already log this?
shadi 2012/04/18 02:03:17 Done.
+ perf.testShortSeek(3, function(success, result) {
+ log('Short seek (cached): ' + result);
DaleCurtis 2012/04/10 23:00:06 Why are these labeled cached/un-cached? I don't se
+ if (!success) {
+ errorMsg = result;
+ } else {
+ shortSeeks = result;
+ }
+ perf.testLongSeek(3, function(success, result) {
+ log('Long seek (un-cached): ' + result);
+ if (!success) {
+ errorMsg = result;
+ } else {
+ longSeeks = result;
+ endTest = true;
+ }
+ });
+ });
+ }
+
+ function log(text) {
+ l.innerText = l.innerText + text + '\n';
+ console.log(text);
DaleCurtis 2012/04/10 23:00:06 if (console && console.log) ?
+ }
+ </script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698