Wed, 31 Dec 2014 07:22:50 +0100
Correct previous dual key logic pending first delivery installment.
michael@0 | 1 | package org.mozilla.gecko.tests; |
michael@0 | 2 | |
michael@0 | 3 | |
michael@0 | 4 | public class testLinkContextMenu extends ContentContextMenuTest { |
michael@0 | 5 | |
michael@0 | 6 | // Test website strings |
michael@0 | 7 | private static String LINK_PAGE_URL; |
michael@0 | 8 | private static String BLANK_PAGE_URL; |
michael@0 | 9 | private static final String LINK_PAGE_TITLE = "Big Link"; |
michael@0 | 10 | private static final String linkMenuItems [] = { "Open Link in New Tab", "Open Link in Private Tab", "Copy Link", "Share Link", "Bookmark Link"}; |
michael@0 | 11 | |
michael@0 | 12 | public void testLinkContextMenu() { |
michael@0 | 13 | blockForGeckoReady(); |
michael@0 | 14 | |
michael@0 | 15 | LINK_PAGE_URL=getAbsoluteUrl("/robocop/robocop_big_link.html"); |
michael@0 | 16 | BLANK_PAGE_URL=getAbsoluteUrl("/robocop/robocop_blank_01.html"); |
michael@0 | 17 | inputAndLoadUrl(LINK_PAGE_URL); |
michael@0 | 18 | waitForText(LINK_PAGE_TITLE); |
michael@0 | 19 | |
michael@0 | 20 | verifyContextMenuItems(linkMenuItems); // Verify context menu items are correct |
michael@0 | 21 | openTabFromContextMenu(linkMenuItems[0],2); // Test the "Open in New Tab" option - expecting 2 tabs: the original and the new one |
michael@0 | 22 | openTabFromContextMenu(linkMenuItems[1],2); // Test the "Open in Private Tab" option - expecting only 2 tabs in normal mode |
michael@0 | 23 | verifyCopyOption(linkMenuItems[2], BLANK_PAGE_URL); // Test the "Copy Link" option |
michael@0 | 24 | verifyShareOption(linkMenuItems[3], LINK_PAGE_TITLE); // Test the "Share Link" option |
michael@0 | 25 | verifyBookmarkLinkOption(linkMenuItems[4], BLANK_PAGE_URL); // Test the "Bookmark Link" option |
michael@0 | 26 | } |
michael@0 | 27 | |
michael@0 | 28 | @Override |
michael@0 | 29 | public void tearDown() throws Exception { |
michael@0 | 30 | mDatabaseHelper.deleteBookmark(BLANK_PAGE_URL); |
michael@0 | 31 | super.tearDown(); |
michael@0 | 32 | } |
michael@0 | 33 | } |