Test for Bug 852909 - Test that the charset menu gets disabled for images and PDF.js. r=Gijs.

This commit is contained in:
Henri Sivonen 2013-11-26 09:31:52 +02:00
parent 2a889b2de7
commit f4fdb24845
4 changed files with 36 additions and 0 deletions

View File

@ -30,6 +30,8 @@ support-files =
file_bug503832.html
file_bug655270.html
file_bug670318.html
file_bug852909.pdf
file_bug852909.png
file_bug941562-child.html
file_bug941562.html
print_postdata.sjs
@ -59,6 +61,7 @@ support-files =
[browser_bug655273.js]
[browser_bug670318.js]
[browser_bug673467.js]
[browser_bug852909.js]
[browser_bug92473.js]
[browser_bug941562.js]
[browser_loadDisallowInherit.js]

View File

@ -0,0 +1,33 @@
var rootDir = "http://mochi.test:8888/browser/docshell/test/browser/";
function test() {
waitForExplicitFinish();
gBrowser.selectedTab = gBrowser.addTab(rootDir + "file_bug852909.png");
gBrowser.selectedBrowser.addEventListener("load", image, true);
}
function image(event) {
if (event.target != gBrowser.contentDocument) {
return;
}
gBrowser.selectedBrowser.removeEventListener("load", image, true);
ok(!gBrowser.docShell.mayEnableCharacterEncodingMenu, "Docshell should say the menu should be disabled for images.");
gBrowser.removeCurrentTab();
gBrowser.selectedTab = gBrowser.addTab(rootDir + "file_bug852909.pdf");
gBrowser.selectedBrowser.addEventListener("load", pdf, true);
}
function pdf(event) {
if (event.target != gBrowser.contentDocument) {
return;
}
gBrowser.selectedBrowser.removeEventListener("load", pdf, true);
ok(!gBrowser.docShell.mayEnableCharacterEncodingMenu, "Docshell should say the menu should be disabled for PDF.js.");
gBrowser.removeCurrentTab();
finish();
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 B