Backed out 3 changesets (bug 1645234) for failing browser_webconsole_requestStorageAccess_errors.js on a CLOSED TREE

Backed out changeset ad1f8a4d64cf (bug 1645234)
Backed out changeset 6de9007aa306 (bug 1645234)
Backed out changeset 87d5d468c7f2 (bug 1645234)
This commit is contained in:
Andreea Pavel 2020-07-09 13:05:14 +03:00
Родитель be67ca2eb8
Коммит 4d223b739e
7 изменённых файлов: 0 добавлений и 118 удалений

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

@ -129,7 +129,6 @@ support-files =
test-message-categories-workers.js
test-mixedcontent-securityerrors.html
test-navigate-to-parse-error.html
test-nested-iframe-storageaccess-errors.html
test-network-exceptions.html
test-network-request.html
test-network.html
@ -147,7 +146,6 @@ support-files =
test-sourcemap.min.js
test-sourcemap.min.js.map
test-stacktrace-location-debugger-link.html
test-storageaccess-errors.html
test-subresource-security-error.html
test-subresource-security-error.js
test-subresource-security-error.js^headers^
@ -319,7 +317,6 @@ skip-if = (os == "linux" && fission && !ccov) || (os == "win" && fission) #Bug 1
[browser_webconsole_promise_rejected_object.js]
[browser_webconsole_reopen_closed_tab.js]
[browser_webconsole_repeat_different_objects.js]
[browser_webconsole_requestStorageAccess_errors.js]
[browser_webconsole_reverse_search.js]
[browser_webconsole_reverse_search_initial_value.js]
[browser_webconsole_reverse_search_keyboard_navigation.js]

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

@ -1,55 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TEST_URI =
"https://example.com/browser/devtools/client/webconsole/test/browser/test-storageaccess-errors.html";
const LEARN_MORE_URI =
"https://developer.mozilla.org/docs/Web/API/Document/requestStorageAccess" +
DOCS_GA_PARAMS;
add_task(async function() {
const hud = await openNewTabAndConsole(TEST_URI);
async function checkErrorMessage(text) {
const message = await waitFor(
() => findMessage(hud, text, ".message.error"),
undefined,
100
);
ok(true, "Error message is visible: " + text);
const checkLink = ({ link, where, expectedLink, expectedTab }) => {
is(link, expectedLink, `Clicking the provided link opens ${link}`);
is(
where,
expectedTab,
`Clicking the provided link opens in expected tab`
);
};
info("Clicking on the Learn More link");
const learnMoreLink = message.querySelector(".learn-more-link");
const linkSimulation = await simulateLinkClick(learnMoreLink);
checkLink({
...linkSimulation,
expectedLink: LEARN_MORE_URI,
expectedTab: "tab",
});
}
const userGesture =
"document.requestStorageAccess() may only be requested from inside a short running user-generated event handler";
const nested =
"document.requestStorageAccess() may not be called in a nested iframe.";
const nullPrincipal =
"document.requestStorageAccess() may not be called on a document with an opaque origin, such as a sandboxed iframe without allow-same-origin in its sandbox attribute.";
const sandboxed =
"document.requestStorageAccess() may not be called in a sandboxed iframe without allow-storage-access-by-user-activation in its sandbox attribute.";
await checkErrorMessage(userGesture);
await checkErrorMessage(nullPrincipal);
await checkErrorMessage(nested);
await checkErrorMessage(sandboxed);
});

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

@ -1,14 +0,0 @@
<!DOCTYPE HTML>
<html dir="ltr" xml:lang="en-US" lang="en-US">
<head>
<meta charset="utf8">
<title>requestStorageAccess test</title>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
</head>
<body>
<iframe src="https://example.org/browser/devtools/client/webconsole/test/browser/test-storageaccess-errors.html"></iframe>
</body>
</html>

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

@ -1,20 +0,0 @@
<!DOCTYPE HTML>
<html dir="ltr" xml:lang="en-US" lang="en-US">
<head>
<meta charset="utf8">
<title>requestStorageAccess test</title>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
</head>
<body>
<iframe src="https://example.org/browser/devtools/client/webconsole/test/browser/test-nested-iframe-storageaccess-errors.html"></iframe>
<iframe sandbox="allow-scripts" src="https://example.com/browser/devtools/client/webconsole/test/browser/test-storageaccess-errors.html"></iframe>
<iframe sandbox="allow-same-origin allow-scripts" src="https://example.com/browser/devtools/client/webconsole/test/browser/test-storageaccess-errors.html"></iframe>
<script>
'use strict';
document.requestStorageAccess();
</script>
</body>
</html>

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

@ -114,8 +114,6 @@ const TLS_LEARN_MORE =
"https://blog.mozilla.org/security/2018/10/15/removing-old-versions-of-tls/";
const X_FRAME_OPTIONS_LEARN_MORE =
"https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Frame-Options";
const REQUEST_STORAGE_ACCESS_LEARN_MORE =
"https://developer.mozilla.org/docs/Web/API/Document/requestStorageAccess";
const ErrorCategories = {
"X-Frame-Options": X_FRAME_OPTIONS_LEARN_MORE,
"Insecure Password Field": INSECURE_PASSWORDS_LEARN_MORE,
@ -128,7 +126,6 @@ const ErrorCategories = {
MIMEMISMATCH: MIME_TYPE_MISMATCH_LEARN_MORE,
"source map": SOURCE_MAP_LEARN_MORE,
TLS: TLS_LEARN_MORE,
requestStorageAccess: REQUEST_STORAGE_ACCESS_LEARN_MORE,
};
const baseCorsErrorUrl =

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

@ -15886,10 +15886,6 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(
// Step 2. If the document has a null origin, reject.
if (NodePrincipal()->GetIsNullPrincipal()) {
nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
nsLiteralCString("requestStorageAccess"),
this, nsContentUtils::eDOM_PROPERTIES,
"RequestStorageAccessNullPrincipal");
promise->MaybeRejectWithUndefined();
return promise.forget();
}
@ -15939,9 +15935,6 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(
// Step 6. If the sub frame doesn't have the token
// "allow-storage-access-by-user-activation", reject.
if (StorageAccessSandboxed()) {
nsContentUtils::ReportToConsole(
nsIScriptError::errorFlag, nsLiteralCString("requestStorageAccess"),
this, nsContentUtils::eDOM_PROPERTIES, "RequestStorageAccessSandboxed");
promise->MaybeRejectWithUndefined();
return promise.forget();
}
@ -15949,19 +15942,12 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(
// Step 7. If the sub frame's parent frame is not the top frame, reject.
RefPtr<BrowsingContext> parentBC = bc->GetParent();
if (parentBC && !parentBC->IsTopContent()) {
nsContentUtils::ReportToConsole(
nsIScriptError::errorFlag, nsLiteralCString("requestStorageAccess"),
this, nsContentUtils::eDOM_PROPERTIES, "RequestStorageAccessNested");
promise->MaybeRejectWithUndefined();
return promise.forget();
}
// Step 8. If the browser is not processing a user gesture, reject.
if (!UserActivation::IsHandlingUserInput()) {
nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
nsLiteralCString("requestStorageAccess"),
this, nsContentUtils::eDOM_PROPERTIES,
"RequestStorageAccessUserGesture");
promise->MaybeRejectWithUndefined();
return promise.forget();
}

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

@ -394,12 +394,3 @@ UnknownProtocolNavigationPrevented=Prevented navigation to “%1$S” due to an
PostMessageSharedMemoryObjectToCrossOriginWarning=Cannot post message containing a shared memory object to a cross-origin window.
# LOCALIZATION NOTE: %S is the URL of the resource in question
UnusedLinkPreloadPending=The resource at “%S” preloaded with link preload was not used within a few seconds. Make sure all attributes of the preload tag are set correctly.
# LOCALIZATION NOTE: Do not translate document.requestStorageAccess(), iframe, allow-same-origin and sandbox (though you may translate "sandboxed").
RequestStorageAccessNullPrincipal=document.requestStorageAccess() may not be called on a document with an opaque origin, such as a sandboxed iframe without allow-same-origin in its sandbox attribute.
# LOCALIZATION NOTE: Do not translate document.requestStorageAccess(), iframe, allow-storage-access-by-user-activation and sandbox (though you may translate "sandboxed").
RequestStorageAccessSandboxed=document.requestStorageAccess() may not be called in a sandboxed iframe without allow-storage-access-by-user-activation in its sandbox attribute.
# LOCALIZATION NOTE: Do not translate document.requestStorageAccess() and iframe.
RequestStorageAccessNested=document.requestStorageAccess() may not be called in a nested iframe.
# LOCALIZATION NOTE: Do not translate document.requestStorageAccess(). In some locales it may be preferable to not translate "event handler", either.
RequestStorageAccessUserGesture=document.requestStorageAccess() may only be requested from inside a short running user-generated event handler.