2009-03-30 11:32:19 -07:00
|
|
|
function test() {
|
|
|
|
/** Test for Bug 483330 **/
|
|
|
|
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
|
|
|
let tab = gBrowser.addTab();
|
|
|
|
gBrowser.selectedTab = tab;
|
|
|
|
|
|
|
|
let browser = tab.linkedBrowser;
|
|
|
|
browser.addEventListener("load", function loadListener(e) {
|
2009-10-13 06:31:53 -07:00
|
|
|
browser.removeEventListener("load", arguments.callee, true);
|
2009-03-30 11:32:19 -07:00
|
|
|
|
|
|
|
// Scroll the content document
|
|
|
|
browser.contentWindow.scrollTo(1100, 1200);
|
|
|
|
is(browser.contentWindow.scrollX, 1100, "scrolled horizontally");
|
|
|
|
is(browser.contentWindow.scrollY, 1200, "scrolled vertically");
|
|
|
|
|
|
|
|
gBrowser.removeTab(tab);
|
|
|
|
|
|
|
|
let newTab = ss.undoCloseTab(window, 0);
|
|
|
|
newTab.addEventListener("SSTabRestored", function tabRestored(e) {
|
2009-10-13 06:31:53 -07:00
|
|
|
newTab.removeEventListener("SSTabRestored", arguments.callee, true);
|
2009-03-30 11:32:19 -07:00
|
|
|
|
|
|
|
let newBrowser = newTab.linkedBrowser;
|
|
|
|
|
|
|
|
// check that the scroll position was restored
|
|
|
|
is(newBrowser.contentWindow.scrollX, 1100, "still scrolled horizontally");
|
|
|
|
is(newBrowser.contentWindow.scrollY, 1200, "still scrolled vertically");
|
|
|
|
|
|
|
|
gBrowser.removeTab(newTab);
|
|
|
|
|
|
|
|
finish();
|
|
|
|
}, true);
|
|
|
|
}, true);
|
|
|
|
|
2013-02-19 10:32:29 -08:00
|
|
|
browser.loadURI("data:text/html;charset=utf-8,<body style='width: 100000px; height: 100000px;'><p>top</p></body>");
|
2009-03-30 11:32:19 -07:00
|
|
|
}
|