Bug 995697 - Remove obsolete geolocation private browsing test. r=jdm, a=test-only
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 01 Jun 2015 13:35:18 +0100
changeset 266160 4b0c26bdab21
parent 266155 f49be454944b
child 266161 e712de047451
push id4770
push userryanvm@gmail.com
push date2015-06-02 17:21 +0000
treeherdermozilla-beta@9463b7173dd9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm, test-only
bugs995697
milestone39.0
Bug 995697 - Remove obsolete geolocation private browsing test. r=jdm, a=test-only
dom/tests/browser/browser.ini
dom/tests/browser/browser_geolocation_privatebrowsing_page.html
dom/tests/browser/browser_geolocation_privatebrowsing_perwindowpb.js
dom/tests/browser/network_geolocation.sjs
--- a/dom/tests/browser/browser.ini
+++ b/dom/tests/browser/browser.ini
@@ -1,14 +1,12 @@
 [DEFAULT]
 skip-if = e10s # Bug ?????? - most of these tests fail for currently unknown reasons.
 support-files =
   browser_frame_elements.html
-  browser_geolocation_privatebrowsing_page.html
-  network_geolocation.sjs
   page_privatestorageevent.html
   position.html
   test-console-api.html
   test_bug1004814.html
   worker_bug1004814.js
 
 [browser_bug1008941_dismissGeolocationHanger.js]
 skip-if = buildapp == 'mulet'
@@ -18,17 +16,16 @@ skip-if = buildapp == 'mulet'
 [browser_ConsoleStoragePBTest_perwindowpb.js]
 [browser_autofocus_background.js]
 skip-if= buildapp == 'mulet'
 [browser_autofocus_preference.js]
 [browser_bug396843.js]
 [browser_focus_steal_from_chrome.js]
 [browser_focus_steal_from_chrome_during_mousedown.js]
 [browser_frame_elements.js]
-[browser_geolocation_privatebrowsing_perwindowpb.js]
 [browser_localStorage_privatestorageevent.js]
 [browser_test_new_window_from_content.js]
 skip-if = (toolkit == 'android' || buildapp == 'b2g' || buildapp == 'mulet')
 support-files =
   test_new_window_from_content_child.html
   test_new_window_from_content_child.js
 [browser_webapps_permissions.js]
 # TODO: Re-enable permissions tests on Mac, bug 795334
deleted file mode 100644
--- a/dom/tests/browser/browser_geolocation_privatebrowsing_page.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<body>
-<script>
-  navigator.geolocation.getCurrentPosition(function(pos) {
-    var evt = document.createEvent('CustomEvent');
-    evt.initCustomEvent('georesult', true, false, pos.coords.latitude);
-    document.dispatchEvent(evt);
-  });
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tests/browser/browser_geolocation_privatebrowsing_perwindowpb.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function test() {
-  var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
-  let baseProvider = "http://mochi.test:8888/browser/dom/tests/browser/network_geolocation.sjs";
-  prefs.setCharPref("geo.wifi.uri", baseProvider + "?desired_access_token=fff");
-
-  prefs.setBoolPref("geo.prompt.testing", true);
-  prefs.setBoolPref("geo.prompt.testing.allow", true);
-  var origScanValue = true; // same default in NetworkGeolocationProvider.js.
-  try {
-    origScanValue = prefs.getBoolPref("geo.wifi.scan");
-  } catch(ex) {}
-  prefs.setBoolPref("geo.wifi.scan", false);
-
-  const testPageURL = "http://mochi.test:8888/browser/" +
-    "dom/tests/browser/browser_geolocation_privatebrowsing_page.html";
-  waitForExplicitFinish();
-
-  var windowsToClose = [];
-  function testOnWindow(aIsPrivate, aCallback) {
-    let win = OpenBrowserWindow({private: aIsPrivate});
-    let gotLoad = false;
-    let gotActivate = Services.focus.activeWindow == win;
-
-    function maybeRunCallback() {
-      if (gotLoad && gotActivate) {
-        windowsToClose.push(win);
-        executeSoon(function() { aCallback(win); });
-      }
-    }
-
-    if (!gotActivate) {
-      win.addEventListener("activate", function onActivate() {
-        info("got activate");
-        win.removeEventListener("activate", onActivate, true);
-        gotActivate = true;
-        maybeRunCallback();
-      }, true);
-    } else {
-      info("Was activated");
-    }
-
-    Services.obs.addObserver(function observer(aSubject, aTopic) {
-      if (win == aSubject) {
-        info("Delayed startup finished");
-        Services.obs.removeObserver(observer, aTopic);
-        gotLoad = true;
-        maybeRunCallback();
-      }
-    }, "browser-delayed-startup-finished", false);
-
-  }
-
-  testOnWindow(false, function(aNormalWindow) {
-    aNormalWindow.gBrowser.selectedBrowser.addEventListener("georesult", function load(ev) {
-      aNormalWindow.gBrowser.selectedBrowser.removeEventListener("georesult", load, false);
-      is(ev.detail, 200, "unexpected access token");
-
-      prefs.setCharPref("geo.wifi.uri", baseProvider + "?desired_access_token=ggg");
-
-      testOnWindow(true, function(aPrivateWindow) {
-        aPrivateWindow.gBrowser.selectedBrowser.addEventListener("georesult", function load2(ev) {
-          aPrivateWindow.gBrowser.selectedBrowser.removeEventListener("georesult", load2, false);
-          is(ev.detail, 200, "unexpected access token");
-
-          prefs.setCharPref("geo.wifi.uri", baseProvider + "?expected_access_token=fff");
-
-          testOnWindow(false, function(aAnotherNormalWindow) {
-            aAnotherNormalWindow.gBrowser.selectedBrowser.addEventListener("georesult", function load3(ev) {
-              aAnotherNormalWindow.gBrowser.selectedBrowser.removeEventListener("georesult", load3, false);
-              is(ev.detail, 200, "unexpected access token");
-              prefs.setBoolPref("geo.prompt.testing", false);
-              prefs.setBoolPref("geo.prompt.testing.allow", false);
-              prefs.setBoolPref("geo.wifi.scan", origScanValue);
-              windowsToClose.forEach(function(win) {
-                                       win.close();
-                                     });
-              finish();
-            }, false, true);
-            aAnotherNormalWindow.content.location = testPageURL;
-          });
-        }, false, true);
-        aPrivateWindow.content.location = testPageURL;
-      });
-    }, false, true);
-    aNormalWindow.content.location = testPageURL;
-  });
-}
deleted file mode 100644
--- a/dom/tests/browser/network_geolocation.sjs
+++ /dev/null
@@ -1,45 +0,0 @@
-function parseQueryString(str)
-{
-  if (str == "")
-    return {};
-
-  var paramArray = str.split("&");
-  var regex = /^([^=]+)=(.*)$/;
-  var params = {};
-  for (var i = 0, sz = paramArray.length; i < sz; i++)
-  {
-    var match = regex.exec(paramArray[i]);
-    if (!match)
-      throw "Bad parameter in queryString!  '" + paramArray[i] + "'";
-    params[decodeURIComponent(match[1])] = decodeURIComponent(match[2]);
-  }
-
-  return params;
-}
-
-function getPosition(expectedAccessToken, providedAccessToken, desiredAccessToken)
-{  
-  var response = {
-    status: "OK",
-    location: {
-      lat: providedAccessToken ?
-             (expectedAccessToken == providedAccessToken ? 200 : 404) : 200,
-      lng: -122.08769,
-    },
-    accuracy: 100,
-    access_token: desiredAccessToken
-  };
-  
-  return JSON.stringify(response);
-}
-
-function handleRequest(request, response)
-{
-  var params = parseQueryString(request.queryString);
-
-  response.setStatusLine("1.0", 200, "OK");
-  response.setHeader("Cache-Control", "no-cache", false);
-  response.setHeader("Content-Type", "aplication/x-javascript", false);
-  response.write(getPosition(params.expected_access_token, params.access_token,
-                             params.desired_access_token));
-}