Bug 1960651 - Part 1: Move all geolocation tests to dom/geolocation/test r=dom-core,frontend-codestyle-reviewers,mccr8
Also had to fix eslint and file-whitespace errors because the tests have been shadowed previously. Differential Revision: https://phabricator.services.mozilla.com/D245621
This commit is contained in:
@@ -1494,7 +1494,6 @@ const rollouts = [
|
||||
"dom/tests/browser/browser_ConsoleStoragePBTest_perwindowpb.js",
|
||||
"dom/tests/browser/browser_beforeunload_between_chrome_content.js",
|
||||
"dom/tests/browser/browser_bug1004814.js",
|
||||
"dom/tests/browser/browser_bug1238427.js",
|
||||
"dom/tests/browser/browser_bytecode_cache_asm_js.js",
|
||||
"dom/tests/browser/browser_frame_elements.js",
|
||||
"dom/tests/browser/browser_hasbeforeunload.js",
|
||||
|
||||
@@ -6,7 +6,7 @@ support-files = [
|
||||
"file_animation_api.html",
|
||||
"worker_child.js",
|
||||
"worker_grandchild.js",
|
||||
"!/dom/tests/mochitest/geolocation/network_geolocation.sjs",
|
||||
"!/dom/geolocation/test/mochitest/network_geolocation.sjs",
|
||||
]
|
||||
|
||||
["test_animation_api.html"]
|
||||
|
||||
@@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1372069
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript">
|
||||
|
||||
const BASE_GEO_URL = "http://mochi.test:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs";
|
||||
const BASE_GEO_URL = "http://mochi.test:8888/tests/dom/geolocation/test/mochitest/network_geolocation.sjs";
|
||||
|
||||
/** Test for Bug 1372069 */
|
||||
/** Modified for Bug 1441295 */
|
||||
|
||||
@@ -81,3 +81,8 @@ elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
|
||||
if CONFIG["MOZ_ENABLE_DBUS"]:
|
||||
LOCAL_INCLUDES += ["/dom/system/linux"]
|
||||
CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
|
||||
|
||||
BROWSER_CHROME_MANIFESTS += ["test/browser/browser.toml"]
|
||||
MOCHITEST_CHROME_MANIFESTS += ["test/chrome/chrome.toml"]
|
||||
MOCHITEST_MANIFESTS += ["test/mochitest/mochitest.toml"]
|
||||
XPCSHELL_TESTS_MANIFESTS += ["test/unit/xpcshell.toml"]
|
||||
|
||||
15
dom/geolocation/test/browser/browser.toml
Normal file
15
dom/geolocation/test/browser/browser.toml
Normal file
@@ -0,0 +1,15 @@
|
||||
[DEFAULT]
|
||||
support-files = [
|
||||
"!/dom/geolocation/test/mochitest/network_geolocation.sjs",
|
||||
]
|
||||
|
||||
["browser_bug1008941_dismissGeolocationHanger.js"]
|
||||
support-files = ["position.html"]
|
||||
tags = "geolocation"
|
||||
|
||||
["browser_bug1238427.js"]
|
||||
https_first_disabled = true
|
||||
support-files = ["geo_leak_test.html"]
|
||||
|
||||
["browser_geolocation_override.js"]
|
||||
support-files = ["!/dom/tests/browser/file_empty.html"]
|
||||
@@ -5,8 +5,7 @@
|
||||
"use strict";
|
||||
|
||||
const TEST_URI =
|
||||
// eslint-disable-next-line no-useless-concat
|
||||
"https://example.com/" + "browser/dom/tests/browser/position.html";
|
||||
"https://example.com/browser/dom/geolocation/test/browser/position.html";
|
||||
|
||||
add_task(async function testDismissHanger() {
|
||||
info(
|
||||
@@ -6,11 +6,11 @@
|
||||
"use strict";
|
||||
|
||||
const TEST_URI =
|
||||
// eslint-disable-next-line no-useless-concat
|
||||
"http://example.com/" + "browser/dom/tests/browser/geo_leak_test.html";
|
||||
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
|
||||
"http://example.com/browser/dom/geolocation/test/browser/geo_leak_test.html";
|
||||
|
||||
const BASE_GEO_URL =
|
||||
"http://mochi.test:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs";
|
||||
"http://mochi.test:8888/tests/dom/geolocation/test/mochitest/network_geolocation.sjs";
|
||||
|
||||
add_task(async function () {
|
||||
Services.prefs.setBoolPref("geo.prompt.testing", true);
|
||||
@@ -1,7 +1,8 @@
|
||||
const GEO_URL =
|
||||
"http://mochi.test:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs";
|
||||
"http://mochi.test:8888/tests/dom/geolocation/test/mochitest/network_geolocation.sjs";
|
||||
|
||||
const PAGE_URL = "https://example.com/file_empty.html";
|
||||
const PAGE_URL =
|
||||
"https://example.com/browser/dom/tests/browser/file_empty.html";
|
||||
|
||||
const required_preferences = [
|
||||
["geo.provider.network.url", GEO_URL],
|
||||
@@ -18,10 +19,7 @@ add_task(async function test_getCurrentPosition() {
|
||||
const tab = await BrowserTestUtils.openNewForegroundTab(
|
||||
gBrowser,
|
||||
() => {
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(
|
||||
gBrowser,
|
||||
"https://example.com/file_empty.html"
|
||||
);
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, PAGE_URL);
|
||||
browser = gBrowser.selectedBrowser;
|
||||
pageLoaded = BrowserTestUtils.browserLoaded(browser, true);
|
||||
},
|
||||
@@ -254,10 +252,7 @@ add_task(async function test_tab_reload() {
|
||||
const tab = await BrowserTestUtils.openNewForegroundTab(
|
||||
gBrowser,
|
||||
() => {
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(
|
||||
gBrowser,
|
||||
"https://example.com/file_empty.html"
|
||||
);
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, PAGE_URL);
|
||||
browser = gBrowser.selectedBrowser;
|
||||
pageLoaded = BrowserTestUtils.browserLoaded(browser, true);
|
||||
},
|
||||
@@ -1,7 +1,7 @@
|
||||
[DEFAULT]
|
||||
support-files = [
|
||||
"geolocation_common.js",
|
||||
"network_geolocation.sjs",
|
||||
"!/dom/geolocation/test/mochitest/geolocation_common.js",
|
||||
"!/dom/geolocation/test/mochitest/network_geolocation.sjs",
|
||||
]
|
||||
|
||||
["test_handlerSpinsEventLoop.html"]
|
||||
@@ -6,19 +6,21 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=911595
|
||||
<head>
|
||||
<title>Test for spinning the event loop inside position handlers</title>
|
||||
<script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="geolocation_common.js"></script>
|
||||
<script src="https://example.com/tests/dom/geolocation/test/mochitest/geolocation_common.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=911595 ">Mozilla Bug 911595</a>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=911595">Mozilla Bug 911595</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
/* global check_geolocation, force_prompt, resume_geolocationProvider */
|
||||
|
||||
/*
|
||||
* In bug 911595 , spinning the event loop from inside position
|
||||
* handlers could cause both success and error callbacks to be
|
||||
@@ -43,7 +45,7 @@ function successCallback(position) {
|
||||
}
|
||||
|
||||
var errorCallbackCalled = false;
|
||||
function errorCallback(error) {
|
||||
function errorCallback(_error) {
|
||||
errorCallbackCalled = true;
|
||||
info("TEST-INFO | errorCallback called");
|
||||
check();
|
||||
@@ -59,7 +61,7 @@ var timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
function test1() {
|
||||
SpecialPowers.pushPrefEnv({"set": [["geo.provider.network.timeToWaitBeforeSending", 10]]}, function() {
|
||||
navigator.geolocation.getCurrentPosition(successCallback, errorCallback, {timeout: 500});
|
||||
timer.initWithCallback(timer => {
|
||||
timer.initWithCallback(_timer => {
|
||||
timeoutPassed = true;
|
||||
}, 600, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
});
|
||||
@@ -7,7 +7,7 @@
|
||||
Runs inside iframe in test_crossorigin_iframe.html.
|
||||
*/
|
||||
|
||||
const BASE_GEO_URL = "http://mochi.test:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs";
|
||||
const BASE_GEO_URL = "http://mochi.test:8888/tests/dom/geolocation/test/mochitest/network_geolocation.sjs";
|
||||
var pushPrefs = (...p) => SpecialPowers.pushPrefEnv({set: p});
|
||||
|
||||
(async () => {
|
||||
@@ -5,7 +5,7 @@ var harness =
|
||||
var BASE_URL =
|
||||
"http://mochi.test:8888/" +
|
||||
harness +
|
||||
"/dom/tests/mochitest/geolocation/network_geolocation.sjs";
|
||||
"/dom/geolocation/test/mochitest/network_geolocation.sjs";
|
||||
|
||||
function set_geo_wifi_uri(uri, callback) {
|
||||
// Disable NetworkGeolocationProvider.js request cache because the cache
|
||||
@@ -19,11 +19,6 @@ function set_geo_wifi_uri(uri, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function sleep(delay) {
|
||||
var start = Date.now();
|
||||
while (Date.now() < start + delay) {}
|
||||
}
|
||||
|
||||
function force_prompt(allow, callback) {
|
||||
SpecialPowers.pushPrefEnv(
|
||||
{
|
||||
@@ -39,24 +34,27 @@ function force_prompt(allow, callback) {
|
||||
function start_sending_garbage(callback) {
|
||||
set_geo_wifi_uri(BASE_URL + "?action=respond-garbage", () => {
|
||||
// we need to be sure that all location data has been purged/set.
|
||||
sleep(1000);
|
||||
callback.call();
|
||||
setTimeout(() => {
|
||||
callback.call();
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
function stop_sending_garbage(callback) {
|
||||
set_geo_wifi_uri(BASE_URL + "", () => {
|
||||
// we need to be sure that all location data has been purged/set.
|
||||
sleep(1000);
|
||||
callback.call();
|
||||
setTimeout(() => {
|
||||
callback.call();
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
function stop_geolocationProvider(callback) {
|
||||
set_geo_wifi_uri(BASE_URL + "?action=stop-responding", () => {
|
||||
// we need to be sure that all location data has been purged/set.
|
||||
sleep(1000);
|
||||
callback.call();
|
||||
setTimeout(() => {
|
||||
callback.call();
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ function parseQueryString(str) {
|
||||
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] + "'";
|
||||
throw new Error(`Bad parameter in queryString! '${paramArray[i]}'`);
|
||||
}
|
||||
params[decodeURIComponent(match[1])] = decodeURIComponent(match[2]);
|
||||
}
|
||||
@@ -53,7 +53,6 @@ function handleRequest(request, response) {
|
||||
}
|
||||
}
|
||||
|
||||
var response;
|
||||
response.processAsync();
|
||||
response.setStatusLine("1.0", 200, "OK");
|
||||
response.setHeader("Cache-Control", "no-cache", false);
|
||||
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=478911
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=478911">Mozilla Bug 478911</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -38,4 +38,3 @@ function test1() {
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=478911
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=478911">Mozilla Bug 478911</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -41,4 +41,3 @@ function test1() {
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -49,7 +49,7 @@ function done() {
|
||||
});
|
||||
}
|
||||
|
||||
function errorCallback(err) {
|
||||
function errorCallback(_err) {
|
||||
ok(false, "error callback should not have been called");
|
||||
done();
|
||||
}
|
||||
@@ -60,17 +60,17 @@ function test_cachedPosition() {
|
||||
// first call is just to warm up the cache
|
||||
check_geolocation(pos);
|
||||
|
||||
navigator.geolocation.getCurrentPosition(function(pos) {
|
||||
check_geolocation(pos);
|
||||
cached = pos;
|
||||
navigator.geolocation.getCurrentPosition(function(pos2) {
|
||||
check_geolocation(pos2);
|
||||
cached = pos2;
|
||||
|
||||
navigator.geolocation.getCurrentPosition(function(pos) {
|
||||
check_geolocation(pos);
|
||||
is(pos.timestamp, cached.timestamp, "position should be equal to cached position");
|
||||
navigator.geolocation.getCurrentPosition(function(pos) {
|
||||
navigator.geolocation.getCurrentPosition(function(pos3) {
|
||||
check_geolocation(pos3);
|
||||
is(pos3.timestamp, cached.timestamp, "position should be equal to cached position");
|
||||
navigator.geolocation.getCurrentPosition(function(pos4) {
|
||||
// force new position, can't be the one we have
|
||||
check_geolocation(pos);
|
||||
isnot(pos.timestamp, cached.timestamp, "position should not be equal to cached position");
|
||||
check_geolocation(pos4);
|
||||
isnot(pos4.timestamp, cached.timestamp, "position should not be equal to cached position");
|
||||
done();
|
||||
}, errorCallback, {maximumAge: 0});
|
||||
}, errorCallback, {maximumAge: 21600000});
|
||||
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=478911
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=478911">Mozilla Bug 478911</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -30,7 +30,7 @@ function failureCallback(error) {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function successCallback(position){
|
||||
function successCallback(_position){
|
||||
ok(0, "Success was called when it shouldn't have been. major problem");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
@@ -42,4 +42,3 @@ function test1() {
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=478911
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=478911">Mozilla Bug 478911</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -32,7 +32,7 @@ function failureCallback(error) {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function successCallback(position){
|
||||
function successCallback(_position){
|
||||
ok(0, "Success was called when it shouldn't have been. major problem");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
@@ -44,6 +44,3 @@ function test1() {
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=478911
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=478911">Mozilla Bug 478911</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -30,7 +30,7 @@ var hasBeenCleared = false;
|
||||
var successWasCalledAfterClear = false;
|
||||
var firstCallback = true;
|
||||
|
||||
function failureCallback(error)
|
||||
function failureCallback(_error)
|
||||
{
|
||||
ok(0, "we should not be seeing failures from this watchPosition");
|
||||
}
|
||||
@@ -39,7 +39,7 @@ function successCallback(position) {
|
||||
ok(true, "successCallback was called, hasBeenCleared=" + hasBeenCleared +
|
||||
", successWasCalledAfterClear=" + successWasCalledAfterClear);
|
||||
check_geolocation(position);
|
||||
if (hasBeenCleared == true) {
|
||||
if (hasBeenCleared) {
|
||||
successWasCalledAfterClear = true;
|
||||
}
|
||||
if (firstCallback) {
|
||||
@@ -34,7 +34,7 @@ function run_test() {
|
||||
function(pos) {
|
||||
check_geolocation(pos);
|
||||
successCallbackCalled = true;
|
||||
}, function(err) {
|
||||
}, function(_err) {
|
||||
errorCallbackCalled = true;
|
||||
}
|
||||
);
|
||||
@@ -43,10 +43,10 @@ function run_test() {
|
||||
function(pos) {
|
||||
check_geolocation(pos);
|
||||
SimpleTest.executeSoon(function() {
|
||||
ok(successCallbackCalled == false,
|
||||
ok(!successCallbackCalled,
|
||||
"getCurrentPosition : Success callback should not have been called");
|
||||
|
||||
ok(errorCallbackCalled == false,
|
||||
ok(!errorCallbackCalled,
|
||||
"getCurrentPosition : Error callback should not have been called");
|
||||
|
||||
SimpleTest.finish();
|
||||
@@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=463039
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=463039">Mozilla Bug 463039</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -27,8 +27,8 @@ resume_geolocationProvider(function() {
|
||||
function test1() {
|
||||
navigator.geolocation.watchPosition(function(){});
|
||||
|
||||
// there are no watches, so this should always throw
|
||||
for (x=-10; x<10; x++) {
|
||||
// there are no watches, but this should never throw
|
||||
for (let x=-10; x<10; x++) {
|
||||
navigator.geolocation.clearWatch(x);
|
||||
ok(1, "clearWatch should not throw");
|
||||
}
|
||||
@@ -39,9 +39,8 @@ function test1() {
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -44,7 +44,7 @@ async function nextTest() {
|
||||
|
||||
let geolocationPromise = checkGeolocationResult(test);
|
||||
iframe.src =
|
||||
"https://example.net/tests/dom/tests/mochitest/geolocation/crossorigin_iframe.html";
|
||||
"https://example.net/tests/dom/geolocation/test/mochitest/crossorigin_iframe.html";
|
||||
document.body.appendChild(iframe);
|
||||
await geolocationPromise;
|
||||
|
||||
@@ -11,6 +11,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1765835
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1765835">Mozilla Bug 1765835</a>
|
||||
<script class="testbody" type="text/javascript">
|
||||
/* global sendAsyncMessage, addMessageListener */
|
||||
function mockChromeScript() {
|
||||
function enableHighAccuracy(subject, topic, data) {
|
||||
sendAsyncMessage("setHighAccuracy", data == "true");
|
||||
@@ -38,7 +38,7 @@ function errorCallback(error) {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function successCallback(position) {
|
||||
function successCallback(_position) {
|
||||
test2();
|
||||
}
|
||||
|
||||
@@ -49,4 +49,3 @@ function test2() {
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=482260
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=455327">Mozilla Bug 482260</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -30,7 +30,7 @@ function test1() {
|
||||
start_sending_garbage(test2);
|
||||
}
|
||||
|
||||
function successCallback(pos){
|
||||
function successCallback(_pos){
|
||||
ok(false, "success should have never been called.");
|
||||
stop_sending_garbage(function() {SimpleTest.finish();});
|
||||
}
|
||||
@@ -22,7 +22,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1269531
|
||||
// The test succeeds if the error callback is called because we expect
|
||||
// failure when a getCurrentPosition() request is submitted in a non
|
||||
// secure context.
|
||||
function successCallback(position) {
|
||||
function successCallback(_position) {
|
||||
ok(false, "Success callback is not expected to be called");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
@@ -44,4 +44,3 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1269531
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -24,7 +24,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1269531
|
||||
// The test succeeds if the error callback is called because we expect
|
||||
// failure when a watchPosition() request is submitted in a non
|
||||
// secure context.
|
||||
function successCallback(position) {
|
||||
function successCallback(_position) {
|
||||
ok(false, "Success callback is not expected to be called");
|
||||
navigator.geolocation.clearWatch(wid);
|
||||
SimpleTest.finish();
|
||||
@@ -48,4 +48,3 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1269531
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -17,6 +17,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1653549
|
||||
|
||||
<script class="testbody">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.requestFlakyTimeout("we need to be sure that all location data has been purged/set");
|
||||
|
||||
// Little promise wrapper helper.
|
||||
function p(f) {
|
||||
@@ -107,4 +108,3 @@ resume_geolocationProvider(async () => {
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=482260
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=482260">Mozilla Bug 482260</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -36,7 +36,7 @@ function successCallback(position) {
|
||||
testPassed();
|
||||
}
|
||||
|
||||
function failureCallback(code) {
|
||||
function failureCallback(_code) {
|
||||
failureCallbackCalled++;
|
||||
testPassed();
|
||||
}
|
||||
@@ -57,4 +57,3 @@ function testPassed() {
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=482260
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=482260">Mozilla Bug 482260</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -27,10 +27,10 @@ resume_geolocationProvider(function() {
|
||||
|
||||
var keepGoing = 10;
|
||||
|
||||
function successCallback(position) {
|
||||
function successCallback(_position) {
|
||||
if (keepGoing-- > 0) {
|
||||
setTimeout(function() {navigator.geolocation.getCurrentPosition(successCallback);}, 0);
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
ok(1, "100 successful calls");
|
||||
@@ -44,4 +44,3 @@ function test1() {
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=482260
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=482260">Mozilla Bug 482260</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -38,7 +38,7 @@ function test1() {
|
||||
successCallbackCalled++;
|
||||
watchCallback(watchID);
|
||||
},
|
||||
error => {
|
||||
_error => {
|
||||
failureCallbackCalled++;
|
||||
watchCallback(watchID);
|
||||
}
|
||||
@@ -53,4 +53,3 @@ function test1() {
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -15,7 +15,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=478911
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=478911">Crash in Multiple Windows</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -57,7 +57,7 @@ add_task(async function test_highAccuracy() {
|
||||
{ enableHighAccuracy: true});
|
||||
});
|
||||
|
||||
// Low accuracy can sometimes be the same as high accuracy
|
||||
// Low accuracy can sometimes be the same as high accuracy
|
||||
// if a location provider recently provided a value
|
||||
if(highAccuracy >= lowAccuracy ){
|
||||
ok(true, "accuracy is correct");
|
||||
@@ -10,6 +10,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
/* global GeolocationPositionError */
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
async function runTest() {
|
||||
@@ -44,7 +45,7 @@
|
||||
|
||||
// Now try to get current position while not fully active...
|
||||
const positionError = await new Promise((resolve, reject) => {
|
||||
const result = geo.getCurrentPosition(
|
||||
geo.getCurrentPosition(
|
||||
reject, // We don't want a position
|
||||
resolve // We want an error!
|
||||
);
|
||||
@@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=452566
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=452566">Mozilla Bug 452566</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=716127
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=716127">Mozilla Bug 716127</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -60,4 +60,3 @@ function handle_error() {
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -26,7 +26,7 @@ resume_geolocationProvider(function() {
|
||||
});
|
||||
|
||||
|
||||
function successCallback(position) {
|
||||
function successCallback(_position) {
|
||||
ok(false, "we should not be seeing successCallback here.");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
@@ -53,4 +53,3 @@ function test1() {
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=455327
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=455327">Mozilla Bug 478911</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -31,7 +31,7 @@ function test1() {
|
||||
stop_geolocationProvider(test2);
|
||||
}
|
||||
|
||||
function successCallback(pos){
|
||||
function successCallback(_pos){
|
||||
ok(false, "success should have never been called.");
|
||||
resume_geolocationProvider(function() {
|
||||
SimpleTest.finish();
|
||||
@@ -14,7 +14,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=493615
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=493615">Mozilla Bug 493615</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
@@ -33,4 +33,3 @@ force_prompt(true, function() {
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -41,4 +41,3 @@ navigator.geolocation.watchPosition(successCallback, null, null);
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
25
dom/geolocation/test/unit/xpcshell.toml
Normal file
25
dom/geolocation/test/unit/xpcshell.toml
Normal file
@@ -0,0 +1,25 @@
|
||||
[DEFAULT]
|
||||
|
||||
["test_geolocation_monitor.js"]
|
||||
|
||||
["test_geolocation_position_unavailable.js"]
|
||||
|
||||
["test_geolocation_position_unavailable_wrap.js"]
|
||||
|
||||
["test_geolocation_provider.js"]
|
||||
|
||||
["test_geolocation_provider_timeout.js"]
|
||||
|
||||
["test_geolocation_reset_accuracy.js"]
|
||||
skip-if = [
|
||||
"os == 'win' && os_version == '11.26100' && processor == 'x86_64' && opt && msix", # Bug 1822179
|
||||
]
|
||||
|
||||
["test_geolocation_reset_accuracy_wrap.js"]
|
||||
skip-if = [
|
||||
"os == 'win' && os_version == '11.26100' && processor == 'x86_64' && opt && msix", # Bug 1822179
|
||||
]
|
||||
|
||||
["test_geolocation_timeout.js"]
|
||||
|
||||
["test_geolocation_timeout_wrap.js"]
|
||||
@@ -1,7 +1,7 @@
|
||||
[DEFAULT]
|
||||
support-files = [
|
||||
"empty.html",
|
||||
"!/dom/tests/mochitest/geolocation/network_geolocation.sjs",
|
||||
"!/dom/geolocation/test/mochitest/network_geolocation.sjs",
|
||||
]
|
||||
tags = "feature-policy"
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ const TEST_PATH_ORG = getRootDirectory(gTestPath).replace(
|
||||
);
|
||||
|
||||
const GEO_URL =
|
||||
"http://mochi.test:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs";
|
||||
"http://mochi.test:8888/tests/dom/geolocation/test/mochitest/network_geolocation.sjs";
|
||||
|
||||
add_task(async () => {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
|
||||
@@ -7,15 +7,12 @@ support-files = [
|
||||
"page_localstorage_coop+coep.html",
|
||||
"page_localstorage_coop+coep.html^headers^",
|
||||
"page_localstorage_snapshotting.html",
|
||||
"position.html",
|
||||
"test-console-api.html",
|
||||
"test_bug1004814.html",
|
||||
"worker_bug1004814.js",
|
||||
"geo_leak_test.html",
|
||||
"dummy.html",
|
||||
"dummy.png",
|
||||
"helper_localStorage.js",
|
||||
"!/dom/tests/mochitest/geolocation/network_geolocation.sjs",
|
||||
]
|
||||
|
||||
["browser_ConsoleAPI_originAttributes.js"]
|
||||
@@ -37,15 +34,9 @@ https_first_disabled = true
|
||||
|
||||
["browser_bug1004814.js"]
|
||||
|
||||
["browser_bug1008941_dismissGeolocationHanger.js"]
|
||||
tags = "geolocation"
|
||||
|
||||
["browser_bug1236512.js"]
|
||||
skip-if = ["os == 'linux' && os_version == '18.04' && processor == 'x86_64'"]
|
||||
|
||||
["browser_bug1238427.js"]
|
||||
https_first_disabled = true
|
||||
|
||||
["browser_bug1316330.js"]
|
||||
|
||||
["browser_bug1563629.js"]
|
||||
@@ -80,9 +71,6 @@ support-files = ["file_empty.html"]
|
||||
|
||||
["browser_frame_elements.js"]
|
||||
|
||||
["browser_geolocation_override.js"]
|
||||
support-files = ["file_empty.html"]
|
||||
|
||||
["browser_hasActivePeerConnections.js"]
|
||||
support-files = ["create_webrtc_peer_connection.html"]
|
||||
skip-if = [
|
||||
|
||||
@@ -32,7 +32,6 @@ support-files = [
|
||||
"!/dom/tests/mochitest/general/file_clonewrapper.html",
|
||||
"!/dom/tests/mochitest/general/file_moving_nodeList.html",
|
||||
"!/dom/tests/mochitest/general/file_moving_xhr.html",
|
||||
"!/dom/tests/mochitest/geolocation/network_geolocation.sjs",
|
||||
]
|
||||
prefs = [ "layout.css.at-scope.enabled=true" ]
|
||||
|
||||
|
||||
@@ -16,15 +16,6 @@ with Files("browser/*autofocus*"):
|
||||
with Files("browser/*unload*"):
|
||||
BUG_COMPONENT = ("Core", "DOM: Events")
|
||||
|
||||
with Files("browser/*1238427*"):
|
||||
BUG_COMPONENT = ("Core", "DOM: Geolocation")
|
||||
|
||||
with Files("browser/*Geolocation*"):
|
||||
BUG_COMPONENT = ("Core", "DOM: Geolocation")
|
||||
|
||||
with Files("browser/*geo_*"):
|
||||
BUG_COMPONENT = ("Core", "DOM: Geolocation")
|
||||
|
||||
with Files("browser/browser_cancel_keydown_keypress_event.js"):
|
||||
BUG_COMPONENT = ("Core", "DOM: UI Events & Focus Handling")
|
||||
|
||||
@@ -76,9 +67,6 @@ with Files("mochitest/gamepad/**"):
|
||||
with Files("mochitest/general/**"):
|
||||
BUG_COMPONENT = ("Core", "DOM: Core & HTML")
|
||||
|
||||
with Files("mochitest/geolocation/**"):
|
||||
BUG_COMPONENT = ("Core", "DOM: Geolocation")
|
||||
|
||||
with Files("mochitest/localstorage/**"):
|
||||
BUG_COMPONENT = ("Core", "Storage: localStorage & sessionStorage")
|
||||
|
||||
@@ -136,9 +124,6 @@ with Files("reftest/xml-stylesheet/**"):
|
||||
with Files("unit/**"):
|
||||
BUG_COMPONENT = ("Core", "DOM: Core & HTML")
|
||||
|
||||
with Files("unit/*geolocation*"):
|
||||
BUG_COMPONENT = ("Core", "DOM: Geolocation")
|
||||
|
||||
with Files("unit/test_bug465752.js"):
|
||||
BUG_COMPONENT = ("Core", "CSS Parsing and Computation")
|
||||
|
||||
@@ -160,7 +145,6 @@ MOCHITEST_MANIFESTS += [
|
||||
"mochitest/fetch/mochitest.toml",
|
||||
"mochitest/gamepad/mochitest.toml",
|
||||
"mochitest/general/mochitest.toml",
|
||||
"mochitest/geolocation/mochitest.toml",
|
||||
"mochitest/integer-gemm/mochitest.toml",
|
||||
"mochitest/keyhandling/mochitest.toml",
|
||||
"mochitest/localstorage/mochitest.toml",
|
||||
@@ -178,7 +162,6 @@ MOCHITEST_CHROME_MANIFESTS += [
|
||||
"mochitest/chrome/chrome.toml",
|
||||
"mochitest/fs/chrome.toml",
|
||||
"mochitest/general/chrome.toml",
|
||||
"mochitest/geolocation/chrome.toml",
|
||||
"mochitest/keyhandling/chrome.toml",
|
||||
"mochitest/localstorage/chrome.toml",
|
||||
"mochitest/sessionstorage/chrome.toml",
|
||||
|
||||
@@ -8,28 +8,4 @@
|
||||
|
||||
["test_bug465752.js"]
|
||||
|
||||
["test_geolocation_monitor.js"]
|
||||
|
||||
["test_geolocation_position_unavailable.js"]
|
||||
|
||||
["test_geolocation_position_unavailable_wrap.js"]
|
||||
|
||||
["test_geolocation_provider.js"]
|
||||
|
||||
["test_geolocation_provider_timeout.js"]
|
||||
|
||||
["test_geolocation_reset_accuracy.js"]
|
||||
skip-if = [
|
||||
"os == 'win' && os_version == '11.26100' && processor == 'x86_64' && opt && msix", # Bug 1822179
|
||||
]
|
||||
|
||||
["test_geolocation_reset_accuracy_wrap.js"]
|
||||
skip-if = [
|
||||
"os == 'win' && os_version == '11.26100' && processor == 'x86_64' && opt && msix", # Bug 1822179
|
||||
]
|
||||
|
||||
["test_geolocation_timeout.js"]
|
||||
|
||||
["test_geolocation_timeout_wrap.js"]
|
||||
|
||||
["test_xhr_init.js"]
|
||||
|
||||
@@ -122,7 +122,7 @@ user_pref("geo.provider.testing", true);
|
||||
user_pref("geo.provider.network.logging.enabled", true);
|
||||
user_pref("geo.provider.network.scan", false);
|
||||
user_pref("geo.provider.network.timeToWaitBeforeSending", 2000);
|
||||
user_pref("geo.provider.network.url", "http://{server}/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs");
|
||||
user_pref("geo.provider.network.url", "http://{server}/tests/dom/geolocation/test/mochitest/network_geolocation.sjs");
|
||||
user_pref("gfx.color_management.force_srgb", true);
|
||||
user_pref("gfx.logging.level", 1);
|
||||
// We don't want to hit the real Firefox Accounts server for tests. We don't
|
||||
|
||||
@@ -73,7 +73,7 @@ support-files = [
|
||||
"serviceWorker.js",
|
||||
"slow_response.sjs",
|
||||
"webrequest_worker.js",
|
||||
"!/dom/tests/mochitest/geolocation/network_geolocation.sjs",
|
||||
"!/dom/geolocation/test/mochitest/network_geolocation.sjs",
|
||||
"!/toolkit/components/passwordmgr/test/authenticate.sjs",
|
||||
"file_redirect_data_uri.html",
|
||||
"file_redirect_cors_bypass.html",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"use strict";
|
||||
|
||||
add_task(async function test_geolocation_nopermission() {
|
||||
let GEO_URL = "http://mochi.test:8888/tests/dom/tests/mochitest/geolocation/network_geolocation.sjs";
|
||||
let GEO_URL = "http://mochi.test:8888/tests/dom/geolocation/test/mochitest/network_geolocation.sjs";
|
||||
await SpecialPowers.pushPrefEnv({"set": [["geo.provider.network.url", GEO_URL]]});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user