gecko/browser/base/content/test/browser_bug416661.js
Olli Pettay f49f941495 Bug 513912, Fix image document zoom handling in FF, r=dao, sr=jst
--HG--
extra : rebase_source : b562f90b4c326a5e40aa31e5bbbd363dd2047c8a
2009-09-09 23:04:05 +03:00

49 lines
1.4 KiB
JavaScript

var tabElm, zoomLevel;
function start_test_prefNotSet() {
tabElm.linkedBrowser.removeEventListener("load", start_test_prefNotSet, true);
tabElm.linkedBrowser.addEventListener("load", continue_test_prefNotSet, true);
is(ZoomManager.zoom, 1, "initial zoom level should be 1");
FullZoom.enlarge();
//capture the zoom level to test later
zoomLevel = ZoomManager.zoom;
isnot(zoomLevel, 1, "zoom level should have changed");
content.location =
"http://localhost:8888/browser/browser/base/content/test/moz.png";
}
function continue_test_prefNotSet () {
tabElm.linkedBrowser.removeEventListener("load", continue_test_prefNotSet, true);
tabElm.linkedBrowser.addEventListener("load", end_test_prefNotSet, true);
is(ZoomManager.zoom, 1, "zoom level pref should not apply to an image");
FullZoom.reset();
content.location =
"http://localhost:8888/browser/browser/base/content/test/zoom_test.html";
}
function end_test_prefNotSet() {
is(ZoomManager.zoom, zoomLevel, "the zoom level should have persisted");
// Reset the zoom so that other tests have a fresh zoom level
FullZoom.reset();
gBrowser.removeCurrentTab();
finish();
}
function test() {
waitForExplicitFinish();
tabElm = gBrowser.addTab();
gBrowser.selectedTab = tabElm;
tabElm.linkedBrowser.addEventListener("load", start_test_prefNotSet, true);
content.location =
"http://localhost:8888/browser/browser/base/content/test/zoom_test.html";
}