зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1072198 - updateBrowserRemoteness() needs to keep .permanentKey when updating browsers r=billm
This commit is contained in:
Родитель
48ae4b40a5
Коммит
e39d1b656a
|
@ -1449,8 +1449,12 @@
|
|||
|
||||
// Change the "remote" attribute.
|
||||
let parent = aBrowser.parentNode;
|
||||
let permanentKey = aBrowser.permanentKey;
|
||||
parent.removeChild(aBrowser);
|
||||
aBrowser.setAttribute("remote", aShouldBeRemote ? "true" : "false");
|
||||
// Tearing down the browser gives a new permanentKey but we want to
|
||||
// keep the old one. Re-set it explicitly after unbinding from DOM.
|
||||
aBrowser.permanentKey = permanentKey;
|
||||
parent.appendChild(aBrowser);
|
||||
|
||||
// Restore the progress listener.
|
||||
|
|
|
@ -58,45 +58,54 @@ add_task(function*() {
|
|||
info("1");
|
||||
// Create a tab and load a remote page in it
|
||||
gBrowser.selectedTab = gBrowser.addTab("about:blank", {skipAnimation: true});
|
||||
let {permanentKey} = gBrowser.selectedBrowser;
|
||||
yield waitForLoad("http://example.org/" + DUMMY_PATH);
|
||||
is(gBrowser.selectedTab.getAttribute("remote"), expectedRemote, "Remote attribute should be correct");
|
||||
is(gBrowser.selectedBrowser.permanentKey, permanentKey, "browser.permanentKey is still the same");
|
||||
|
||||
info("2");
|
||||
// Load another page
|
||||
yield waitForLoad("http://example.com/" + DUMMY_PATH);
|
||||
is(gBrowser.selectedTab.getAttribute("remote"), expectedRemote, "Remote attribute should be correct");
|
||||
is(gBrowser.selectedBrowser.permanentKey, permanentKey, "browser.permanentKey is still the same");
|
||||
check_history();
|
||||
|
||||
info("3");
|
||||
// Load a non-remote page
|
||||
yield waitForLoad("about:robots");
|
||||
is(gBrowser.selectedTab.getAttribute("remote"), "", "Remote attribute should be correct");
|
||||
is(gBrowser.selectedBrowser.permanentKey, permanentKey, "browser.permanentKey is still the same");
|
||||
check_history();
|
||||
|
||||
info("4");
|
||||
// Load a remote page
|
||||
yield waitForLoad("http://example.org/" + DUMMY_PATH);
|
||||
is(gBrowser.selectedTab.getAttribute("remote"), expectedRemote, "Remote attribute should be correct");
|
||||
is(gBrowser.selectedBrowser.permanentKey, permanentKey, "browser.permanentKey is still the same");
|
||||
check_history();
|
||||
|
||||
info("5");
|
||||
yield back();
|
||||
is(gBrowser.selectedTab.getAttribute("remote"), "", "Remote attribute should be correct");
|
||||
is(gBrowser.selectedBrowser.permanentKey, permanentKey, "browser.permanentKey is still the same");
|
||||
check_history();
|
||||
|
||||
info("6");
|
||||
yield back();
|
||||
is(gBrowser.selectedTab.getAttribute("remote"), expectedRemote, "Remote attribute should be correct");
|
||||
is(gBrowser.selectedBrowser.permanentKey, permanentKey, "browser.permanentKey is still the same");
|
||||
check_history();
|
||||
|
||||
info("7");
|
||||
yield forward();
|
||||
is(gBrowser.selectedTab.getAttribute("remote"), "", "Remote attribute should be correct");
|
||||
is(gBrowser.selectedBrowser.permanentKey, permanentKey, "browser.permanentKey is still the same");
|
||||
check_history();
|
||||
|
||||
info("8");
|
||||
yield forward();
|
||||
is(gBrowser.selectedTab.getAttribute("remote"), expectedRemote, "Remote attribute should be correct");
|
||||
is(gBrowser.selectedBrowser.permanentKey, permanentKey, "browser.permanentKey is still the same");
|
||||
check_history();
|
||||
|
||||
info("9");
|
||||
|
|
|
@ -386,8 +386,9 @@
|
|||
|
||||
<field name="_permanentKey">({})</field>
|
||||
|
||||
<property name="permanentKey" readonly="true"
|
||||
onget="return this._permanentKey;"/>
|
||||
<property name="permanentKey"
|
||||
onget="return this._permanentKey;"
|
||||
onset="this._permanentKey = val;"/>
|
||||
|
||||
<field name="_lastSearchString">null</field>
|
||||
<field name="_lastSearchHighlight">false</field>
|
||||
|
|
Загрузка…
Ссылка в новой задаче