Bug 854082 - Attribute bug 621618 assertions to the proper test. r=gfritzsche
authorJohn Schoenick <jschoenick@mozilla.com>
Mon, 22 Apr 2013 16:43:43 -0700
changeset 129675 e03057b8c8ca2ae635e99e1dc39cab174e63ca06
parent 129674 faafe91695d97fa54cff7d34fab0ea0dcd827b5c
child 129676 8f1599c9c715511d198e45bdc8272fbf5f823716
push id24586
push userryanvm@gmail.com
push dateWed, 24 Apr 2013 12:15:57 +0000
treeherdermozilla-central@1c5977e8d52f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs854082, 621618
milestone23.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 854082 - Attribute bug 621618 assertions to the proper test. r=gfritzsche
dom/plugins/test/mochitest/test_bug813906.html
dom/plugins/test/mochitest/test_cocoa_focus.html
dom/plugins/test/mochitest/test_cookies.html
--- a/dom/plugins/test/mochitest/test_bug813906.html
+++ b/dom/plugins/test/mochitest/test_bug813906.html
@@ -23,25 +23,32 @@ function f() {
     </foreignObject>
   </symbol>
   <use />
 </svg>
 
 <script type="application/javascript">
 SimpleTest.waitForExplicitFinish();
 
+// When the document is torn down or <svg> is removed, we hit bug 621618
+SimpleTest.expectAssertions(1);
+
 var frameLoadCount = 0;
 function frameLoaded() {
   frameLoadCount++;
   if (frameLoadCount == 1) {
     document.getElementsByTagName("object")[0].type = "application/x-test";
     document.getElementsByTagName("use")[0].setAttributeNS("http://www.w3.org/1999/xlink", "href", location.href + "#a");
   } else if (frameLoadCount == 2) {
     isnot(SpecialPowers.wrap(window.frame1).location.href.indexOf('chrome://'),
           0, 'plugin shouldnt be able to cause navigation to chrome URLs');
-    SimpleTest.finish();
+
+    // Make sure we trigger bug 621618 before the test finishes so the assertion
+    // is attributed to this test.
+    document.body.removeChild(document.querySelector("svg"));
+    SimpleTest.executeSoon(function() { SimpleTest.finish(); });
   }
 }
 </script>
 
 <iframe name="frame1" onload="frameLoaded()"></iframe>
 </body>
 </html>
--- a/dom/plugins/test/mochitest/test_cocoa_focus.html
+++ b/dom/plugins/test/mochitest/test_cocoa_focus.html
@@ -1,18 +1,16 @@
 <html>
 <head>
   <title>NPCocoaEventFocusChanged Tests</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 </head>
 
 <body onload="runTests()">
   <script class="testbody" type="application/javascript">
-    SimpleTest.expectAssertions(1);
-
     SimpleTest.waitForExplicitFinish();
 
     var gOtherWindow;
 
     function runTests() {
       // We have to have two top-level windows in play in order to run these tests.
       gOtherWindow = window.open("cocoa_focus.html", "", "width=250,height=250");
     }
--- a/dom/plugins/test/mochitest/test_cookies.html
+++ b/dom/plugins/test/mochitest/test_cookies.html
@@ -2,19 +2,16 @@
 <head>
   <title>NPAPI Cookie Tests</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
 </head>
 
 <body onload="runTests()">
   <embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
   <script class="testbody" type="application/javascript">
-if (!navigator.platform.startsWith("Mac")) {
-  SimpleTest.expectAssertions(1);
-}
     SimpleTest.waitForExplicitFinish();
     function runTests() {
       var pluginElement = document.getElementById("plugin1");
       pluginElement.setCookie("foo");
       is(pluginElement.getCookie(), "foo", "Cookie was set and retrieved correctly via NPAPI.");
       SimpleTest.finish();
     }
   </script>