Backed out changesets bb54e487c53e and 882b5ddfc023 (bug 730941) for robocop failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 24 Apr 2014 12:06:02 -0400
changeset 180426 d26a2463dc6bb20b9b206362b9f9df08de3a02dd
parent 180425 bbcb7f37b1760fe56bff7906cdf3cbc84972e90f
child 180427 9a6ce164613574831046489a26a2f85defefa39d
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
bugs730941
milestone31.0a1
backs outbb54e487c53ed820ab0a128ef30a1bf34bbc4a9c
882b5ddfc023fd9518c87f33e8ea19bfce5f85f9
Backed out changesets bb54e487c53e and 882b5ddfc023 (bug 730941) for robocop failures.
mobile/android/base/tests/ContentContextMenuTest.java
mobile/android/base/tests/testPictureLinkContextMenu.java
mobile/android/chrome/content/browser.js
mobile/android/locales/en-US/chrome/browser.properties
--- a/mobile/android/base/tests/ContentContextMenuTest.java
+++ b/mobile/android/base/tests/ContentContextMenuTest.java
@@ -1,18 +1,15 @@
 package org.mozilla.gecko.tests;
 
 import org.mozilla.gecko.Actions;
-import org.mozilla.gecko.Element;
-import org.mozilla.gecko.R;
 import org.mozilla.gecko.util.Clipboard;
 
 import android.util.DisplayMetrics;
 
-import com.jayway.android.robotium.solo.Condition;
 
 /**
  * This class covers interactions with the context menu opened from web content
  */
 abstract class ContentContextMenuTest extends PixelTest {
     private static final int MAX_TEST_TIMEOUT = 10000;
 
     // This method opens the context menu of any web content. It assumes that the page is already loaded
@@ -63,32 +60,16 @@ abstract class ContentContextMenuTest ex
 
     protected void switchTabs(String tab) {
         if (!mSolo.searchText(tab)) {
             openWebContentContextMenu(tab);
         }
         mSolo.clickOnText(tab);
     }
 
-    protected void verifyViewImageOption(final String viewImageOption, final String imageUrl) {
-        if (!mSolo.searchText(viewImageOption)) {
-            openWebContentContextMenu(viewImageOption);
-        }
-        mSolo.clickOnText(viewImageOption);
-        boolean viewedImage = waitForCondition(new Condition() {
-            @Override
-            public boolean isSatisfied() {
-                final Element urlBarElement = mDriver.findElement(getActivity(), R.id.url_edit_text);
-                final String loadedUrl = urlBarElement.getText();
-                return loadedUrl.contentEquals(imageUrl);
-            }
-        }, MAX_TEST_TIMEOUT);
-        mAsserter.ok(viewedImage, "Checking if the image is correctly viewed", "The image was correctly viewed");
-        mSolo.goBack();
-    }
 
     protected void verifyCopyOption(String copyOption, final String copiedText) {
         if (!mSolo.searchText(copyOption)) {
             openWebContentContextMenu(copyOption); // Open the context menu if it is not already
         }
         mSolo.clickOnText(copyOption);
         boolean correctText = waitForTest(new BooleanTest() {
             @Override
--- a/mobile/android/base/tests/testPictureLinkContextMenu.java
+++ b/mobile/android/base/tests/testPictureLinkContextMenu.java
@@ -1,40 +1,37 @@
 package org.mozilla.gecko.tests;
 
 
 public class testPictureLinkContextMenu extends ContentContextMenuTest {
 
     // Test website strings
     private static String PICTURE_PAGE_URL;
     private static String BLANK_PAGE_URL;
-    private static String PICTURE_URL;
     private static final String PICTURE_PAGE_TITLE = "Picture Link";
     private static final String tabs [] = { "Image", "Link" };
-    private static final String photoMenuItems [] = { "Copy Image Location", "Share Image", "View Image", "Set Image As", "Save Image" };
+    private static final String photoMenuItems [] = { "Copy Image Location", "Share Image", "Set Image As", "Save Image" };
     private static final String linkMenuItems [] = { "Open Link in New Tab", "Open Link in Private Tab", "Copy Link", "Share Link", "Bookmark Link"};
     private static final String imageTitle = "^Image$";
 
     public void testPictureLinkContextMenu() {
         blockForGeckoReady();
 
         PICTURE_PAGE_URL=getAbsoluteUrl("/robocop/robocop_picture_link.html");
         BLANK_PAGE_URL=getAbsoluteUrl("/robocop/robocop_blank_02.html");
-        PICTURE_URL=getAbsoluteUrl("/robocop/Firefox.jpg");
         loadAndPaint(PICTURE_PAGE_URL);
         verifyPageTitle(PICTURE_PAGE_TITLE);
 
         switchTabs(imageTitle);
         verifyContextMenuItems(photoMenuItems);
         verifyTabs(tabs);
         switchTabs(imageTitle);
         verifyCopyOption(photoMenuItems[0], "Firefox.jpg"); // Test the "Copy Image Location" option
         switchTabs(imageTitle);
         verifyShareOption(photoMenuItems[1], PICTURE_PAGE_TITLE); // Test the "Share Image" option
-        verifyViewImageOption(photoMenuItems[2], PICTURE_URL); // Test the "View Image" option
 
         verifyContextMenuItems(linkMenuItems);
         openTabFromContextMenu(linkMenuItems[0],2); // Test the "Open in New Tab" option - expecting 2 tabs: the original and the new one
         openTabFromContextMenu(linkMenuItems[1],2); // Test the "Open in Private Tab" option - expecting only 2 tabs in normal mode
         verifyCopyOption(linkMenuItems[2], BLANK_PAGE_URL); // Test the "Copy Link" option
         verifyShareOption(linkMenuItems[3], PICTURE_PAGE_TITLE); // Test the "Share Link" option
         verifyBookmarkLinkOption(linkMenuItems[4],BLANK_PAGE_URL); // Test the "Bookmark Link" option
     }
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -647,25 +647,16 @@ var BrowserApp = {
       });
 
     NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.unmute"),
       NativeWindow.contextmenus.mediaContext("media-muted"),
       function(aTarget) {
         aTarget.muted = false;
       });
 
-    NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.viewImage"),
-      NativeWindow.contextmenus.imageLocationCopyableContext,
-      function(aTarget) {
-        let url = aTarget.src;
-        ContentAreaUtils.urlSecurityCheck(url, aTarget.ownerDocument.nodePrincipal,
-                                          Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
-        BrowserApp.loadURI(url);
-      });
-
     NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.copyImageLocation"),
       NativeWindow.contextmenus.imageLocationCopyableContext,
       function(aTarget) {
         let url = aTarget.src;
         NativeWindow.contextmenus._copyStringToDefaultClipboard(url);
       });
 
     NativeWindow.contextmenus.add({
--- a/mobile/android/locales/en-US/chrome/browser.properties
+++ b/mobile/android/locales/en-US/chrome/browser.properties
@@ -169,17 +169,16 @@ contextmenu.copyLink=Copy Link
 contextmenu.shareLink=Share Link
 contextmenu.bookmarkLink=Bookmark Link
 contextmenu.copyEmailAddress=Copy Email Address
 contextmenu.shareEmailAddress=Share Email Address
 contextmenu.copyPhoneNumber=Copy Phone Number
 contextmenu.sharePhoneNumber=Share Phone Number
 contextmenu.changeInputMethod=Select Input Method
 contextmenu.fullScreen=Full Screen
-contextmenu.viewImage=View Image
 contextmenu.copyImageLocation=Copy Image Location
 contextmenu.shareImage=Share Image
 # LOCALIZATION NOTE (contextmenu.search):
 # The label of the contextmenu item which allows you to search with your default search engine for
 # the text you have selected. %S is the name of the search engine. For example, "Google".
 contextmenu.search=%S Search
 contextmenu.saveImage=Save Image
 contextmenu.setImageAs=Set Image As