browser_bug1238427.js (1258B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 4 */ 5 6 "use strict"; 7 8 const TEST_URI = 9 // eslint-disable-next-line @microsoft/sdl/no-insecure-url 10 "http://example.com/browser/dom/geolocation/test/browser/geo_leak_test.html"; 11 12 const BASE_GEO_URL = 13 "http://mochi.test:8888/tests/dom/geolocation/test/mochitest/network_geolocation.sjs"; 14 15 add_task(async function () { 16 Services.prefs.setBoolPref("geo.prompt.testing", true); 17 Services.prefs.setBoolPref("geo.prompt.testing.allow", true); 18 19 // Make the geolocation provider responder very slowly to ensure that 20 // it does not reply before we close the tab. 21 Services.prefs.setCharPref( 22 "geo.provider.network.url", 23 BASE_GEO_URL + "?delay=100000" 24 ); 25 26 // Open the test URI and close it. The test harness will make sure that the 27 // page is cleaned up after some GCs. If geolocation is not shut down properly, 28 // it will show up as a non-shutdown leak. 29 await BrowserTestUtils.withNewTab( 30 { 31 gBrowser, 32 url: TEST_URI, 33 }, 34 function () { 35 /* ... */ 36 } 37 ); 38 39 ok(true, "Need to do something in this test"); 40 });