Bug 1079331 - Simplify test_contextmenu.html by removing privateBrowsingMode.js; r=jdm
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 07 Oct 2014 16:14:20 -0400
changeset 209240 1a77a251ab44c32a73946e4bd954574da58384c4
parent 209239 ab8c808c0ccb4466e852d034aed8679144a177bb
child 209241 24045f0d8b0d680d634f1b1ee151c3c44b08ebde
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjdm
bugs1079331
milestone35.0a1
Bug 1079331 - Simplify test_contextmenu.html by removing privateBrowsingMode.js; r=jdm
browser/base/content/test/general/mochitest.ini
browser/base/content/test/general/privateBrowsingMode.js
browser/base/content/test/general/test_contextmenu.html
--- a/browser/base/content/test/general/mochitest.ini
+++ b/browser/base/content/test/general/mochitest.ini
@@ -18,17 +18,16 @@ support-files =
   offlineChild.cacheManifest^headers^
   offlineChild.html
   offlineChild2.cacheManifest
   offlineChild2.cacheManifest^headers^
   offlineChild2.html
   offlineEvent.cacheManifest
   offlineEvent.cacheManifest^headers^
   offlineEvent.html
-  privateBrowsingMode.js
   subtst_contextmenu.html
   video.ogg
 
 [test_bug364677.html]
 [test_bug395533.html]
 [test_contextmenu.html]
 skip-if = toolkit == "gtk2" || toolkit == "gtk3" # disabled on Linux due to bug 513558
 [test_contextmenu_input.html]
deleted file mode 100644
--- a/browser/base/content/test/general/privateBrowsingMode.js
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file is only present in per-window private browsing buikds.
-var perWindowPrivateBrowsing = true;
-
--- a/browser/base/content/test/general/test_contextmenu.html
+++ b/browser/base/content/test/general/test_contextmenu.html
@@ -10,18 +10,16 @@
 <body>
 Browser context menu tests.
 <p id="display"></p>
 
 <div id="content">
 </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">
 
 SpecialPowers.Cu.import("resource://gre/modules/InlineSpellChecker.jsm", window);
 
 const Ci = SpecialPowers.Ci;
 
 function executeCopyCommand(command, expectedValue)
@@ -106,36 +104,25 @@ function runTest(testNum) {
                          ].concat(inspectItems);
         checkContextMenu(plainTextItems);
         closeContextMenu();
         openContextMenuFor(link); // Invoke context menu for next test.
     },
 
     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.
     },
 
     function () {
         // Context menu for text mailto-link
         checkContextMenu(["context-copyemail", true,
                           "context-searchselect", true
@@ -582,90 +569,56 @@ function runTest(testNum) {
         selectText(selecttextlink); // Select text prior to opening context menu.
         openContextMenuFor(selecttextlink); // Invoke context menu for next test.
     },
 
     function () {
         // 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
         subwindow.getSelection().removeAllRanges();
 
         openContextMenuFor(imagelink)
     },
 
     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.
     },
 
     function () {
         // Context menu for selected text in input
         checkContextMenu(["context-undo",        false,