Bug 1079331 - Simplify test_contextmenu.html by removing privateBrowsingMode.js; r=jdm

This commit is contained in:
Ehsan Akhgari 2014-10-07 16:14:20 -04:00
parent bd911da510
commit e11ea02957
3 changed files with 39 additions and 90 deletions

View File

@ -23,7 +23,6 @@ support-files =
offlineEvent.cacheManifest
offlineEvent.cacheManifest^headers^
offlineEvent.html
privateBrowsingMode.js
subtst_contextmenu.html
video.ogg

View File

@ -1,3 +0,0 @@
// This file is only present in per-window private browsing buikds.
var perWindowPrivateBrowsing = true;

View File

@ -15,8 +15,6 @@ Browser context menu tests.
</div>
<pre id="test">
<script> var perWindowPrivateBrowsing = false; </script>
<script type="text/javascript" src="privateBrowsingMode.js"></script>
<script type="text/javascript" src="contextmenu_common.js"></script>
<script class="testbody" type="text/javascript">
@ -111,26 +109,15 @@ function runTest(testNum) {
function () {
// Context menu for text link
if (perWindowPrivateBrowsing) {
checkContextMenu(["context-openlinkintab", true,
"context-openlink", true,
"context-openlinkprivate", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copylink", true,
"context-searchselect", true
].concat(inspectItems));
} else {
checkContextMenu(["context-openlinkintab", true,
"context-openlink", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copylink", true,
"context-searchselect", true
].concat(inspectItems));
}
checkContextMenu(["context-openlinkintab", true,
"context-openlink", true,
"context-openlinkprivate", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copylink", true,
"context-searchselect", true
].concat(inspectItems));
closeContextMenu();
openContextMenuFor(mailto); // Invoke context menu for next test.
},
@ -587,34 +574,19 @@ function runTest(testNum) {
// Context menu for selected text which matches valid URL pattern
if (SpecialPowers.Services.appinfo.OS == "Darwin") {
// This test is only enabled on Mac due to bug 736399.
if (perWindowPrivateBrowsing) {
checkContextMenu(["context-openlinkincurrent", true,
"context-openlinkintab", true,
"context-openlink", true,
"context-openlinkprivate", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copy", true,
"context-selectall", true,
"---", null,
"context-searchselect", true,
"context-viewpartialsource-selection", true
].concat(inspectItems));
} else {
checkContextMenu(["context-openlinkincurrent", true,
"context-openlinkintab", true,
"context-openlink", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copy", true,
"context-selectall", true,
"---", null,
"context-searchselect", true,
"context-viewpartialsource-selection", true
].concat(inspectItems));
}
checkContextMenu(["context-openlinkincurrent", true,
"context-openlinkintab", true,
"context-openlink", true,
"context-openlinkprivate", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copy", true,
"context-selectall", true,
"---", null,
"context-searchselect", true,
"context-viewpartialsource-selection", true
].concat(inspectItems));
}
closeContextMenu();
// clear the selection because following tests don't expect any selection
@ -625,42 +597,23 @@ function runTest(testNum) {
function () {
// Context menu for image link
if (perWindowPrivateBrowsing) {
checkContextMenu(["context-openlinkintab", true,
"context-openlink", true,
"context-openlinkprivate", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copylink", true,
"---", null,
"context-viewimage", true,
"context-copyimage-contents", true,
"context-copyimage", true,
"---", null,
"context-saveimage", true,
"context-sendimage", true,
"context-setDesktopBackground", true,
"context-viewimageinfo", true
].concat(inspectItems));
} else {
checkContextMenu(["context-openlinkintab", true,
"context-openlink", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copylink", true,
"---", null,
"context-viewimage", true,
"context-copyimage-contents", true,
"context-copyimage", true,
"---", null,
"context-saveimage", true,
"context-sendimage", true,
"context-setDesktopBackground", true,
"context-viewimageinfo", true
].concat(inspectItems));
}
checkContextMenu(["context-openlinkintab", true,
"context-openlink", true,
"context-openlinkprivate", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copylink", true,
"---", null,
"context-viewimage", true,
"context-copyimage-contents", true,
"context-copyimage", true,
"---", null,
"context-saveimage", true,
"context-sendimage", true,
"context-setDesktopBackground", true,
"context-viewimageinfo", true
].concat(inspectItems));
closeContextMenu();
selectInputText(select_inputtext); // Select text prior to opening context menu.
openContextMenuFor(select_inputtext); // Invoke context menu for next test.