Bug 1101288 - Fix rebase bustage. a=test-only
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 02 Jul 2015 13:31:42 -0400
changeset 275228 31d2743150f27c052ac8aede6c4f275905a9f08d
parent 275227 e70e0991286de6e84e993038eac50697fdf82c34
child 275233 e22cb5ee51348b537f901e62357592be3c8a4a55
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only
bugs1101288
milestone40.0
Bug 1101288 - Fix rebase bustage. a=test-only
dom/base/test/test_bug704320_policyset2.html
--- a/dom/base/test/test_bug704320_policyset2.html
+++ b/dom/base/test/test_bug704320_policyset2.html
@@ -12,16 +12,34 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
 <script type="application/javascript;version=1.7">
 
 SimpleTest.waitForExplicitFinish();
 var advance = function() { tests.next(); };
 
 /**
+ * Listen for notifications from the child.
+ * These are sent in case of error, or when the loads we await have completed.
+ */
+window.addEventListener("message", function(event) {
+    if (event.data == "childLoadComplete") {
+      // all loads happen, continue the test.
+      advance();
+    } else if (event.data == "childOverload") {
+      // too many loads happened in a test frame, abort.
+      ok(false, "Too many load handlers called in test.");
+      SimpleTest.finish();
+    } else if (event.data.indexOf("fail-") == 0) {
+      // something else failed in the test frame, abort.
+      ok(false, "Child failed the test with error " + event.data.substr(5));
+      SimpleTest.finish();
+    }});
+
+/**
  * This is the main test routine -- serialized by use of a generator.
  * It resets the counter, then performs two tests in sequence using
  * the same iframe.
  */
 var tests = (function() {
   var iframe = document.getElementById("testframe");
   const sjs = "/tests/dom/base/test/bug704320.sjs?action=generate-policy-test";