Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 package org.mozilla.gecko.tests;
4 public class testPictureLinkContextMenu extends ContentContextMenuTest {
6 // Test website strings
7 private static String PICTURE_PAGE_URL;
8 private static String BLANK_PAGE_URL;
9 private static final String PICTURE_PAGE_TITLE = "Picture Link";
10 private static final String tabs [] = { "Image", "Link" };
11 private static final String photoMenuItems [] = { "Copy Image Location", "Share Image", "Set Image As", "Save Image" };
12 private static final String linkMenuItems [] = { "Open Link in New Tab", "Open Link in Private Tab", "Copy Link", "Share Link", "Bookmark Link"};
13 private static final String imageTitle = "^Image$";
15 public void testPictureLinkContextMenu() {
16 blockForGeckoReady();
18 PICTURE_PAGE_URL=getAbsoluteUrl("/robocop/robocop_picture_link.html");
19 BLANK_PAGE_URL=getAbsoluteUrl("/robocop/robocop_blank_02.html");
20 loadAndPaint(PICTURE_PAGE_URL);
21 verifyPageTitle(PICTURE_PAGE_TITLE);
23 switchTabs(imageTitle);
24 verifyContextMenuItems(photoMenuItems);
25 verifyTabs(tabs);
26 switchTabs(imageTitle);
27 verifyCopyOption(photoMenuItems[0], "Firefox.jpg"); // Test the "Copy Image Location" option
28 switchTabs(imageTitle);
29 verifyShareOption(photoMenuItems[1], PICTURE_PAGE_TITLE); // Test the "Share Image" option
31 verifyContextMenuItems(linkMenuItems);
32 openTabFromContextMenu(linkMenuItems[0],2); // Test the "Open in New Tab" option - expecting 2 tabs: the original and the new one
33 openTabFromContextMenu(linkMenuItems[1],2); // Test the "Open in Private Tab" option - expecting only 2 tabs in normal mode
34 verifyCopyOption(linkMenuItems[2], BLANK_PAGE_URL); // Test the "Copy Link" option
35 verifyShareOption(linkMenuItems[3], PICTURE_PAGE_TITLE); // Test the "Share Link" option
36 verifyBookmarkLinkOption(linkMenuItems[4],BLANK_PAGE_URL); // Test the "Bookmark Link" option
37 }
39 @Override
40 public void tearDown() throws Exception {
41 mDatabaseHelper.deleteBookmark(BLANK_PAGE_URL);
42 super.tearDown();
43 }
44 }