Bug 1076833 - take snapshots only after network suspended. r=jya.
authorJW Wang <jwwang@mozilla.com>
Tue, 15 Sep 2015 10:56:21 +0800
changeset 296828 1a912ffbe674eb667c0eae2531a2243c5f786368
parent 296827 2c9f4d2e77fabd283b530a0c34bd21719c0a762b
child 296829 5be65754c0d0a310e5ad22feffce0f79107cca15
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1076833
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1076833 - take snapshots only after network suspended. r=jya.
toolkit/content/tests/widgets/videocontrols_direction-1-ref.html
toolkit/content/tests/widgets/videocontrols_direction-1a.html
toolkit/content/tests/widgets/videocontrols_direction-1b.html
toolkit/content/tests/widgets/videocontrols_direction-1c.html
toolkit/content/tests/widgets/videocontrols_direction-1d.html
toolkit/content/tests/widgets/videocontrols_direction-1e.html
toolkit/content/tests/widgets/videocontrols_direction-2-ref.html
toolkit/content/tests/widgets/videocontrols_direction-2a.html
toolkit/content/tests/widgets/videocontrols_direction-2b.html
toolkit/content/tests/widgets/videocontrols_direction-2c.html
toolkit/content/tests/widgets/videocontrols_direction-2d.html
toolkit/content/tests/widgets/videocontrols_direction-2e.html
toolkit/content/tests/widgets/videocontrols_direction_test.js
--- a/toolkit/content/tests/widgets/videocontrols_direction-1-ref.html
+++ b/toolkit/content/tests/widgets/videocontrols_direction-1-ref.html
@@ -1,10 +1,10 @@
 <!DOCTYPE HTML>
 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="videomask.css">
 </head>
 <body style="text-align: right;">
-<video controls preload="auto" id="av" source="audio.wav"></video>
+<video controls preload="none" id="av" source="audio.wav"></video>
 <div id="mask"></div>
 </body>
 </html>
--- a/toolkit/content/tests/widgets/videocontrols_direction-1a.html
+++ b/toolkit/content/tests/widgets/videocontrols_direction-1a.html
@@ -1,10 +1,10 @@
 <!DOCTYPE HTML>
 <html dir="rtl">
 <head>
 <link rel="stylesheet" type="text/css" href="videomask.css">
 </head>
 <body>
-<video controls preload="auto" id="av" source="audio.wav"></video>
+<video controls preload="none" id="av" source="audio.wav"></video>
 <div id="mask"></div>
 </body>
 </html>
--- a/toolkit/content/tests/widgets/videocontrols_direction-1b.html
+++ b/toolkit/content/tests/widgets/videocontrols_direction-1b.html
@@ -1,10 +1,10 @@
 <!DOCTYPE HTML>
 <html style="direction: rtl">
 <head>
 <link rel="stylesheet" type="text/css" href="videomask.css">
 </head>
 <body>
-<video controls preload="auto" id="av" source="audio.wav"></video>
+<video controls preload="none" id="av" source="audio.wav"></video>
 <div id="mask"></div>
 </body>
 </html>
--- a/toolkit/content/tests/widgets/videocontrols_direction-1c.html
+++ b/toolkit/content/tests/widgets/videocontrols_direction-1c.html
@@ -1,10 +1,10 @@
 <!DOCTYPE HTML>
 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="videomask.css">
 </head>
 <body style="direction: rtl">
-<video controls preload="auto" id="av" source="audio.wav"></video>
+<video controls preload="none" id="av" source="audio.wav"></video>
 <div id="mask"></div>
 </body>
 </html>
--- a/toolkit/content/tests/widgets/videocontrols_direction-1d.html
+++ b/toolkit/content/tests/widgets/videocontrols_direction-1d.html
@@ -1,10 +1,10 @@
 <!DOCTYPE HTML>
 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="videomask.css">
 </head>
 <body style="text-align: right;">
-<video controls preload="auto" id="av" source="audio.wav" dir="rtl"></video>
+<video controls preload="none" id="av" source="audio.wav" dir="rtl"></video>
 <div id="mask"></div>
 </body>
 </html>
--- a/toolkit/content/tests/widgets/videocontrols_direction-1e.html
+++ b/toolkit/content/tests/widgets/videocontrols_direction-1e.html
@@ -1,10 +1,10 @@
 <!DOCTYPE HTML>
 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="videomask.css">
 </head>
 <body style="text-align: right;">
-<video controls preload="auto" id="av" source="audio.wav" style="direction: rtl;"></video>
+<video controls preload="none" id="av" source="audio.wav" style="direction: rtl;"></video>
 <div id="mask"></div>
 </body>
 </html>
--- a/toolkit/content/tests/widgets/videocontrols_direction-2-ref.html
+++ b/toolkit/content/tests/widgets/videocontrols_direction-2-ref.html
@@ -1,10 +1,10 @@
 <!DOCTYPE HTML>
 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="videomask.css">
 </head>
 <body style="text-align: right;">
-<audio controls preload="auto" id="av" source="audio.wav"></audio>
+<audio controls preload="none" id="av" source="audio.wav"></audio>
 <div id="mask"></div>
 </body>
 </html>
--- a/toolkit/content/tests/widgets/videocontrols_direction-2a.html
+++ b/toolkit/content/tests/widgets/videocontrols_direction-2a.html
@@ -1,10 +1,10 @@
 <!DOCTYPE HTML>
 <html dir="rtl">
 <head>
 <link rel="stylesheet" type="text/css" href="videomask.css">
 </head>
 <body>
-<audio controls preload="auto" id="av" source="audio.wav"></audio>
+<audio controls preload="none" id="av" source="audio.wav"></audio>
 <div id="mask"></div>
 </body>
 </html>
--- a/toolkit/content/tests/widgets/videocontrols_direction-2b.html
+++ b/toolkit/content/tests/widgets/videocontrols_direction-2b.html
@@ -1,10 +1,10 @@
 <!DOCTYPE HTML>
 <html style="direction: rtl">
 <head>
 <link rel="stylesheet" type="text/css" href="videomask.css">
 </head>
 <body>
-<audio controls preload="auto" id="av" source="audio.wav"></audio>
+<audio controls preload="none" id="av" source="audio.wav"></audio>
 <div id="mask"></div>
 </body>
 </html>
--- a/toolkit/content/tests/widgets/videocontrols_direction-2c.html
+++ b/toolkit/content/tests/widgets/videocontrols_direction-2c.html
@@ -1,10 +1,10 @@
 <!DOCTYPE HTML>
 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="videomask.css">
 </head>
 <body style="direction: rtl">
-<audio controls preload="auto" id="av" source="audio.wav"></audio>
+<audio controls preload="none" id="av" source="audio.wav"></audio>
 <div id="mask"></div>
 </body>
 </html>
--- a/toolkit/content/tests/widgets/videocontrols_direction-2d.html
+++ b/toolkit/content/tests/widgets/videocontrols_direction-2d.html
@@ -1,10 +1,10 @@
 <!DOCTYPE HTML>
 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="videomask.css">
 </head>
 <body style="text-align: right;">
-<audio controls preload="auto" id="av" source="audio.wav" dir="rtl"></audio>
+<audio controls preload="none" id="av" source="audio.wav" dir="rtl"></audio>
 <div id="mask"></div>
 </body>
 </html>
--- a/toolkit/content/tests/widgets/videocontrols_direction-2e.html
+++ b/toolkit/content/tests/widgets/videocontrols_direction-2e.html
@@ -1,10 +1,10 @@
 <!DOCTYPE HTML>
 <html>
 <head>
 <link rel="stylesheet" type="text/css" href="videomask.css">
 </head>
 <body style="text-align: right;">
-<audio controls preload="auto" id="av" source="audio.wav" style="direction: rtl;"></audio>
+<audio controls preload="none" id="av" source="audio.wav" style="direction: rtl;"></audio>
 <div id="mask"></div>
 </body>
 </html>
--- a/toolkit/content/tests/widgets/videocontrols_direction_test.js
+++ b/toolkit/content/tests/widgets/videocontrols_direction_test.js
@@ -16,29 +16,21 @@ RemoteCanvas.prototype.load = function(c
   iframe.id = this.id + "-iframe";
   iframe.width = RemoteCanvas.CANVAS_WIDTH + "px";
   iframe.height = RemoteCanvas.CANVAS_HEIGHT + "px";
   iframe.src = this.url;
   var me = this;
   iframe.addEventListener("load", function() {
     info("iframe loaded");
     var m = iframe.contentDocument.getElementById("av");
-    m.addEventListener("progress", function(aEvent) {
-      var v = aEvent.target;
-      var b = v.buffered;
-      info("progress event: " + b.length + " buffered ranges, duration is " + v.duration);
-      if (b.length)
-        info("buffer 0 end: " + b.end(0));
-      if (b.length == 1 && b.end(0) == v.duration) {
-        info("done");
-        m.removeEventListener("progress", arguments.callee, false);
-        setTimeout(function() {
-          me.remotePageLoaded(callback);
-        }, 0);
-      }
+    m.addEventListener("suspend", function(aEvent) {
+      m.removeEventListener("suspend", arguments.callee, false);
+      setTimeout(function() {
+        me.remotePageLoaded(callback);
+      }, 0);
     }, false);
     m.src = m.getAttribute("source");
   }, false);
   window.document.body.appendChild(iframe);
 };
 
 RemoteCanvas.prototype.remotePageLoaded = function(callback) {
   var ldrFrame = document.getElementById(this.id + "-iframe");