Bug 962212 (followup) - Fix a typo in metro Tab constructor that broke inheritance of private flag [r=azasypkin]

This commit is contained in:
Matt Brubeck 2014-02-03 08:09:06 -08:00
parent aff318a34b
commit 518c28a2ae
2 changed files with 11 additions and 1 deletions

View File

@ -1260,7 +1260,7 @@ function Tab(aURI, aParams, aOwner) {
if ("private" in aParams) {
this._private = aParams.private;
} else if (aOwner) {
this._private = aOwner.private;
this._private = aOwner._private;
}
this.owner = aOwner || null;

View File

@ -16,12 +16,22 @@ gTests.push({
is(tab.isPrivate, false, "Tabs are not private by default");
is(tab.chromeTab.hasAttribute("private"), false,
"non-private tab has no private attribute");
let child = Browser.addTab("about:mozilla", false, tab);
is(child.isPrivate, false, "Child of a non-private tab is not private");
Browser.closeTab(child, { forceClose: true });
Browser.closeTab(tab, { forceClose: true });
tab = Browser.addTab("about:mozilla", false, null, { private: true });
is(tab.isPrivate, true, "Create a private tab");
is(tab.chromeTab.getAttribute("private"), "true",
"private tab has private attribute");
child = Browser.addTab("about:mozilla", false, tab);
is(child.isPrivate, true, "Child of a private tab is private");
Browser.closeTab(child, { forceClose: true });
Browser.closeTab(tab, { forceClose: true });
}
});