Bug 1379515 - Propagate testharness functions only if we use testharness.js. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Sat, 28 Oct 2017 18:37:38 +0900
changeset 688159 719f3bbb2a6afabcdf96c5b7fef4b596bef9266d
parent 688158 09ec7e6a8fbae36c8f1e90fb3c63dff113df19e2
child 688160 11703c7f997b9ee043901bb51c57b9083137b960
push id86669
push userhikezoe@mozilla.com
push dateSat, 28 Oct 2017 10:13:18 +0000
reviewersbirtles
bugs1379515
milestone58.0a1
Bug 1379515 - Propagate testharness functions only if we use testharness.js. r?birtles We are going to use SimpleTest.js in the sub window. MozReview-Commit-ID: HAAMnY7xDNn
dom/animation/test/testcommon.js
--- a/dom/animation/test/testcommon.js
+++ b/dom/animation/test/testcommon.js
@@ -269,17 +269,19 @@ if (opener) {
   for (var funcName of ["async_test", "assert_not_equals", "assert_equals",
                         "assert_approx_equals", "assert_less_than",
                         "assert_less_than_equal", "assert_greater_than",
                         "assert_between_inclusive",
                         "assert_true", "assert_false",
                         "assert_class_string", "assert_throws",
                         "assert_unreached", "assert_regexp_match",
                         "promise_test", "test"]) {
-    window[funcName] = opener[funcName].bind(opener);
+    if (opener[funcName]) {
+      window[funcName] = opener[funcName].bind(opener);
+    }
   }
 
   window.EventWatcher = opener.EventWatcher;
 
   function done() {
     opener.add_completion_callback(function() {
       self.close();
     });