Bug 854082 - Attribute bug 621618 assertions to the proper test. r=gfritzsche a=akeybl
authorJohn Schoenick <jschoenick@mozilla.com>
Mon, 22 Apr 2013 16:43:43 -0700
changeset 133504 3c8896003c084bdc1b2463f82dc2f0a825d40d4f
parent 133503 4cf75b25cdc3265b28c12ec5ae2950e60a28502b
child 133505 ee0f68deb1f7874b2089f84d1858a1746904aeeb
push id3678
push userjschoenick@mozilla.com
push dateWed, 24 Apr 2013 20:57:13 +0000
treeherdermozilla-aurora@50e76258e71d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche, akeybl
bugs854082, 621618
milestone22.0a2
Bug 854082 - Attribute bug 621618 assertions to the proper test. r=gfritzsche a=akeybl
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>