Bug 931445 part 1 - Remove unused code from pointerlock_utils.js. r=smaug
authorXidorn Quan <me@upsuper.org>
Fri, 27 May 2016 17:13:05 +1000
changeset 340286 5cbadad4fd9c0463697102f249e1c86ce98d01c1
parent 340285 6b521813510a57d2504d175970c2c94127f60985
child 340287 a350fb7c1dbac7302db5b096de2cde327ba600da
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs931445
milestone49.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 931445 part 1 - Remove unused code from pointerlock_utils.js. r=smaug MozReview-Commit-ID: L3rTKPUqrJh
dom/tests/mochitest/pointerlock/pointerlock_utils.js
--- a/dom/tests/mochitest/pointerlock/pointerlock_utils.js
+++ b/dom/tests/mochitest/pointerlock/pointerlock_utils.js
@@ -1,66 +1,50 @@
-const isWinXP = navigator.userAgent.indexOf("Windows NT 5.1") != -1;
-const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
+// Get test filename for page being run in popup so errors are more useful
+var testName = location.pathname.split('/').pop();
 
-// If we're running in a child window, shim things so it works the same
-// as if we were running stand-alone.
-if (window.opener) {
-  // Get test filename for page being run in popup so errors are more useful
-  var testName = location.pathname.split('/').pop();
-
-  // Wrap test functions and pass to parent window
-  window.ok = function(a, msg) {
-    opener.ok(a, testName + ": " + msg);
-  };
+// Wrap test functions and pass to parent window
+window.ok = function(a, msg) {
+  opener.ok(a, testName + ": " + msg);
+};
 
-  window.is = function(a, b, msg) {
-    opener.is(a, b, testName + ": " + msg);
-  };
-
-  window.isnot = function(a, b, msg) {
-    opener.isnot(a, b, testName + ": " + msg);
-  };
+window.is = function(a, b, msg) {
+  opener.is(a, b, testName + ": " + msg);
+};
 
-  window.todo = function(a, msg) {
-    opener.todo(a, testName + ": " + msg);
-  };
+window.isnot = function(a, b, msg) {
+  opener.isnot(a, b, testName + ": " + msg);
+};
 
-  window.todo_is = function(a, b, msg) {
-    opener.todo_is(a, b, testName + ": " + msg);
-  };
+window.todo = function(a, msg) {
+  opener.todo(a, testName + ": " + msg);
+};
 
-  window.todo_isnot = function(a, b, msg) {
-    opener.todo_isnot(a, b, testName + ": " + msg);
-  };
+window.todo_is = function(a, b, msg) {
+  opener.todo_is(a, b, testName + ": " + msg);
+};
 
-  window.info = function(msg) {
-    opener.info(testName + ": " + msg);
-  };
+window.todo_isnot = function(a, b, msg) {
+  opener.todo_isnot(a, b, testName + ": " + msg);
+};
 
-  // Override bits of SimpleTest so test files work stand-alone
-  var SimpleTest = SimpleTest || {};
-
-  SimpleTest.waitForExplicitFinish = function() {
-    dump("[POINTERLOCK] Starting " + testName+ "\n");
-  };
+window.info = function(msg) {
+  opener.info(testName + ": " + msg);
+};
 
-  SimpleTest.finish = function () {
-    dump("[POINTERLOCK] Finishing " + testName+ "\n");
-    opener.nextTest();
-  };
-} else {
-  // If we're not running in a child window, prefs need to get flipped here,
-  // otherwise it was already done in the test runner parent.
+// Override bits of SimpleTest so test files work stand-alone
+var SimpleTest = SimpleTest || {};
 
-  // Ensure the full-screen api is enabled, and will be disabled on test exit.
-  SpecialPowers.setBoolPref("full-screen-api.enabled", true);
+SimpleTest.waitForExplicitFinish = function() {
+  dump("[POINTERLOCK] Starting " + testName+ "\n");
+};
 
-  // Disable the requirement for trusted contexts only, so the tests are easier to write.
-  SpecialPowers.setBoolPref("full-screen-api.allow-trusted-requests-only", false);
-}
+SimpleTest.finish = function () {
+  dump("[POINTERLOCK] Finishing " + testName+ "\n");
+  opener.nextTest();
+};
 
 addLoadEvent(function() {
   if (typeof start !== 'undefined') {
     SimpleTest.waitForFocus(start);
   }
 });