Bug 795914 - Don't assume every mochitest that includes pointerlock_utils.js defines a 'start' function to begin its tests. r=ehsan
authorChris Pearce <cpearce@mozilla.com>
Thu, 04 Oct 2012 12:20:08 +1300
changeset 109276 972c376d08b537e30f8495ee420800cb1f3fe520
parent 109275 bd16a5d51273ef974bd40eba689e0cd1e60a300c
child 109277 6852e80e78c850289ff5cdb6b15b01f2adf92d8a
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersehsan
bugs795914
milestone18.0a1
Bug 795914 - Don't assume every mochitest that includes pointerlock_utils.js defines a 'start' function to begin its tests. r=ehsan
dom/tests/mochitest/pointerlock/pointerlock_utils.js
--- a/dom/tests/mochitest/pointerlock/pointerlock_utils.js
+++ b/dom/tests/mochitest/pointerlock/pointerlock_utils.js
@@ -50,10 +50,13 @@ if (window.opener) {
   // Ensure the full-screen api is enabled, and will be disabled on test exit.
   SpecialPowers.setBoolPref("full-screen-api.enabled", true);
 
   // Disable the requirement for trusted contexts only, so the tests are easier to write.
   SpecialPowers.setBoolPref("full-screen-api.allow-trusted-requests-only", false);
 }
 
 addLoadEvent(function() {
-  SimpleTest.waitForFocus(start);
+  if (typeof start !== 'undefined') {
+    SimpleTest.waitForFocus(start);
+  }
 });
+