зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset dd200883aa79 (bug 1260931) for permafailing test_child_docshell.html on Android debug. r=backout
This commit is contained in:
Родитель
bea2a40720
Коммит
7db44d87f4
|
@ -47,7 +47,6 @@ PrincipalOriginAttributes::InheritFromDocShellToDoc(const DocShellOriginAttribut
|
|||
mSignedPkg = aAttrs.mSignedPkg;
|
||||
|
||||
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
||||
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -61,7 +60,6 @@ PrincipalOriginAttributes::InheritFromNecko(const NeckoOriginAttributes& aAttrs)
|
|||
mSignedPkg = aAttrs.mSignedPkg;
|
||||
|
||||
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
||||
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -79,7 +77,6 @@ DocShellOriginAttributes::InheritFromDocToChildDocShell(const PrincipalOriginAtt
|
|||
mSignedPkg = aAttrs.mSignedPkg;
|
||||
|
||||
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
||||
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -96,7 +93,6 @@ NeckoOriginAttributes::InheritFromDocToNecko(const PrincipalOriginAttributes& aA
|
|||
// mSignedPkg accordingly by mSignedPkgInBrowser
|
||||
|
||||
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
||||
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -113,7 +109,6 @@ NeckoOriginAttributes::InheritFromDocShellToNecko(const DocShellOriginAttributes
|
|||
// mSignedPkg accordingly by mSignedPkgInBrowser
|
||||
|
||||
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
||||
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -166,11 +161,6 @@ OriginAttributes::CreateSuffix(nsACString& aStr) const
|
|||
params->Set(NS_LITERAL_STRING("privateBrowsingId"), value);
|
||||
}
|
||||
|
||||
if (!mFirstPartyDomain.IsEmpty()) {
|
||||
MOZ_RELEASE_ASSERT(mFirstPartyDomain.FindCharInSet(dom::quota::QuotaManager::kReplaceChars) == kNotFound);
|
||||
params->Set(NS_LITERAL_STRING("firstPartyDomain"), mFirstPartyDomain);
|
||||
}
|
||||
|
||||
aStr.Truncate();
|
||||
|
||||
params->Serialize(value);
|
||||
|
@ -257,12 +247,6 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
if (aName.EqualsLiteral("firstPartyDomain")) {
|
||||
MOZ_RELEASE_ASSERT(mOriginAttributes->mFirstPartyDomain.IsEmpty());
|
||||
mOriginAttributes->mFirstPartyDomain.Assign(aValue);
|
||||
return true;
|
||||
}
|
||||
|
||||
// No other attributes are supported.
|
||||
return false;
|
||||
}
|
||||
|
@ -323,7 +307,6 @@ OriginAttributes::SetFromGenericAttributes(const GenericOriginAttributes& aAttrs
|
|||
mUserContextId = aAttrs.mUserContextId;
|
||||
mSignedPkg = aAttrs.mSignedPkg;
|
||||
mPrivateBrowsingId = aAttrs.mPrivateBrowsingId;
|
||||
mFirstPartyDomain = aAttrs.mFirstPartyDomain;
|
||||
}
|
||||
|
||||
BasePrincipal::BasePrincipal()
|
||||
|
|
|
@ -37,8 +37,7 @@ public:
|
|||
mAddonId == aOther.mAddonId &&
|
||||
mUserContextId == aOther.mUserContextId &&
|
||||
mSignedPkg == aOther.mSignedPkg &&
|
||||
mPrivateBrowsingId == aOther.mPrivateBrowsingId &&
|
||||
mFirstPartyDomain == aOther.mFirstPartyDomain;
|
||||
mPrivateBrowsingId == aOther.mPrivateBrowsingId;
|
||||
}
|
||||
bool operator!=(const OriginAttributes& aOther) const
|
||||
{
|
||||
|
@ -190,10 +189,6 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
if (mFirstPartyDomain.WasPassed() && mFirstPartyDomain.Value() != aAttrs.mFirstPartyDomain) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -230,11 +225,6 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
if (mFirstPartyDomain.WasPassed() && aOther.mFirstPartyDomain.WasPassed() &&
|
||||
mFirstPartyDomain.Value() != aOther.mFirstPartyDomain.Value()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -42,9 +42,7 @@ function printAttrs(name, attrs) {
|
|||
"\tuserContextId: " + attrs.userContextId + ",\n" +
|
||||
"\tinIsolatedMozBrowser: " + attrs.inIsolatedMozBrowser + ",\n" +
|
||||
"\taddonId: '" + attrs.addonId + "',\n" +
|
||||
"\tsignedPkg: '" + attrs.signedPkg + "',\n" +
|
||||
"\tprivateBrowsingId: '" + attrs.privateBrowsingId + "',\n" +
|
||||
"\tfirstPartyDomain: '" + attrs.firstPartyDomain + "'\n}");
|
||||
"\tsignedPkg: '" + attrs.signedPkg + "'\n}");
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,8 +55,6 @@ function checkValues(attrs, values) {
|
|||
do_check_eq(attrs.inIsolatedMozBrowser, values.inIsolatedMozBrowser || false);
|
||||
do_check_eq(attrs.addonId, values.addonId || '');
|
||||
do_check_eq(attrs.signedPkg, values.signedPkg || '');
|
||||
do_check_eq(attrs.privateBrowsingId, values.privateBrowsingId || '');
|
||||
do_check_eq(attrs.firstPartyDomain, values.firstPartyDomain || '');
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
|
@ -126,11 +122,6 @@ function run_test() {
|
|||
checkOriginAttributes(exampleOrg_addon, { addonId: "dummy" }, '^addonId=dummy');
|
||||
do_check_eq(exampleOrg_addon.origin, 'http://example.org^addonId=dummy');
|
||||
|
||||
// First party Uri
|
||||
var exampleOrg_firstPartyDomain = ssm.createCodebasePrincipal(makeURI('http://example.org'), {firstPartyDomain: 'example.org'});
|
||||
checkOriginAttributes(exampleOrg_firstPartyDomain, { firstPartyDomain: "example.org" }, '^firstPartyDomain=example.org');
|
||||
do_check_eq(exampleOrg_firstPartyDomain.origin, 'http://example.org^firstPartyDomain=example.org');
|
||||
|
||||
// Make sure we don't crash when serializing principals with UNKNOWN_APP_ID.
|
||||
try {
|
||||
let binaryStream = Cc["@mozilla.org/binaryoutputstream;1"].
|
||||
|
@ -186,7 +177,6 @@ function run_test() {
|
|||
checkCrossOrigin(exampleOrg_appBrowser, nullPrin_appBrowser);
|
||||
checkCrossOrigin(exampleOrg_appBrowser, exampleCom_appBrowser);
|
||||
checkCrossOrigin(exampleOrg_addon, exampleOrg);
|
||||
checkCrossOrigin(exampleOrg_firstPartyDomain, exampleOrg);
|
||||
checkCrossOrigin(exampleOrg_userContext, exampleOrg);
|
||||
checkCrossOrigin(exampleOrg_userContextAddon, exampleOrg);
|
||||
checkCrossOrigin(exampleOrg_userContext, exampleOrg_userContextAddon);
|
||||
|
@ -213,7 +203,7 @@ function run_test() {
|
|||
|
||||
// check that we can create an empty origin attributes dict with default
|
||||
// members and values.
|
||||
var emptyAttrs = ChromeUtils.fillNonDefaultOriginAttributes({});
|
||||
emptyAttrs = ChromeUtils.fillNonDefaultOriginAttributes({});
|
||||
checkValues(emptyAttrs);
|
||||
|
||||
var uri = "http://example.org";
|
||||
|
@ -223,20 +213,19 @@ function run_test() {
|
|||
[ "^userContextId=3", {userContextId: 3} ],
|
||||
[ "^addonId=fooBar", {addonId: "fooBar"} ],
|
||||
[ "^inBrowser=1", {inIsolatedMozBrowser: true} ],
|
||||
[ "^firstPartyDomain=example.org", {firstPartyDomain: "example.org"} ],
|
||||
[ "^signedPkg=bazQux", {signedPkg: "bazQux"} ],
|
||||
[ "^appId=3&inBrowser=1&userContextId=6",
|
||||
{appId: 3, userContextId: 6, inIsolatedMozBrowser: true} ] ];
|
||||
|
||||
// check that we can create an origin attributes from an origin properly
|
||||
tests.forEach(t => {
|
||||
tests.forEach(function(t) {
|
||||
let attrs = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
|
||||
checkValues(attrs, t[1]);
|
||||
do_check_eq(ChromeUtils.originAttributesToSuffix(attrs), t[0]);
|
||||
});
|
||||
|
||||
// check that we can create an origin attributes from a dict properly
|
||||
tests.forEach(t => {
|
||||
tests.forEach(function(t) {
|
||||
let attrs = ChromeUtils.fillNonDefaultOriginAttributes(t[1]);
|
||||
checkValues(attrs, t[1]);
|
||||
do_check_eq(ChromeUtils.originAttributesToSuffix(attrs), t[0]);
|
||||
|
@ -255,7 +244,7 @@ function run_test() {
|
|||
[ "^appId=5", {appId: 5}, {appId: 3, userContextId: 7}, {appId: 3, userContextId: 7}, "^appId=3&userContextId=7" ] ];
|
||||
|
||||
// check that we can set origin attributes values properly
|
||||
set_tests.forEach(t => {
|
||||
set_tests.forEach(function(t) {
|
||||
let orig = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
|
||||
checkValues(orig, t[1]);
|
||||
let mod = orig;
|
||||
|
@ -278,7 +267,7 @@ function run_test() {
|
|||
[ "^appId=5&userContextId=3", {appId: 5, userContextId: 3}, {appId: 5}, "^appId=5" ] ];
|
||||
|
||||
// check that we can set the userContextId to default properly
|
||||
dflt_tests.forEach(t => {
|
||||
dflt_tests.forEach(function(t) {
|
||||
let orig = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
|
||||
checkValues(orig, t[1]);
|
||||
let mod = orig;
|
||||
|
@ -286,26 +275,4 @@ function run_test() {
|
|||
checkValues(mod, t[2]);
|
||||
do_check_eq(ChromeUtils.originAttributesToSuffix(mod), t[3]);
|
||||
});
|
||||
|
||||
// each row in the dflt2_tests array has these values:
|
||||
// [0] - the suffix used to create an origin attribute from
|
||||
// [1] - the expected result of creating an origin attributes from [0]
|
||||
// [2] - the expected result after setting firstPartyUri to the default
|
||||
// [3] - the expected result of creating a suffix from [2]
|
||||
var dflt2_tests = [
|
||||
[ "", {}, {}, "" ],
|
||||
[ "^firstPartyDomain=foo.com", {firstPartyDomain: "foo.com"}, {}, "" ],
|
||||
[ "^appId=5", {appId: 5}, {appId: 5}, "^appId=5" ],
|
||||
[ "^appId=5&firstPartyDomain=foo.com", {appId: 5, firstPartyDomain: "foo.com"}, {appId: 5}, "^appId=5" ] ];
|
||||
|
||||
// check that we can set the userContextId to default properly
|
||||
dflt2_tests.forEach(t => {
|
||||
let orig = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
|
||||
checkValues(orig, t[1]);
|
||||
let mod = orig;
|
||||
mod['firstPartyDomain'] = "";
|
||||
checkValues(mod, t[2]);
|
||||
do_check_eq(ChromeUtils.originAttributesToSuffix(mod), t[3]);
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -81,7 +81,6 @@ dictionary OriginAttributesDictionary {
|
|||
DOMString addonId = "";
|
||||
DOMString signedPkg = "";
|
||||
unsigned long privateBrowsingId = 0;
|
||||
DOMString firstPartyDomain = "";
|
||||
};
|
||||
dictionary OriginAttributesPatternDictionary {
|
||||
unsigned long appId;
|
||||
|
@ -90,5 +89,4 @@ dictionary OriginAttributesPatternDictionary {
|
|||
DOMString addonId;
|
||||
DOMString signedPkg;
|
||||
unsigned long privateBrowsingId;
|
||||
DOMString firstPartyDomain;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче