Merge mozilla-central to inbound. a=merge CLOSED TREE

This commit is contained in:
Csoregi Natalia 2018-02-02 06:33:34 +02:00
Родитель 40e8b95bed c470850884
Коммит caba23a6ce
127 изменённых файлов: 900 добавлений и 491 удалений

Просмотреть файл

@ -452,7 +452,7 @@ nsContextMenu.prototype = {
var haveSetDesktopBackground = false;
if (AppConstants.HAVE_SHELL_SERVICE &&
Services.policies.isAllowed("set_desktop_background")) {
Services.policies.isAllowed("setDesktopBackground")) {
// Only enable Set as Desktop Background if we can get the shell service.
var shell = getShellService();
if (shell)
@ -1019,7 +1019,7 @@ nsContextMenu.prototype = {
onMessage);
if (message.data.disable ||
!Services.policies.isAllowed("set_desktop_background")) {
!Services.policies.isAllowed("setDesktopBackground")) {
return;
}

Просмотреть файл

@ -6,6 +6,7 @@
###############################################################################
[DEFAULT]
prefs = browser.cache.offline.insecure.enable=true
support-files =
POSTSearchEngine.xml
alltabslistener.html
@ -52,8 +53,6 @@ support-files =
head.js
moz.png
navigating_window_with_download.html
offlineQuotaNotification.cacheManifest
offlineQuotaNotification.html
page_style_sample.html
pinning_headers.sjs
ssl_error_reports.sjs
@ -366,6 +365,7 @@ subsuite = clipboard
[browser_new_http_window_opened_from_file_tab.js]
# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
[browser_offlineQuotaNotification.js]
support-files = offlineQuotaNotification.cacheManifest offlineQuotaNotification.html
skip-if = os == "linux" && !debug # bug 1304273
# DO NOT ADD MORE TESTS HERE. USE A TOPICAL DIRECTORY INSTEAD.
[browser_feed_discovery.js]

Просмотреть файл

@ -23,5 +23,3 @@ support-files =
[test_bug364677.html]
[test_bug395533.html]
[test_offlineNotification.html]
skip-if = e10s # Bug 1257785

Просмотреть файл

@ -1,121 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=462856
-->
<head>
<title>Test offline app notification</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="offlineByDefault.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display">
<!-- Load the test frame twice from the same domain,
to make sure we get notifications for both -->
<iframe name="testFrame" src="offlineChild.html"></iframe>
<iframe name="testFrame2" src="offlineChild2.html"></iframe>
<!-- Load from another domain to make sure we get a second allow/deny
notification -->
<iframe name="testFrame3" src="http://example.com/tests/browser/base/content/test/general/offlineChild.html"></iframe>
<iframe id="eventsTestFrame" src="offlineEvent.html"></iframe>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
/* import-globals-from offlineByDefault.js */
SimpleTest.waitForExplicitFinish();
const Cc = SpecialPowers.Cc;
var numFinished = 0;
window.addEventListener("message", function(event) {
is(event.data, "success", "Child was successfully cached.");
if (++numFinished == 3) {
// Clean up after ourself
var uri1 = SpecialPowers.Services.io.newURI(frames.testFrame.location);
var uri2 = SpecialPowers.Services.io.newURI(frames.testFrame3.location);
var principal1 = SpecialPowers.Services.scriptSecurityManager.createCodebasePrincipal(uri1, {});
var principal2 = SpecialPowers.Services.scriptSecurityManager.createCodebasePrincipal(uri2, {});
SpecialPowers.Services.perms.removeFromPrincipal(principal1, "offline-app");
SpecialPowers.Services.perms.removeFromPrincipal(principal2, "offline-app");
offlineByDefault.reset();
SimpleTest.finish();
}
});
var count = 0;
var expectedEvent = "";
function eventHandler(evt) {
++count;
is(evt.type, expectedEvent, "Wrong event!");
}
function testEventHandling() {
var events = [ "checking",
"error",
"noupdate",
"downloading",
"progress",
"updateready",
"cached",
"obsolete"];
var w = document.getElementById("eventsTestFrame").contentWindow;
var e;
for (var i = 0; i < events.length; ++i) {
count = 0;
expectedEvent = events[i];
e = w.document.createEvent("event");
e.initEvent(expectedEvent, true, true);
w.applicationCache["on" + expectedEvent] = eventHandler;
w.applicationCache.addEventListener(expectedEvent, eventHandler, true);
w.applicationCache.dispatchEvent(e);
is(count, 2, "Wrong number events!");
w.applicationCache["on" + expectedEvent] = null;
w.applicationCache.removeEventListener(expectedEvent, eventHandler, true);
w.applicationCache.dispatchEvent(e);
is(count, 2, "Wrong number events!");
}
// Test some random event.
count = 0;
expectedEvent = "foo";
e = w.document.createEvent("event");
e.initEvent(expectedEvent, true, true);
w.applicationCache.addEventListener(expectedEvent, eventHandler, true);
w.applicationCache.dispatchEvent(e);
is(count, 1, "Wrong number events!");
w.applicationCache.removeEventListener(expectedEvent, eventHandler, true);
w.applicationCache.dispatchEvent(e);
is(count, 1, "Wrong number events!");
}
function loaded() {
testEventHandling();
// Click the notification panel's "Allow" button. This should kick
// off updates, which will eventually lead to getting messages from
// the children.
var win = SpecialPowers.Services.wm.getMostRecentWindow("navigator:browser");
var panel = win.PopupNotifications.panel;
is(panel.childElementCount, 2, "2 notifications being displayed");
panel.firstElementChild.button.click();
// should have dismissed one of the notifications.
is(panel.childElementCount, 1, "1 notification now being displayed");
panel.firstElementChild.button.click();
}
SimpleTest.waitForFocus(loaded);
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -79,7 +79,15 @@ this.Policies = {
"block_set_desktop_background": {
onBeforeUIStartup(manager, param) {
if (param == true) {
manager.disallowFeature("set_desktop_background", true);
manager.disallowFeature("setDesktopBackground", true);
}
}
},
"DisableFirefoxScreenshots": {
onBeforeAddons(manager, param) {
if (param == true) {
setAndLockPref("extensions.screenshots.disabled", true);
}
}
},

Просмотреть файл

@ -34,6 +34,14 @@
"enum": [true]
},
"DisableFirefoxScreenshots": {
"description": "Prevents usage of the Firefox Screenshots feature.",
"first_available": "60.0",
"type": "boolean",
"enum": [true]
},
"dont_check_default_browser": {
"description": "Don't check for the default browser on startup.",
"first_available": "60.0",

Просмотреть файл

@ -11,7 +11,9 @@ support-files =
[browser_policies_setAndLockPref_API.js]
[browser_policies_simple_policies.js]
[browser_policies_validate_and_parse_API.js]
[browser_policy_default_browser_check.js]
[browser_policy_display_menu.js]
[browser_policy_display_bookmarks.js]
[browser_policy_block_set_desktop_background.js]
[browser_policy_default_browser_check.js]
[browser_policy_disable_fxscreenshots.js]
[browser_policy_display_bookmarks.js]
[browser_policy_display_menu.js]

Просмотреть файл

@ -0,0 +1,41 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const PREF_DISABLE_FX_SCREENSHOTS = "extensions.screenshots.disabled";
async function checkScreenshots(shouldBeEnabled) {
return BrowserTestUtils.waitForCondition(() => {
return !!PageActions.actionForID("screenshots") == shouldBeEnabled;
}, "Expecting screenshots to be " + shouldBeEnabled);
}
add_task(async function test_disable_firefox_screenshots() {
await BrowserTestUtils.withNewTab("data:text/html,Test", async function() {
await setupPolicyEngineWithJson("");
is(Services.policies.status, Services.policies.INACTIVE, "Start with no policies");
// Firefox Screenshots are disabled in tests, so make sure we enable
// it first to ensure that the test is valid.
Services.prefs.setBoolPref(PREF_DISABLE_FX_SCREENSHOTS, false);
await checkScreenshots(true);
await setupPolicyEngineWithJson({
"policies": {
"DisableFirefoxScreenshots": true
}
});
is(Services.policies.status, Services.policies.ACTIVE, "Policy engine is active");
await checkScreenshots(false);
// Clear the change we made and make sure it remains disabled.
await setupPolicyEngineWithJson("");
Services.prefs.unlockPref(PREF_DISABLE_FX_SCREENSHOTS);
Services.prefs.clearUserPref(PREF_DISABLE_FX_SCREENSHOTS);
await checkScreenshots(false);
});
});

Просмотреть файл

@ -36,8 +36,6 @@
using namespace mozilla;
static bool gCodeBasePrincipalSupport = false;
static bool URIIsImmutable(nsIURI* aURI)
{
nsCOMPtr<nsIMutable> mutableObj(do_QueryInterface(aURI));
@ -63,15 +61,6 @@ NS_IMPL_CI_INTERFACE_GETTER(ContentPrincipal,
nsIPrincipal,
nsISerializable)
// Called at startup:
/* static */ void
ContentPrincipal::InitializeStatics()
{
Preferences::AddBoolVarCache(&gCodeBasePrincipalSupport,
"signed.applets.codebase_principal_support",
false);
}
ContentPrincipal::ContentPrincipal()
: BasePrincipal(eCodebasePrincipal)
, mCodebaseImmutable(false)

Просмотреть файл

@ -40,11 +40,6 @@ public:
virtual nsresult GetScriptLocation(nsACString& aStr) override;
/**
* Called at startup to setup static data, e.g. about:config pref-observers.
*/
static void InitializeStatics();
static nsresult
GenerateOriginNoSuffixFromURI(nsIURI* aURI, nsACString& aOrigin);

Просмотреть файл

@ -22,6 +22,7 @@ support-files =
browser_cmd_appcache_invalid_page3.html
browser_cmd_appcache_invalid_page3.html^headers^
[browser_cmd_appcache_valid.js]
skip-if = !e10s
support-files =
browser_cmd_appcache_valid_appcache.appcache
browser_cmd_appcache_valid_appcache.appcache^headers^

Просмотреть файл

@ -1,10 +1,11 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests that the appcache validate works as they should with an invalid
// manifest.
const TEST_URI = "http://sub1.test1.example.com/browser/devtools/client/commandline/" +
const TEST_URI = "https://sub1.test1.example.com/browser/devtools/client/commandline/" +
"test/browser_cmd_appcache_invalid_index.html";
function test() {
@ -36,26 +37,26 @@ function* spawnTest() {
"test.png points to a resource that is not available at line 25.",
"/main/features.js points to a resource that is not available at line 27.",
"/main/settings/index.css points to a resource that is not available at line 28.",
"http://example.com/scene.jpg points to a resource that is not available at line 29.",
"https://example.com/scene.jpg points to a resource that is not available at line 29.",
"/section1/blockedbyfallback.html points to a resource that is not available at line 30.",
"http://example.com/images/world.jpg points to a resource that is not available at line 31.",
"https://example.com/images/world.jpg points to a resource that is not available at line 31.",
"/section2/blockedbyfallback.html points to a resource that is not available at line 32.",
"/main/home points to a resource that is not available at line 34.",
"main/app.js points to a resource that is not available at line 35.",
"/settings/home points to a resource that is not available at line 37.",
"/settings/app.js points to a resource that is not available at line 38.",
"The file http://sub1.test1.example.com/browser/devtools/client/" +
"The file https://sub1.test1.example.com/browser/devtools/client/" +
"commandline/test/browser_cmd_appcache_invalid_page3.html was modified " +
"after http://sub1.test1.example.com/browser/devtools/client/" +
"after https://sub1.test1.example.com/browser/devtools/client/" +
"commandline/test/browser_cmd_appcache_invalid_appcache.appcache. Unless " +
"the text in the manifest file is changed the cached version will be used " +
"instead at line 39.",
"browser_cmd_appcache_invalid_page3.html has cache-control set to no-store. " +
"This will prevent the application cache from storing the file at line 39.",
"http://example.com/logo.png points to a resource that is not available at line 40.",
"http://example.com/check.png points to a resource that is not available at line 41.",
"https://example.com/logo.png points to a resource that is not available at line 40.",
"https://example.com/check.png points to a resource that is not available at line 41.",
"Spaces in URIs need to be replaced with %20 at line 42.",
"http://example.com/cr oss.png points to a resource that is not available at line 42.",
"https://example.com/cr oss.png points to a resource that is not available at line 42.",
"Asterisk (*) incorrectly used in the CACHE section at line 43. If a line " +
"in the NETWORK section contains only a single asterisk character, then " +
"any URI not listed in the manifest will be treated as if the URI was " +

Просмотреть файл

@ -26,9 +26,9 @@ test.png
browser_cmd_appcache_invalid_index.html
/main/features.js
/main/settings/index.css
http://example.com/scene.jpg
https://example.com/scene.jpg
/section1/blockedbyfallback.html
http://example.com/images/world.jpg
https://example.com/images/world.jpg
/section2/blockedbyfallback.html
browser_cmd_appcache_invalid_page1.html
/main/home
@ -37,9 +37,9 @@ browser_cmd_appcache_invalid_page2.html
/settings/home
/settings/app.js
browser_cmd_appcache_invalid_page3.html
http://example.com/logo.png
http://example.com/check.png
http://example.com/cr oss.png
https://example.com/logo.png
https://example.com/check.png
https://example.com/cr oss.png
/checking*.png
SETTINGS:

Просмотреть файл

@ -1,9 +1,10 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests that the appcache commands works as they should
const TEST_URI = "http://sub1.test2.example.com/browser/devtools/client/" +
const TEST_URI = "https://sub1.test2.example.com/browser/devtools/client/" +
"commandline/test/browser_cmd_appcache_valid_index.html";
function test() {
@ -110,7 +111,7 @@ function* spawnTest() {
setup: "appcache validate " + TEST_URI,
check: {
input: "appcache validate " + TEST_URI,
// appcache validate http://sub1.test2.example.com/browser/devtools/client/commandline/test/browser_cmd_appcache_valid_index.html
// appcache validate https://sub1.test2.example.com/browser/devtools/client/commandline/test/browser_cmd_appcache_valid_index.html
markup: "VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",
status: "VALID",
args: {
@ -160,7 +161,7 @@ function* spawnTest() {
setup: "appcache viewentry --key " + TEST_URI,
check: {
input: "appcache viewentry --key " + TEST_URI,
// appcache viewentry --key http://sub1.test2.example.com/browser/devtools/client/commandline/test/browser_cmd_appcache_valid_index.html
// appcache viewentry --key https://sub1.test2.example.com/browser/devtools/client/commandline/test/browser_cmd_appcache_valid_index.html
markup: "VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",
status: "VALID",
args: {}

Просмотреть файл

@ -32,6 +32,7 @@ DEPRECATED_OPERATION(NavigatorGetUserMedia)
DEPRECATED_OPERATION(WebrtcDeprecatedPrefix)
DEPRECATED_OPERATION(RTCPeerConnectionGetStreams)
DEPRECATED_OPERATION(AppCache)
DEPRECATED_OPERATION(AppCacheInsecure)
DEPRECATED_OPERATION(PrefixedImageSmoothingEnabled)
DEPRECATED_OPERATION(PrefixedFullscreenAPI)
DEPRECATED_OPERATION(LenientSetter)

Просмотреть файл

@ -2973,6 +2973,13 @@ nsGlobalWindowInner::IsPrivilegedChromeWindow(JSContext* aCx, JSObject* aObj)
nsContentUtils::ObjectPrincipal(aObj) == nsContentUtils::GetSystemPrincipal();
}
/* static */ bool
nsGlobalWindowInner::OfflineCacheAllowedForContext(JSContext* aCx, JSObject* aObj)
{
return IsSecureContextOrObjectIsFromSecureContext(aCx, aObj) ||
Preferences::GetBool("browser.cache.offline.insecure.enable");
}
/* static */ bool
nsGlobalWindowInner::IsRequestIdleCallbackEnabled(JSContext* aCx, JSObject* aObj)
{

Просмотреть файл

@ -399,6 +399,8 @@ public:
static bool IsPrivilegedChromeWindow(JSContext* /* unused */, JSObject* aObj);
static bool OfflineCacheAllowedForContext(JSContext* /* unused */, JSObject* aObj);
static bool IsRequestIdleCallbackEnabled(JSContext* aCx, JSObject* /* unused */);
static bool IsWindowPrintEnabled(JSContext* /* unused */, JSObject* /* unused */);

Просмотреть файл

@ -307,7 +307,6 @@ const char* mozilla::dom::ContentPrefs::gEarlyPrefs[] = {
"security.sandbox.logging.enabled",
"security.sandbox.mac.track.violations",
"security.sandbox.windows.log.stackTraceDepth",
"signed.applets.codebase_principal_support",
"svg.disabled",
"svg.display-lists.hit-testing.enabled",
"svg.display-lists.painting.enabled",

Просмотреть файл

@ -187,6 +187,8 @@ HittingMaxWorkersPerDomain2=A Worker could not be started immediately because ot
PannerNodeDopplerWarning=Use of setVelocity on the PannerNode and AudioListener, and speedOfSound and dopplerFactor on the AudioListener are deprecated and those members will be removed. For more help https://developer.mozilla.org/en-US/docs/Web/API/AudioListener#Deprecated_features
# LOCALIZATION NOTE: Do not translate "Application Cache API", "AppCache" and "ServiceWorker".
AppCacheWarning=The Application Cache API (AppCache) is deprecated and will be removed at a future date. Please consider using ServiceWorker for offline support.
# LOCALIZATION NOTE: Do not translate "Application Cache API", "AppCache".
AppCacheInsecureWarning=Use of the Application Cache API (AppCache) for insecure connections will be removed in version 62.
# LOCALIZATION NOTE: Do not translate "Worker".
EmptyWorkerSourceWarning=Attempting to create a Worker from an empty source. This is probably unintentional.
WebrtcDeprecatedPrefixWarning=WebRTC interfaces with the “moz” prefix (mozRTCPeerConnection, mozRTCSessionDescription, mozRTCIceCandidate) have been deprecated.

Просмотреть файл

@ -0,0 +1,9 @@
"use strict";
module.exports = {
"globals": {
"SimpleTest": true,
"OfflineTest": true,
"SpecialPowers": true,
}
};

Просмотреть файл

@ -1,6 +1,6 @@
CACHE MANIFEST
http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
https://example.com/tests/SimpleTest/SimpleTest.js
https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
test_bug445544.html
445544_part1.html

Просмотреть файл

@ -1,7 +1,7 @@
CACHE MANIFEST
http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
https://example.com/tests/SimpleTest/SimpleTest.js
https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
# more than 15 what is a number of parallel loads
subresource744719.html?001

Просмотреть файл

@ -1,7 +1,7 @@
CACHE MANIFEST
http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
https://example.com/tests/SimpleTest/SimpleTest.js
https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
# more than 15 what is a number of parallel loads
subresource744719.html?001

Просмотреть файл

@ -1,3 +1,3 @@
# This doesn't start with the magic cache manifest line.
http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
https://example.com/tests/SimpleTest/SimpleTest.js
https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js

Просмотреть файл

@ -0,0 +1,8 @@
[DEFAULT]
support-files =
file_simpleManifest.html
file_testFile.sjs
file_simpleManifest.cacheManifest
[browser_disableAppcache.js]
skip-if = !e10s || (toolkit == 'android') || debug # Slow

Просмотреть файл

@ -0,0 +1,134 @@
const PATH =
"http://example.com/browser/dom/tests/mochitest/ajax/offline/";
const URL = PATH + "file_simpleManifest.html";
const MANIFEST = PATH + "file_simpleManifest.cacheManifest";
const PREF_INSECURE_APPCACHE = "browser.cache.offline.insecure.enable";
const PREF_NETWORK_PROXY = "network.proxy.type";
function setSJSState(sjsPath, stateQuery) {
let client = new XMLHttpRequest();
client.open("GET", sjsPath + "?state=" + stateQuery, false);
let appcachechannel = SpecialPowers.wrap(client).channel.QueryInterface(Ci.nsIApplicationCacheChannel);
return new Promise((resolve, reject) => {
client.addEventListener("load", resolve);
client.addEventListener("error", reject);
appcachechannel.chooseApplicationCache = false;
appcachechannel.inheritApplicationCache = false;
appcachechannel.applicationCache = null;
client.send();
});
}
add_task(async function() {
/* This test loads "evil" content and verified it isn't loaded when appcache is disabled, which emulates loading stale cache from an untrusted network:
- Sets frame to load "evil" content
- Loads HTML file which also loads and caches content into AppCache
- Sets frame to load "good"
- Check we still have "evil" content from AppCache
- Disables appcache
- Check content is "good"
*/
await SpecialPowers.pushPrefEnv({
set: [
[PREF_INSECURE_APPCACHE, true]
]
});
await setSJSState(PATH + "file_testFile.sjs", "evil");
await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
await ContentTask.spawn(gBrowser.selectedBrowser, null, async () => {
let windowPromise = new Promise((resolve, reject) => {
function init() {
if (content.document.readyState == "complete") {
const frame = content.document.getElementById("childframe");
const state = frame.contentDocument.getElementById("state");
is(state.textContent, "evil", "Loaded evil content");
resolve();
}
}
content.document.onreadystatechange = init;
init();
});
let appcachePromise = new Promise((resolve, reject) => {
function appcacheInit() {
if (content.applicationCache.status === content.applicationCache.IDLE) {
ok(true, "Application cache loaded");
resolve();
} else {
info("State was: " + content.applicationCache.status);
}
}
content.applicationCache.oncached = appcacheInit;
content.applicationCache.onnoupdate = appcacheInit;
content.applicationCache.onerror = () => {
ok(false, "Application cache failed");
reject();
};
appcacheInit();
});
await Promise.all([windowPromise, appcachePromise]);
});
gBrowser.removeCurrentTab();
// Turn network and proxy off so we can check the content loads still
await setSJSState(PATH + "file_testFile.sjs", "good");
Services.cache2.clear();
// Check we still have the "evil" content despite the state change
await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
await ContentTask.spawn(gBrowser.selectedBrowser, null, async () => {
const frame = content.document.getElementById("childframe");
const state = frame.contentDocument.getElementById("state");
is(state.textContent, "evil", "Loaded evil content from cache");
});
gBrowser.removeCurrentTab();
await SpecialPowers.pushPrefEnv({
set: [
[PREF_INSECURE_APPCACHE, false]
]
});
await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
// Check that the "good" content is back now appcache is disabled
await ContentTask.spawn(gBrowser.selectedBrowser, [URL], async (URL) => {
const frame = content.document.getElementById("childframe");
const state = frame.contentDocument.getElementById("state");
is(state.textContent, "good", "Loaded good content");
// Eval is needed to execure in child context.
content.window.eval("OfflineTest.clear()");
});
gBrowser.removeCurrentTab();
await setSJSState(PATH + "file_testFile.sjs", "");
await SpecialPowers.popPrefEnv();
});
add_task(async function test_pref_removes_api() {
await SpecialPowers.pushPrefEnv({
set: [
[PREF_INSECURE_APPCACHE, true]
]
});
await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
await ContentTask.spawn(gBrowser.selectedBrowser, null, async () => {
// Have to use in page checking as IsSecureContextOrObjectIsFromSecureContext is true for spawn()
is(content.document.getElementById("hasAppcache").textContent, "yes", "Appcache is enabled");
});
gBrowser.removeCurrentTab();
await SpecialPowers.pushPrefEnv({
set: [
[PREF_INSECURE_APPCACHE, false]
]
});
await BrowserTestUtils.openNewForegroundTab(gBrowser, URL);
await ContentTask.spawn(gBrowser.selectedBrowser, [URL], async (URL) => {
is(content.document.getElementById("hasAppcache").textContent, "no", "Appcache is disabled");
content.window.eval("OfflineTest.clear()");
});
gBrowser.removeCurrentTab();
});

Просмотреть файл

@ -14,7 +14,7 @@ function handleRequest(request, response)
{
case "": // The default value
response.setStatusLine(request.httpVersion, 307, "Moved temporarly");
response.setHeader("Location", "http://example.com/non-existing-dynamic.html");
response.setHeader("Location", "https://example.org/non-existing-dynamic.html");
response.setHeader("Content-Type", "text/html");
break;
case "on":

Просмотреть файл

@ -14,7 +14,7 @@ function handleRequest(request, response)
{
case "": // The default value
response.setStatusLine(request.httpVersion, 307, "Moved temporarly");
response.setHeader("Location", "http://example.com/non-existing-explicit.html");
response.setHeader("Location", "https://example.com/non-existing-explicit.html");
response.setHeader("Content-Type", "text/html");
break;
case "on":

Просмотреть файл

@ -1,6 +1,6 @@
CACHE MANIFEST
http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
https://example.com/tests/SimpleTest/SimpleTest.js
https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
FALLBACK:
namespace1/ fallback.html

Просмотреть файл

@ -0,0 +1,5 @@
CACHE MANIFEST
http://example.com/browser/dom/tests/mochitest/ajax/offline/file_testFile.sjs
http://example.com/browser/dom/tests/mochitest/ajax/offline/file_simpleManifest.html
http://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js

Просмотреть файл

@ -0,0 +1,20 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://example.com/browser/dom/tests/mochitest/ajax/offline/file_simpleManifest.cacheManifest">
<head>
<title>load manifest test</title>
<script type="text/javascript">
window.addEventListener("load", () => {
const hasAppcache = document.getElementById("hasAppcache");
hasAppcache.textContent = "applicationCache" in window ? "yes" : "no";
});
</script>
<script type="text/javascript" src="http://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js"></script>
</head>
<body>
Offline testing<br />
We have AppCache: <span id="hasAppcache"></span><br />
<iframe id="childframe" src="http://example.com/browser/dom/tests/mochitest/ajax/offline/file_testFile.sjs" ></iframe>
</body>
</html>

Просмотреть файл

@ -0,0 +1,25 @@
function handleRequest(request, response) {
var match = request.queryString.match(/^state=(.*)$/);
if (match) {
response.setStatusLine(request.httpVersion, 204, "No content");
setState("version", match[1]);
return;
}
const state = getState("version");
let color = "green";
if (state === "evil") {
color = "red";
}
const frameContent = `
<!DOCTYPE html>
<html>
<head>
<style>body,html {background: ${color};}</style>
</head>
<body>
<h1>Offline file: <span id="state">${state}</span></h1>
`;
response.setHeader("Content-Type", "text/html");
response.setHeader("Cache-Control", "no-cache");
response.write(frameContent);
}

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/foreign2.cacheManifest">
<head>
<title>Foreign page 2</title>
@ -14,13 +14,13 @@ function manifestUpdated()
.getService(SpecialPowers.Ci.nsIApplicationCacheService);
var foreign2cache = appCacheService.chooseApplicationCache(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html", OfflineTest.loadContextInfo());
"https://example.com/tests/dom/tests/mochitest/ajax/offline/foreign2.html", OfflineTest.loadContextInfo());
window.opener.OfflineTest.ok(foreign2cache, "Foreign 2 cache present, chosen for foreign2.html");
window.opener.OfflineTest.is(foreign2cache.manifestURI.asciiSpec, "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.cacheManifest")
window.opener.OfflineTest.is(foreign2cache.manifestURI.asciiSpec, "https://example.com/tests/dom/tests/mochitest/ajax/offline/foreign2.cacheManifest");
var foreign1cache = OfflineTest.getActiveCache(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest");
"https://example.com/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest");
window.opener.OfflineTest.ok(foreign1cache, "Foreign 1 cache loaded");
foreign1cache.discard();
@ -33,15 +33,15 @@ function onLoaded()
.getService(SpecialPowers.Ci.nsIApplicationCacheService);
var foreign1cache = window.opener.OfflineTest.getActiveCache(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest");
"https://example.com/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest");
window.opener.OfflineTest.ok(foreign1cache, "Foreign 1 cache loaded");
var foreign2cache = window.opener.OfflineTest.getActiveCache(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.cacheManifest");
"https://example.com/tests/dom/tests/mochitest/ajax/offline/foreign2.cacheManifest");
window.opener.OfflineTest.ok(!foreign2cache, "Foreign 2 cache not present");
foreign1cache = appCacheService.chooseApplicationCache(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html", window.opener.OfflineTest.loadContextInfo());
"https://example.com/tests/dom/tests/mochitest/ajax/offline/foreign2.html", window.opener.OfflineTest.loadContextInfo());
window.opener.OfflineTest.ok(!foreign1cache, "foreign2.html not chosen from foreign1 cache");
try

Просмотреть файл

@ -1,6 +1,6 @@
function handleRequest(request, response)
{
response.setStatusLine(request.httpVersion, 307, "Moved temporarly");
response.setHeader("Location", "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updating.cacheManifest");
response.setHeader("Location", "https://example.com/tests/dom/tests/mochitest/ajax/offline/updating.cacheManifest");
response.setHeader("Content-Type", "text/cache-manifest");
}

Просмотреть файл

@ -1,6 +1,6 @@
CACHE MANIFEST
http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
https://example.com/tests/SimpleTest/SimpleTest.js
https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
# The following item doesn't exist, and will cause an update error.
http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/doesntExist.html
https://example.com/tests/dom/tests/mochitest/ajax/offline/doesntExist.html

Просмотреть файл

@ -1,4 +1,5 @@
[DEFAULT]
scheme = https
skip-if = toolkit == 'android' || e10s #SLOW_DIRECTORY
support-files =
445544.cacheManifest

Просмотреть файл

@ -1,6 +1,6 @@
function handleRequest(request, response)
{
response.setStatusLine(request.httpVersion, 307, "Moved temporarly");
response.setHeader("Location", "http://example.org/tests/dom/tests/mochitest/ajax/offline/fallback2.html");
response.setHeader("Location", "https://example.org/tests/dom/tests/mochitest/ajax/offline/fallback2.html");
response.setHeader("Content-Type", "text/html");
}

Просмотреть файл

@ -48,7 +48,7 @@ applicationCache.oncached = function() {
// Make the obsoleting.sjs return 404 NOT FOUND code
var req = new XMLHttpRequest();
req.open("GET", "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state=");
req.open("GET", "https://example.com/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state=");
var channel = SpecialPowers.wrap(req).channel
.QueryInterface(SpecialPowers.Ci.nsIApplicationCacheChannel);
channel.chooseApplicationCache = false;

Просмотреть файл

@ -323,8 +323,16 @@ getActiveCache: function(overload)
// one associated with this window.
var serv = Cc["@mozilla.org/network/application-cache-service;1"]
.getService(Ci.nsIApplicationCacheService);
var groupID = serv.buildGroupIDForInfo(this.manifestURL(overload), this.loadContextInfo());
return serv.getActiveCache(groupID);
var cache;
// Sometimes this throws a NS_ERROR_UNEXPECTED when cache isn't init
try {
cache = serv.getActiveCache(groupID);
} catch (e) {
cache = false;
}
return cache;
},
getActiveStorage: function()

Просмотреть файл

@ -1,8 +1,8 @@
CACHE MANIFEST
CACHE:
http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
https://example.com/tests/SimpleTest/SimpleTest.js
https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
NETWORK:
bogus/specific/

Просмотреть файл

@ -2,25 +2,25 @@ ver1manifest =
"CACHE MANIFEST\n" +
"# v1\n" +
"\n" +
"http://mochi.test:8888/tests/SimpleTest/SimpleTest.js\n" +
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs";
"https://example.com/tests/SimpleTest/SimpleTest.js\n" +
"https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
"https://example.com/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs";
ver2manifest =
"CACHE MANIFEST\n" +
"# v2\n" +
"\n" +
"http://mochi.test:8888/tests/SimpleTest/SimpleTest.js\n" +
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs";
"https://example.com/tests/SimpleTest/SimpleTest.js\n" +
"https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
"https://example.com/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs";
ver3manifest =
"CACHE MANIFEST\n" +
"# v3\n" +
"\n" +
"http://mochi.test:8888/tests/SimpleTest/SimpleTest.js\n" +
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs";
"https://example.com/tests/SimpleTest/SimpleTest.js\n" +
"https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
"https://example.com/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs";
function handleRequest(request, response)
{

Просмотреть файл

@ -1,6 +1,6 @@
CACHE MANIFEST
http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
https://example.com/tests/SimpleTest/SimpleTest.js
https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
# The following item is not a valid URI and will be ignored
bad:/uri/invalid

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/badManifestMagic.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/badManifestMagic.cacheManifest">
<head>
<title>bad manifest magic</title>
@ -21,8 +21,8 @@ function handleError() {
// These items are listed in the manifest, but the error should have
// prevented them from being committed to the cache.
var entries = [
["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", false],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false]
["https://example.com/tests/SimpleTest/SimpleTest.js", false],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false]
];
OfflineTest.checkCacheEntries(entries, finishTest);
}

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<head>
<title>Bug 460353</title>
@ -73,8 +73,8 @@ function finish()
SimpleTest.is(result["noman"].cacheStatus || -1, -1, "Frame with no manifest cache status was undefined");
OfflineTest.waitForUpdates(function() {
cleanCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest");
cleanCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs");
cleanCache("https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest");
cleanCache("https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs");
SimpleTest.finish();
});

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback.cacheManifest">
<head>
<title>Fallback on different origin redirect test</title>
@ -7,9 +7,11 @@
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script class="testbody" type="text/javascript">
/* globals fallbackFrame */
function manifestUpdated()
{
fallbackFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/redirectToDifferentOrigin.sjs";
fallbackFrame.location = "https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/redirectToDifferentOrigin.sjs";
// Invokes load of fallback.html
}

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/wildcardManifest.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/wildcardManifest.cacheManifest">
<head>
<title>wildcard in network section test</title>
@ -47,7 +47,7 @@ SimpleTest.waitForExplicitFinish();
</head>
<body>
<img src="http://example.com/tests/dom/tests/mochitest/ajax/offline/jupiter.jpg" onload="imageOnLoad(1)" />
<img src="https://example.org/tests/dom/tests/mochitest/ajax/offline/jupiter.jpg" onload="imageOnLoad(1)" />
<img src="jupiter.jpg" onload="imageOnLoad(2)" />
</body>
</html>

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/744719-cancel.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/744719-cancel.cacheManifest">
<head>
<title>parallel load canceled</title>
@ -21,13 +21,13 @@ if (SpecialPowers.isMainProcess()) {
function updateCanceled()
{
OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/744719-cancel.cacheManifest", false, null);
OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", false, null);
OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false, null);
OfflineTest.checkCache("https://example.com/tests/dom/tests/mochitest/ajax/offline/744719-cancel.cacheManifest", false, null);
OfflineTest.checkCache("https://example.com/tests/SimpleTest/SimpleTest.js", false, null);
OfflineTest.checkCache("https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false, null);
OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/nonexistent744719?010", false, null);
OfflineTest.checkCache("https://example.com/tests/dom/tests/mochitest/ajax/offline/nonexistent744719?010", false, null);
var URL = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/subresource744719.html?";
var URL = "https://example.com/tests/dom/tests/mochitest/ajax/offline/subresource744719.html?";
OfflineTest.checkCache(URL + "001", false, null);
OfflineTest.checkCache(URL + "002", false, null);
OfflineTest.checkCache(URL + "003", false, null);

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/744719.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="/tests/dom/tests/mochitest/ajax/offline/744719.cacheManifest">
<head>
<title>parallel load</title>
@ -20,11 +20,12 @@ if (SpecialPowers.isMainProcess()) {
function manifestUpdated()
{
OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/744719.cacheManifest", true);
OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", true);
OfflineTest.checkCache("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
ok(window.location.href, "my loc" + window.location.href);
OfflineTest.checkCache("https://example.com/tests/dom/tests/mochitest/ajax/offline/744719.cacheManifest", true);
OfflineTest.checkCache("https://example.com/tests/SimpleTest/SimpleTest.js", true);
OfflineTest.checkCache("https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true);
var URL = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/subresource744719.html?";
var URL = "https://example.com/tests/dom/tests/mochitest/ajax/offline/subresource744719.html?";
OfflineTest.checkCache(URL + "001", true);
OfflineTest.checkCache(URL + "002", true);
OfflineTest.checkCache(URL + "003", true);

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/unknownSection.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/unknownSection.cacheManifest">
<head>
<title>unknown section</title>
@ -20,17 +20,17 @@ function manifestUpdated()
var entries = [
// The manifest itself should be in the cache
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/unknownSection.cacheManifest", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/unknownSection.cacheManifest", true],
// The document that requested the manifest should be in the cache
[window.location.href, true],
// The entries from the manifest should be in the cache
["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", true],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true],
["https://example.com/tests/SimpleTest/SimpleTest.js", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true],
// The bad entries from the manifest should not be in the cache
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/jupiter.jpg", false]
["https://example.com/tests/dom/tests/mochitest/ajax/offline/jupiter.jpg", false]
];
OfflineTest.checkCacheEntries(
entries,

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<head>
<title>Cancel offline cache</title>
@ -8,7 +8,7 @@
<script type="text/javascript">
var manifest = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest";
var manifest = "https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest";
var manifestURI = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService)
.newURI(manifest);

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/changingManifest.sjs">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/changingManifest.sjs">
<head>
<title>changing manifest test</title>
@ -11,8 +11,8 @@
var gGotChecking = false;
var gGotDownloading = false;
var g1SecUrl = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/changing1Sec.sjs";
var g1HourUrl = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/changing1Hour.sjs";
var g1SecUrl = "https://example.com/tests/dom/tests/mochitest/ajax/offline/changing1Sec.sjs";
var g1HourUrl = "https://example.com/tests/dom/tests/mochitest/ajax/offline/changing1Hour.sjs";
var gCacheContents = null;

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback.cacheManifest">
<head>
<title>Fallback entry test</title>
@ -7,6 +7,7 @@
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script class="testbody" type="text/javascript">
/* globals fallbackFrame */
/**
* This tests that we fall back to the correct fallback entries when loading
@ -22,7 +23,7 @@ var gTopWindow = null;
function manifestUpdated()
{
fallbackFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html";
fallbackFrame.location = "https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html";
// Invokes load of fallback.html
}
@ -37,7 +38,7 @@ function onFallbackLoad(fallbackIdentification)
case 101:
OfflineTest.is(fallbackIdentification, 1, "fallback for namespace1/ in step " + gStep);
fallbackFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub-non-existing.html";
fallbackFrame.location = "https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/sub-non-existing.html";
// Invokes load of fallback.html
break;
@ -45,7 +46,7 @@ function onFallbackLoad(fallbackIdentification)
case 102:
OfflineTest.is(fallbackIdentification, 1, "fallback for namespace1/, sub namespace in name of the frame in step " + gStep);
fallbackFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/non-existing.html";
fallbackFrame.location = "https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/non-existing.html";
// Invokes load of fallback2.html
break;
@ -53,7 +54,7 @@ function onFallbackLoad(fallbackIdentification)
case 103:
OfflineTest.is(fallbackIdentification, 2, "fallback for namespace1/sub/ in step " + gStep);
fallbackFrame.location = "HTTP://MOCHI.TEST:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/non-existing.html";
fallbackFrame.location = "HTTPS://EXAMPLE.COM/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/non-existing.html";
// Invokes load of fallback2.html
break;
@ -64,7 +65,7 @@ function onFallbackLoad(fallbackIdentification)
// Try opening a non-existing page as a top level document. It must
// fall to fallbackTop.html that identifies it self as '100'.
// Invokes load of fallbackTop.html
gTopWindow = window.open("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace2/non-existing.html");
gTopWindow = window.open("https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace2/non-existing.html");
break;
@ -73,7 +74,7 @@ function onFallbackLoad(fallbackIdentification)
// pages created/leaked. That would prevent fallback load.
gStep = 100;
fallbackFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html";
fallbackFrame.location = "https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html";
// Invokes load of fallback1.html, again, from the start
// no break
case 105:
@ -102,10 +103,10 @@ function finishTest()
function finalize()
{
var entries = [
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub-non-existing.html", false],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/non-existing.html", false],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html", false],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace2/non-existing.html", false]
["https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/sub-non-existing.html", false],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/non-existing.html", false],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/non-existing.html", false],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace2/non-existing.html", false]
];
OfflineTest.checkCacheEntries(entries, finishTest);
}

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest">
<head>
<title>Foreign test</title>
@ -7,6 +7,7 @@
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script class="testbody" type="text/javascript">
/* globals foreign1cache */
/**
* This test loads a manifest that contains as an explicit entry
@ -27,12 +28,12 @@ function manifestUpdated()
.getService(SpecialPowers.Ci.nsIApplicationCacheService);
foreign1cache = appCacheService.chooseApplicationCache(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html", OfflineTest.loadContextInfo());
"https://example.com/tests/dom/tests/mochitest/ajax/offline/foreign2.html", OfflineTest.loadContextInfo());
OfflineTest.ok(foreign1cache, "foreign2.html chosen from foreign1 cache");
OfflineTest.is(foreign1cache.manifestURI.asciiSpec, "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest")
OfflineTest.is(foreign1cache.manifestURI.asciiSpec, "https://example.com/tests/dom/tests/mochitest/ajax/offline/foreign1.cacheManifest");
win = window.open("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/foreign2.html");
win = window.open("https://example.com/tests/dom/tests/mochitest/ajax/offline/foreign2.html");
}
function onDone() // called by the open window after stuff is finished

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<head>
<title>identical manifest test</title>
@ -25,8 +25,8 @@ function noUpdate()
// The document that requested the manifest should be in the cache
[window.location.href, true],
["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", true],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true]
["https://example.com/tests/SimpleTest/SimpleTest.js", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true]
];
OfflineTest.checkCacheEntries(entries, finishTest);
}
@ -38,14 +38,14 @@ function manifestUpdated()
var entries = [
// The manifest itself should be in the cache
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest", true],
// The document that requested the manifest should be in the cache
[window.location.href, true],
// The entries from the manifest should be in the cache
["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", true],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true],
["https://example.com/tests/SimpleTest/SimpleTest.js", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true],
// The bad entries from the manifest should not be in the cache
["bad:/uri/invalid", false]

Просмотреть файл

@ -70,7 +70,7 @@ if (OfflineTest.setup()) {
applicationCacheAvailable: function() {}
});
var manifest = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest";
var manifest = "https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest";
var ioService = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
var manifestURI = ioService.newURI(manifest);

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<head>
<title>Low device storage during update</title>

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/missingFile.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/missingFile.cacheManifest">
<head>
<title>missing manifest file test</title>
@ -23,8 +23,8 @@ function handleError() {
// These items are listed in the manifest, but the error should have
// prevented them from being committed to the cache.
var entries = [
["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", false],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false]
["https://example.com/tests/SimpleTest/SimpleTest.js", false],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", false]
];
OfflineTest.checkCacheEntries(entries, finishTest);
}

Просмотреть файл

@ -14,7 +14,7 @@ SpecialPowers.pushPermissions([{'type': 'offline-app', 'allow': true, 'context':
function startTest() {
// Make the obsoleting.sjs return a valid manifest
var req = new XMLHttpRequest();
req.open("GET", "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state=manifestPresent");
req.open("GET", "https://example.com/tests/dom/tests/mochitest/ajax/offline/obsoletingManifest.sjs?state=manifestPresent");
req.setRequestHeader("Content-Type", "text/cache-manifest");
req.send("");
req.onreadystatechange = function() {

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<head>
<title>offline iframe test</title>
@ -12,11 +12,11 @@
function checkEntries() {
var entries = [
// The manifest itself should be in the cache
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest", true],
// The entries from the manifest should be in the cache
["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", true],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true]
["https://example.com/tests/SimpleTest/SimpleTest.js", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true]
];
OfflineTest.checkCacheEntries(entries, function() { window.frames["offlineChild"].doneLoading(); });
}

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
<head>
<title>Offline mode test</title>
@ -7,6 +7,7 @@
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script class="testbody" type="text/javascript">
/* globals aFrame */
/**
* The test loads a manifest and cache it.
@ -34,27 +35,27 @@ function createURI(urispec)
function manifestUpdated()
{
applicationCache.mozAdd("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html");
OfflineTest.waitForAdd("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html", dynamicAdded);
applicationCache.mozAdd("https://example.com/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html");
OfflineTest.waitForAdd("https://example.com/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html", dynamicAdded);
}
function dynamicAdded()
{
aFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html";
aFrame.location = "https://example.com/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html";
}
// Called by the dynamically added iframe on load
function notwhitelistOnLoad()
{
gGotDynamicVersion = 1;
aFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs";
aFrame.location = "https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs";
}
// Called by the explicit iframe on load
function frameLoad(version)
{
gGotExplicitVersion = version;
gImplicitWindow = window.open("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html");
gImplicitWindow = window.open("https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html");
}
// Called by the implicit window on load
@ -63,7 +64,7 @@ function implicitLoaded(aWindow, errorOccured)
aWindow.close();
gGotImplicitVersion = 1;
OfflineTest.waitForAdd("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", implicitAdded);
OfflineTest.waitForAdd("https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", implicitAdded);
}
function implicitAdded()
@ -89,9 +90,9 @@ function finalize()
gGotDynamicVersion = 0;
var entries = [
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html", true],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs", true],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true]
["https://example.com/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true]
];
OfflineTest.checkCacheEntries(entries, goOffline);
}
@ -122,9 +123,9 @@ function goOffline()
var cache = Cc["@mozilla.org/network/cache-storage-service;1"]
.getService(Ci.nsICacheStorageService);
var storage = cache.diskCacheStorage(LoadContextInfo.default, false);
storage.asyncDoomURI(createURI("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html"), "", null);
storage.asyncDoomURI(createURI("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs"), "", null);
storage.asyncDoomURI(createURI("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html"), "", listener);
storage.asyncDoomURI(createURI("https://example.com/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html"), "", null);
storage.asyncDoomURI(createURI("https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs"), "", null);
storage.asyncDoomURI(createURI("https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html"), "", listener);
}
function goOfflineContinue()
@ -140,7 +141,7 @@ function goOfflineContinue()
// is correct to get error message
applicationCache.onerror = function() {gGotOnError = true;}
aFrame.location = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html";
aFrame.location = "https://example.com/tests/dom/tests/mochitest/ajax/offline/notonwhitelist.html";
// Starts the chain all over again but in offline mode.
}

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/overlap.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/overlap.cacheManifest">
<head>
<title>overlapping namespaces test</title>

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/manifestRedirect.sjs">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/manifestRedirect.sjs">
<head>
<title>Fail update on manifest redirection test</title>

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/redirects.sjs">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/redirects.sjs">
<head>
<title>Entries redirection handling during update test</title>
@ -13,8 +13,8 @@ var gCurrentManifestVersion = 1;
function manifestCached()
{
var entries = [
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs", false],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs", false],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs", true],
];
OfflineTest.checkCacheEntries(entries, manifestCachedContinue);
}
@ -25,25 +25,25 @@ function manifestCachedContinue()
// Now add one dynamic entry (now with content overriden redirect sjs)
applicationCache.mozAdd(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs");
"https://example.com/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs");
// Wait for the dynamic entry be added to the cache...
OfflineTest.waitForAdd(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
function() {
// ...check it is there...
OfflineTest.checkCache(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
true,
function() {
// ...revert state of the dynamic entry on the server, now we get the redirect...
OfflineTest.setSJSState(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
"");
// ...update manifest to the new version on the server...
OfflineTest.setSJSState(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/redirects.sjs",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/redirects.sjs",
"second");
gCurrentManifestVersion = 2;
@ -60,17 +60,17 @@ function manifestUpdated()
case 2:
// Check the dynamic entry was removed from the cache (because of the redirect)...
OfflineTest.checkCache(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
false,
function () {
// ...return back redirect for the explicit entry...
OfflineTest.setSJSState(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs",
"");
// ...update the manifest to the third version...
OfflineTest.setSJSState(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/redirects.sjs",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/redirects.sjs",
"third");
gCurrentManifestVersion = 3;
@ -121,10 +121,10 @@ if (OfflineTest.setup()) {
// Override sjs redirects on the server, it will now return 200 OK and the content
OfflineTest.setSJSState(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/explicitRedirect.sjs",
"on");
OfflineTest.setSJSState(
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/dynamicRedirect.sjs",
"on");
}

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/changingManifest.sjs">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/changingManifest.sjs">
<head>
<title>refetch manifest test</title>

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<head>
<title>simple manifest test</title>
@ -17,18 +17,18 @@ ok(applicationCache.mozItems.length == 0,
function addFinished()
{
OfflineTest.ok(applicationCache.mozLength == 1, "applicationCache should have one dynamic entry (deprecated API)");
OfflineTest.ok(applicationCache.mozItem(0) == "http://mochi.test:8888/tests/SimpleTest/EventUtils.js",
OfflineTest.ok(applicationCache.mozItem(0) == "https://example.com/tests/SimpleTest/EventUtils.js",
"applicationCache's dynamic entry should be the one we expect (deprecated API)");
OfflineTest.ok(applicationCache.mozItems.length == 1, "applicationCache should have one dynamic entry");
OfflineTest.ok(applicationCache.mozItems[0] == "http://mochi.test:8888/tests/SimpleTest/EventUtils.js",
OfflineTest.ok(applicationCache.mozItems[0] == "https://example.com/tests/SimpleTest/EventUtils.js",
"applicationCache's dynamic entry should be the one we expect");
OfflineTest.ok(applicationCache.mozHasItem("http://mochi.test:8888/tests/SimpleTest/EventUtils.js"),
OfflineTest.ok(applicationCache.mozHasItem("https://example.com/tests/SimpleTest/EventUtils.js"),
"applicationCache.mozHasItem() should see the dynamic entry");
// Check that the entry was added successfully
OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/EventUtils.js",
OfflineTest.checkCache("https://example.com/tests/SimpleTest/EventUtils.js",
true,
removeItem);
}
@ -36,16 +36,16 @@ function addFinished()
function removeItem()
{
// Now test that removes work
applicationCache.mozRemove("http://mochi.test:8888/tests/SimpleTest/EventUtils.js");
applicationCache.mozRemove("https://example.com/tests/SimpleTest/EventUtils.js");
OfflineTest.ok(applicationCache.mozLength == 0,
"applicationCache should have no dynamic entries (deprecated API)");
OfflineTest.ok(applicationCache.mozItems.length == 0,
"applicationCache should have no dynamic entries");
OfflineTest.ok(!applicationCache.mozHasItem("http://mochi.test:8888/tests/SimpleTest/EventUtils.js"),
OfflineTest.ok(!applicationCache.mozHasItem("https://example.com/tests/SimpleTest/EventUtils.js"),
"applicationCache.mozHasItem() should not see the removed dynamic entry");
OfflineTest.checkCache("http://mochi.test:8888/tests/SimpleTest/EventUtils.js",
OfflineTest.checkCache("https://example.com/tests/SimpleTest/EventUtils.js",
false,
function() {
// We're done
@ -62,14 +62,14 @@ function manifestUpdated()
var entries = [
// The manifest itself should be in the cache
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest", true],
// The document that requested the manifest should be in the cache
[window.location.href, true],
// The entries from the manifest should be in the cache
["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", true],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true],
["https://example.com/tests/SimpleTest/SimpleTest.js", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true],
// The bad entries from the manifest should not be in the cache
["bad:/uri/invalid", false]
@ -87,10 +87,10 @@ function manifestUpdated()
// XXX: make sure that the previous version went away after the swapCache().
// Now add a file using the applicationCache API
applicationCache.mozAdd("http://mochi.test:8888/tests/SimpleTest/EventUtils.js");
applicationCache.mozAdd("https://example.com/tests/SimpleTest/EventUtils.js");
// Wait for the add() to be downloaded
OfflineTest.waitForAdd("http://mochi.test:8888/tests/SimpleTest/EventUtils.js",
OfflineTest.waitForAdd("https://example.com/tests/SimpleTest/EventUtils.js",
OfflineTest.priv(addFinished));
});
}

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
<head>
<title>Cache update test</title>
@ -22,7 +22,7 @@
SimpleTest.waitForExplicitFinish();
var manifest = "http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs";
var manifest = "https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs";
var manifestURI = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService)
.newURI(manifest);

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
<head>
<title>Cache update test</title>
@ -113,7 +113,7 @@ function manifestCached()
reloadLocations([fallbackFrame1, fallbackFrame2]);
waitForLocations(
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html"],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback.html"],
fallbackLoaded
);
}
@ -121,14 +121,14 @@ function manifestCached()
function fallbackLoaded()
{
dump("in fallbackLoaded\n");
applicationCache.mozAdd("http://mochi.test:8888/tests/SimpleTest/EventUtils.js");
OfflineTest.waitForAdd("http://mochi.test:8888/tests/SimpleTest/EventUtils.js",
applicationCache.mozAdd("https://example.com/tests/SimpleTest/EventUtils.js");
OfflineTest.waitForAdd("https://example.com/tests/SimpleTest/EventUtils.js",
dynamicLoaded);
}
function dynamicLoaded()
{
window.open("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html");
window.open("https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html");
// window.applicationCache.noupdate invokes implicitLoaded()
}
@ -138,7 +138,7 @@ function implicitLoaded(aWindow, errorOccured)
OfflineTest.ok(!errorOccured, "No error on new implicit page manifest update");
OfflineTest.waitForAdd("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html",
OfflineTest.waitForAdd("https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html",
implicitCached);
}
@ -147,13 +147,13 @@ function implicitCached()
// Checking first version of the manifest + another implict page caching
// Whitelist entries
checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", "", true);
checkFallbackAndWhitelisting("https://example.com/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", "", true);
// Fallback URI selection check
checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html",
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html",
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
checkFallbackAndWhitelisting("https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
checkFallbackAndWhitelisting("https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
// Cache object status
OfflineTest.is(applicationCache.status, SpecialPowers.Ci.nsIDOMOfflineResourceList.IDLE,
@ -163,28 +163,28 @@ function implicitCached()
var entries = [
// Explicit entries
["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", false],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true],
["https://example.com/tests/SimpleTest/SimpleTest.js", false],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true],
// Fallback entries
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", true],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback.html", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false],
// Whitelist entries
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", false],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", false],
// Implicit entries
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true],
// Dynamic entries
["http://mochi.test:8888/tests/SimpleTest/EventUtils.js", true]
["https://example.com/tests/SimpleTest/EventUtils.js", true]
];
OfflineTest.checkCacheEntries(
entries,
function() {
++gStep;
OfflineTest.setSJSState("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs", "second");
OfflineTest.setSJSState("https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs", "second");
applicationCache.update();
// Invokes manifestUpdated()
@ -201,13 +201,13 @@ function manifestUpdated()
// Processing second version of the manifest.
// Whitelist entries
checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", "", false);
checkFallbackAndWhitelisting("https://example.com/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", "", false);
// Fallback URI selection check
checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html",
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html",
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
checkFallbackAndWhitelisting("https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback.html", false);
checkFallbackAndWhitelisting("https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
// Cache object status
OfflineTest.is(applicationCache.status, SpecialPowers.Ci.nsIDOMOfflineResourceList.UPDATEREADY,
@ -215,29 +215,29 @@ function manifestUpdated()
var entries = [
// Explicit entries
["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", true],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true],
["https://example.com/tests/SimpleTest/SimpleTest.js", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true],
// Fallback entries
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", true],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback.html", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback2.html", true],
// Whitelist entries
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", false],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", false],
// Implicit entries
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true],
// Dynamic entries
["http://mochi.test:8888/tests/SimpleTest/EventUtils.js", true]
["https://example.com/tests/SimpleTest/EventUtils.js", true]
];
OfflineTest.checkCacheEntries(
entries,
function() {
++gStep;
OfflineTest.setSJSState("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs", "third");
OfflineTest.setSJSState("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs", "second");
OfflineTest.setSJSState("https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs", "third");
OfflineTest.setSJSState("https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs", "second");
gGotFrameVersion = 0;
updatingFrame.location.reload();
@ -250,13 +250,13 @@ function manifestUpdated()
// Processing third version of the manifest.
// Whitelist entries
checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", "", true);
checkFallbackAndWhitelisting("https://example.com/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", "", true);
// Fallback URI selection check
checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html",
checkFallbackAndWhitelisting("https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html",
"", false);
checkFallbackAndWhitelisting("http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html",
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
checkFallbackAndWhitelisting("https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html",
"https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback2.html", false);
// Cache object status
OfflineTest.is(applicationCache.status, SpecialPowers.Ci.nsIDOMOfflineResourceList.UPDATEREADY,
@ -266,21 +266,21 @@ function manifestUpdated()
var entries = [
// Explicit entries
["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js", false],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true],
["https://example.com/tests/SimpleTest/SimpleTest.js", false],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js", true],
// Fallback entries
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback.html", false],
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/fallback2.html", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback.html", false],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/fallback2.html", true],
// Whitelist entries
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", false],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html", false],
// Implicit entries
["http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true],
["https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingImplicit.html", true],
// Dynamic entries
["http://mochi.test:8888/tests/SimpleTest/EventUtils.js", true]
["https://example.com/tests/SimpleTest/EventUtils.js", true]
];
OfflineTest.checkCacheEntries(
entries,
@ -338,9 +338,9 @@ if (OfflineTest.setup()) {
</head>
<body>
<iframe name="updatingFrame" src="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs"></iframe>
<iframe name="fallbackFrame1" src="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html"></iframe>
<iframe name="fallbackFrame2" src="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html"></iframe>
<iframe name="whitelistFrame" src="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html"></iframe>
<iframe name="updatingFrame" src="https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs"></iframe>
<iframe name="fallbackFrame1" src="https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/opp.html"></iframe>
<iframe name="fallbackFrame2" src="https://example.com/tests/dom/tests/mochitest/ajax/offline/namespace1/sub/opp.html"></iframe>
<iframe name="whitelistFrame" src="https://example.com/tests/dom/tests/mochitest/ajax/offline/onwhitelist.html"></iframe>
</body>
</html>

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/simpleManifest.cacheManifest">
<head>
<title>xhtml manifest test</title>

Просмотреть файл

@ -1,10 +1,10 @@
CACHE MANIFEST
http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
https://example.com/tests/SimpleTest/SimpleTest.js
UNKNOWN-SECTION:
http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/jupiter.jpg
https://example.com/tests/dom/tests/mochitest/ajax/offline/jupiter.jpg
here can be anything the current implementaion
is not able to parse at all and is just silently ignored
CACHE:
http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js

Просмотреть файл

@ -1,4 +1,4 @@
<html xmlns="http://www.w3.org/1999/xhtml" manifest="http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingManifest.sjs">
<head>
<title>Updating implicit</title>

Просмотреть файл

@ -2,8 +2,8 @@ ver1manifest =
"CACHE MANIFEST\n" +
"# v1\n" +
"\n" +
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs\n" +
"https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
"https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs\n" +
"\n" +
"FALLBACK:\n" +
"namespace1/ fallback.html\n" +
@ -15,9 +15,9 @@ ver2manifest =
"CACHE MANIFEST\n" +
"# v2\n" +
"\n" +
"http://mochi.test:8888/tests/SimpleTest/SimpleTest.js\n" +
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs" +
"https://example.com/tests/SimpleTest/SimpleTest.js\n" +
"https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
"https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs" +
"\n" +
"FALLBACK:\n" +
"namespace1/ fallback.html\n" +
@ -27,8 +27,8 @@ ver3manifest =
"CACHE MANIFEST\n" +
"# v3\n" +
"\n" +
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
"http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs" +
"https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js\n" +
"https://example.com/tests/dom/tests/mochitest/ajax/offline/updatingIframe.sjs" +
"\n" +
"FALLBACK:\n" +
"namespace1/sub fallback2.html\n" +

Просмотреть файл

@ -1,7 +1,7 @@
CACHE MANIFEST
http://mochi.test:8888/tests/SimpleTest/SimpleTest.js
http://mochi.test:8888/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
https://example.com/tests/SimpleTest/SimpleTest.js
https://example.com/tests/dom/tests/mochitest/ajax/offline/offlineTests.js
NETWORK:
*

Просмотреть файл

@ -184,7 +184,7 @@ MOCHITEST_CHROME_MANIFESTS += [
]
XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
BROWSER_CHROME_MANIFESTS += ['browser/browser.ini']
BROWSER_CHROME_MANIFESTS += ['browser/browser.ini', 'mochitest/ajax/offline/browser.ini']
TEST_HARNESS_FILES.testing.mochitest.tests.dom.tests.mochitest.ajax.lib += [
'mochitest/ajax/lib/AJAX_setup.js',

Просмотреть файл

@ -72,7 +72,7 @@ interface XULControllers;
#ifdef HAVE_SIDEBAR
[Replaceable, Throws] readonly attribute External external;
#endif
[Throws, Pref="browser.cache.offline.enable"] readonly attribute ApplicationCache applicationCache;
[Throws, Pref="browser.cache.offline.enable", Func="nsGlobalWindowInner::OfflineCacheAllowedForContext"] readonly attribute ApplicationCache applicationCache;
// user prompts
[Throws, NeedsSubjectPrincipal] void alert();

Просмотреть файл

@ -12,7 +12,6 @@ user_pref("dom.max_chrome_script_run_time", 0);
user_pref("javascript.allow.mailnews", true);
user_pref("javascript.options.showInConsole", true);
user_pref("layout.css.report_errors", true);
user_pref("signed.applets.codebase_principal_support", true);
user_pref("browser.warnOnQuit", false);
user_pref("browser.cache.check_doc_frequency", 1);
user_pref("extensions.checkCompatibility", false);

Просмотреть файл

@ -36,7 +36,6 @@
#ifdef MOZ_OLD_STYLE
#include "mozilla/RuleProcessorCache.h"
#endif
#include "ContentPrincipal.h"
#include "nsRange.h"
#include "nsRegion.h"
#include "nsRepeatService.h"
@ -264,7 +263,6 @@ nsLayoutStatics::Initialize()
nsLayoutUtils::Initialize();
PointerEventHandler::InitializeStatics();
TouchManager::InitializeStatics();
ContentPrincipal::InitializeStatics();
nsCORSListenerProxy::Startup();

Просмотреть файл

@ -88,6 +88,15 @@ pref("browser.cache.frecency_half_life_hours", 6);
pref("browser.cache.max_shutdown_io_lag", 2);
pref("browser.cache.offline.enable", true);
// Nightly and Early Beta will have AppCache disabled by default
// Stable will remain enabled until Firefox 62.
#ifdef EARLY_BETA_OR_EARLIER
pref("browser.cache.offline.insecure.enable", false);
#else
pref("browser.cache.offline.insecure.enable", true);
#endif
// enable offline apps by default, disable prompt
pref("offline-apps.allow_by_default", true);
@ -2584,7 +2593,6 @@ pref("font.blacklist.underline_offset", "FangSong,Gulim,GulimChe,MingLiU,MingLiU
pref("security.directory", "");
pref("signed.applets.codebase_principal_support", false);
// security-sensitive dialogs should delay button enabling. In milliseconds.
pref("security.dialog_enable_delay", 1000);
pref("security.notification_enable_delay", 500);

Просмотреть файл

@ -8682,6 +8682,12 @@ nsHttpChannel::MaybeWarnAboutAppCache()
GetCallback(warner);
if (warner) {
warner->IssueWarning(nsIDocument::eAppCache, false);
// When the page is insecure and the API is still enabled
// provide an additional warning for developers of removal
if (!IsHTTPS() &&
Preferences::GetBool("browser.cache.offline.insecure.enable")) {
warner->IssueWarning(nsIDocument::eAppCacheInsecure, true);
}
}
}

Просмотреть файл

@ -1393,7 +1393,7 @@ AuthCertificate(CertVerifier& certVerifier,
!(providerFlags & nsISocketProvider::NO_PERMANENT_STORAGE);
SECOidTag evOidPolicy;
UniqueCERTCertList certList;
UniqueCERTCertList builtCertChain;
CertVerifier::OCSPStaplingStatus ocspStaplingStatus =
CertVerifier::OCSP_STAPLING_NEVER_CHECKED;
KeySizeStatus keySizeStatus = KeySizeStatus::NeverChecked;
@ -1411,8 +1411,9 @@ AuthCertificate(CertVerifier& certVerifier,
sctsFromTLSExtension, time,
infoObject,
infoObject->GetHostName(),
certList, saveIntermediates,
flags, infoObject->
builtCertChain,
saveIntermediates, flags,
infoObject->
GetOriginAttributes(),
&evOidPolicy,
&ocspStaplingStatus,
@ -1453,8 +1454,8 @@ AuthCertificate(CertVerifier& certVerifier,
RememberCertErrorsTable::GetInstance().RememberCertHasError(infoObject,
nullptr,
SECSuccess);
GatherSuccessfulValidationTelemetry(certList);
GatherCertificateTransparencyTelemetry(certList,
GatherSuccessfulValidationTelemetry(builtCertChain);
GatherCertificateTransparencyTelemetry(builtCertChain,
/*isEV*/ evOidPolicy != SEC_OID_UNKNOWN,
certificateTransparencyInfo);
@ -1477,9 +1478,9 @@ AuthCertificate(CertVerifier& certVerifier,
RefPtr<nsNSSCertificate> nsc = nsNSSCertificate::Create(cert.get());
status->SetServerCert(nsc, evStatus);
status->SetSucceededCertChain(Move(certList));
status->SetSucceededCertChain(Move(builtCertChain));
MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
("AuthCertificate setting NEW cert %p", nsc.get()));
("AuthCertificate setting NEW cert %p", nsc.get()));
status->SetCertificateTransparencyInfo(certificateTransparencyInfo);
}
@ -1487,7 +1488,7 @@ AuthCertificate(CertVerifier& certVerifier,
if (rv != Success) {
// Certificate validation failed; store the peer certificate chain on
// infoObject so it can be used for error reporting.
infoObject->SetFailedCertChain(Move(certList));
infoObject->SetFailedCertChain(Move(peerCertChain));
PR_SetError(MapResultToPRErrorCode(rv), 0);
}
@ -1575,7 +1576,8 @@ SSLServerCertVerificationJob::Run()
mPeerCertChain, mStapledOCSPResponse.get(),
mSCTsFromTLSExtension.get(),
mProviderFlags, mTime);
MOZ_ASSERT(mPeerCertChain || rv != SECSuccess,
MOZ_ASSERT((mPeerCertChain && rv == SECSuccess) ||
(!mPeerCertChain && rv != SECSuccess),
"AuthCertificate() should take ownership of chain on failure");
if (rv == SECSuccess) {
uint32_t interval = (uint32_t) ((TimeStamp::Now() - mJobStartTime).ToMilliseconds());
@ -1755,7 +1757,8 @@ AuthCertificateHook(void* arg, PRFileDesc* fd, PRBool checkSig, PRBool isServer)
SECStatus rv = AuthCertificate(*certVerifier, socketInfo, serverCert,
peerCertChain, stapledOCSPResponse,
sctsFromTLSExtension, providerFlags, now);
MOZ_ASSERT(peerCertChain || rv != SECSuccess,
MOZ_ASSERT((peerCertChain && rv == SECSuccess) ||
(!peerCertChain && rv != SECSuccess),
"AuthCertificate() should take ownership of chain on failure");
if (rv == SECSuccess) {
Telemetry::Accumulate(Telemetry::SSL_CERT_ERROR_OVERRIDES, 1);

Просмотреть файл

@ -102,6 +102,24 @@ function run_test() {
}
);
// Test overrideable connection failure (failedCertChain should be non-null)
add_connection_test(
"unknownissuer.example.com",
SEC_ERROR_UNKNOWN_ISSUER,
null,
function withSecurityInfo(securityInfo) {
securityInfo.QueryInterface(Ci.nsITransportSecurityInfo);
test_security_info_serialization(securityInfo, SEC_ERROR_UNKNOWN_ISSUER);
notEqual(securityInfo.failedCertChain, null,
"failedCertChain should not be null for an overrideable" +
" connection failure");
let originalCertChain = build_cert_chain(["unknownissuer"]);
ok(originalCertChain.equals(securityInfo.failedCertChain),
"failedCertChain should equal the original cert chain for an" +
" overrideable connection failure");
}
);
// Test non-overrideable error (failedCertChain should be non-null)
add_connection_test(
"inadequatekeyusage.example.com",

Просмотреть файл

@ -706,6 +706,10 @@ this.BufferedBookmarksEngine = function BufferedBookmarksEngine() {
BufferedBookmarksEngine.prototype = {
__proto__: BaseBookmarksEngine.prototype,
_storeObj: BufferedBookmarksStore,
// Used to override the engine name in telemetry, so that we can distinguish
// errors that happen when the buffered engine is enabled vs when the
// non-buffered engine is enabled.
overrideTelemetryName: "bookmarks-buffered",
async getLastSync() {
let mirror = await this._store.ensureOpenMirror();

Просмотреть файл

@ -148,6 +148,12 @@ class EngineRecord {
if (error) {
this.failureReason = SyncTelemetry.transformError(error);
}
// This allows cases like bookmarks-buffered to have a separate name from
// the bookmarks engine.
let engineImpl = Weave.Service.engineManager.get(this.name);
if (engineImpl && engineImpl.overrideTelemetryName) {
this.name = engineImpl.overrideTelemetryName;
}
}
recordApplied(counts) {

Просмотреть файл

@ -390,7 +390,27 @@ add_task(async function test_engine_fail_weird_errors() {
name: "unexpectederror",
error: JSON.stringify(e)
});
} finally {
await cleanAndGo(engine, server);
Service.engineManager.unregister(engine);
}
});
add_task(async function test_overrideTelemetryName() {
enableValidationPrefs();
await Service.engineManager.register(SteamEngine);
let engine = Service.engineManager.get("steam");
engine.overrideTelemetryName = "steam-but-better";
engine.enabled = true;
let server = await serverForFoo(engine);
await SyncTestingInfrastructure(server);
try {
let ping = await sync_and_validate_telem(true);
ok(ping.engines.find(e => e.name === "steam-but-better"));
ok(!ping.engines.find(e => e.name === "steam"));
} finally {
await cleanAndGo(engine, server);
await Service.engineManager.unregister(engine);

Просмотреть файл

@ -18,8 +18,11 @@ struct StylesheetSetEntry<S>
where
S: StylesheetInDocument + PartialEq + 'static,
{
/// The sheet.
sheet: S,
dirty: bool,
/// Whether this sheet has been part of at least one flush.
committed: bool,
}
impl<S> StylesheetSetEntry<S>
@ -27,7 +30,7 @@ where
S: StylesheetInDocument + PartialEq + 'static,
{
fn new(sheet: S) -> Self {
Self { sheet, dirty: true }
Self { sheet, committed: false }
}
}
@ -239,9 +242,9 @@ where
loop {
let potential_sheet = self.iter.next()?;
let dirty = mem::replace(&mut potential_sheet.dirty, false);
if dirty {
// If the sheet was dirty, we need to do a full rebuild anyway.
let committed = mem::replace(&mut potential_sheet.committed, true);
if !committed {
// If the sheet was uncommitted, we need to do a full rebuild anyway.
return Some((&potential_sheet.sheet, SheetRebuildKind::Full))
}
@ -303,18 +306,22 @@ where
}
fn remove(&mut self, sheet: &S) {
let old_len = self.entries.len();
self.entries.retain(|entry| entry.sheet != *sheet);
if cfg!(feature = "servo") {
let index = self.entries.iter().position(|entry| {
entry.sheet == *sheet
});
if cfg!(feature = "gecko") && index.is_none() {
// FIXME(emilio): Make Gecko's PresShell::AddUserSheet not suck.
//
// Hopefully that's not necessary for correctness, just somewhat
// overkill.
debug_assert!(self.entries.len() != old_len, "Sheet not found?");
return;
}
let sheet = self.entries.remove(index.unwrap());
// Removing sheets makes us tear down the whole cascade and invalidation
// data.
self.set_data_validity_at_least(OriginValidity::FullyInvalid);
// data, but only if the sheet has been involved in at least one flush.
// Checking whether the sheet has been committed allows us to avoid
// rebuilding the world when sites quickly append and remove a stylesheet.
// See bug 1434756.
if sheet.committed {
self.set_data_validity_at_least(OriginValidity::FullyInvalid);
}
}
fn contains(&self, sheet: &S) -> bool {

Просмотреть файл

@ -94,7 +94,7 @@ function unsafe_open_pull_request() {
AUTH="${WPT_SYNC_USER}:${WPT_SYNC_TOKEN}"
UPSTREAM="https://${AUTH}@github.com/${WPT_SYNC_USER}/servo.git"
git remote add "${REMOTE_NAME}" "${UPSTREAM}" || return 2
git push -f "${REMOTE_NAME}" "${BRANCH_NAME}" || return 3
git push -f "${REMOTE_NAME}" "${BRANCH_NAME}" &>/dev/null || return 3
# Prepare the pull request metadata.
BODY=":warning: Do not merge this PR without verifying that it "

Просмотреть файл

@ -36,4 +36,4 @@ cd ../..
ghp-import -n target/doc
git push -qf \
"https://${TOKEN}@github.com/servo/doc.servo.org.git" gh-pages \
>/dev/null 2>&1
&>/dev/null

Просмотреть файл

@ -22,7 +22,6 @@ user_pref("dom.ipc.reportProcessHangs", false); // process hang monitor
user_pref("dom.popup_maximum", -1);
user_pref("dom.send_after_paint_to_content", true);
user_pref("dom.successive_dialog_time_limit", 0);
user_pref("signed.applets.codebase_principal_support", true);
user_pref("browser.shell.checkDefaultBrowser", false);
user_pref("shell.checkDefaultClient", false);
user_pref("browser.warnOnQuit", false);

Просмотреть файл

@ -1,4 +1,5 @@
[appcache-worker.html]
prefs: [browser.cache.offline.insecure.enable:true]
expected: TIMEOUT
[Dedicated worker of the cached script]
expected: FAIL

Просмотреть файл

@ -0,0 +1,2 @@
[api_status_idle.html]
prefs: [browser.cache.offline.insecure.enable:true]

Просмотреть файл

@ -0,0 +1,2 @@
[api_status_uncached.html]
prefs: [browser.cache.offline.insecure.enable:true]

Просмотреть файл

@ -0,0 +1,2 @@
[api_swapcache_error.html]
prefs: [browser.cache.offline.insecure.enable:true]

Просмотреть файл

@ -0,0 +1,2 @@
[api_update.html]
prefs: [browser.cache.offline.insecure.enable:true]

Просмотреть файл

@ -1,4 +1,5 @@
[api_update_error.html]
prefs: [browser.cache.offline.insecure.enable:true]
[INVALID_STATE_ERR error test]
expected: FAIL

Просмотреть файл

@ -0,0 +1,2 @@
[event_cached.html]
prefs: [browser.cache.offline.insecure.enable:true]

Просмотреть файл

@ -0,0 +1,2 @@
[event_checking.html]
prefs: [browser.cache.offline.insecure.enable:true]

Просмотреть файл

@ -0,0 +1,2 @@
[event_noupdate.html]
prefs: [browser.cache.offline.insecure.enable:true]

Просмотреть файл

@ -0,0 +1,2 @@
[event_progress.html]
prefs: [browser.cache.offline.insecure.enable:true]

Просмотреть файл

@ -0,0 +1,2 @@
[manifest_url_check.html]
prefs: [browser.cache.offline.insecure.enable:true]

Просмотреть файл

@ -1,4 +1,5 @@
[window-security.html]
prefs: [browser.cache.offline.insecure.enable:true]
[A SecurityError exception must be thrown when window.oncancel is accessed from a different origin.]
expected: FAIL

Просмотреть файл

@ -1,4 +1,5 @@
[window-properties.html]
prefs: [browser.cache.offline.insecure.enable:true]
[Window attribute: oncancel]
expected: FAIL

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше