Bug 1102025 - Make this test pass in e10s. r=bholley

This commit is contained in:
Blake Kaplan 2015-12-10 14:17:09 -05:00
parent ad5e2f804f
commit 5ea6c92cf4
2 changed files with 21 additions and 2 deletions

View File

@ -324,7 +324,6 @@ skip-if = buildapp == 'mulet'
[browser_identity_UI.js]
[browser_insecureLoginForms.js]
[browser_keywordBookmarklets.js]
skip-if = e10s # Bug 1102025 - different principals for the bookmarklet only in e10s mode (unclear if test or 'real' issue)
[browser_keywordSearch.js]
[browser_keywordSearch_postData.js]
[browser_lastAccessedTab.js]

View File

@ -12,6 +12,14 @@ add_task(function* test_keyword_bookmarklet() {
yield promisePageShow();
let originalPrincipal = gBrowser.contentPrincipal;
function getPrincipalURI() {
return ContentTask.spawn(tab.linkedBrowser, null, function() {
return content.document.nodePrincipal.URI.spec;
});
}
let originalPrincipalURI = yield getPrincipalURI();
yield PlacesUtils.keywords.insert({ keyword: "bm", url: "javascript:1;" })
// Enter bookmarklet keyword in the URL bar
@ -21,7 +29,19 @@ add_task(function* test_keyword_bookmarklet() {
yield promisePageShow();
ok(gBrowser.contentPrincipal.equals(originalPrincipal), "javascript bookmarklet should inherit principal");
let newPrincipalURI = yield getPrincipalURI();
is(newPrincipalURI, originalPrincipalURI, "content has the same principal");
// In e10s, null principals don't round-trip so the same null principal sent
// from the child will be a new null principal. Verify that this is the
// case.
if (tab.linkedBrowser.isRemoteBrowser) {
ok(originalPrincipal.isNullPrincipal && gBrowser.contentPrincipal.isNullPrincipal,
"both principals should be null principals in the parent");
} else {
ok(gBrowser.contentPrincipal.equals(originalPrincipal),
"javascript bookmarklet should inherit principal");
}
});
function* promisePageShow() {