Correct some error messages and add some extra debug for Bug 539908 Random orange: TEST-UNEXPECTED-FAIL | test_videoAllowedInMail. Test-only change. r=sid0
authorMark Banner <bugzilla@standard8.plus.com>
Sun, 17 Jan 2010 14:31:01 +0000
changeset 4702 180c22a0e1b1bef6b66c73619d5e66f79c49462d
parent 4701 3063edeacd0cc22f18941e68d20239648682c99d
child 4703 731250055e990732b1f6824c5462e7104d8ee4ba
push id3680
push userbugzilla@standard8.plus.com
push dateSun, 17 Jan 2010 14:31:22 +0000
treeherdercomm-central@180c22a0e1b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssid0
bugs539908
Correct some error messages and add some extra debug for Bug 539908 Random orange: TEST-UNEXPECTED-FAIL | test_videoAllowedInMail. Test-only change. r=sid0
mail/test/mozmill/content-policy/test-video-content-policy.js
--- a/mail/test/mozmill/content-policy/test-video-content-policy.js
+++ b/mail/test/mozmill/content-policy/test-video-content-policy.js
@@ -196,24 +196,39 @@ function test_videoAllowedInMail() {
 
   // Click on the allow remote content button
   mc.click(new elib.ID(mozmill.getMail3PaneController().window.document, "remoteContentBarButton"));
 
   wait_for_message_display_completion();
 
   if (mozmill.getMail3PaneController().window.content.document
              .getElementById("video1").networkState ==
-      Components.interfaces.nsIDOMHTMLMediaElement.NETWORK_NO_SOURCE)
-    throw new Error("Video has not been blocked in message content as expected.");
+      Components.interfaces.nsIDOMHTMLMediaElement.NETWORK_NO_SOURCE) {
+
+    // This is altered debug for bug 539908 (random failure of the above check)
+    // and isn't the normal execution path.
+    // throw new Error("Video has been unexpectedly blocked.");
+
+    // Try waiting a bit longer and then checking, just in case
+    // wait_for_message_display_completion should have waited a bit longer
+    mc.sleep(3000);
+    // Although this may not be an error now, we still want to treat it as one
+    // so we can track down the cause of this random failure.
+    throw new Error("Video was unexpectedly blocked. Network State was: " +
+                    Components.interfaces.nsIDOMHTMLMediaElement.NETWORK_NO_SOURCE +
+                    "After a 3 second sleep, the network state is now: " +
+                    mozmill.getMail3PaneController().window.content.document
+                           .getElementById("video1").networkState);
+  }
   ++gMsgNo;
 }
 
 function test_videoAllowedInReplyWindow()
 {
   let replyWindow = openComposeWithReply();
 
   if (replyWindow.window.document
                  .getElementById("content-frame").contentDocument.getElementById("video1").networkState ==
       Components.interfaces.nsIDOMHTMLMediaElement.NETWORK_NO_SOURCE)
-    throw new Error("Video has not been blocked in reply window as expected.");
+    throw new Error("Video has been unexpectedly blocked.");
 
   windowHelper.close_window(replyWindow);
 }