michael@0: package org.mozilla.gecko.tests; michael@0: michael@0: michael@0: public class testLinkContextMenu extends ContentContextMenuTest { michael@0: michael@0: // Test website strings michael@0: private static String LINK_PAGE_URL; michael@0: private static String BLANK_PAGE_URL; michael@0: private static final String LINK_PAGE_TITLE = "Big Link"; michael@0: private static final String linkMenuItems [] = { "Open Link in New Tab", "Open Link in Private Tab", "Copy Link", "Share Link", "Bookmark Link"}; michael@0: michael@0: public void testLinkContextMenu() { michael@0: blockForGeckoReady(); michael@0: michael@0: LINK_PAGE_URL=getAbsoluteUrl("/robocop/robocop_big_link.html"); michael@0: BLANK_PAGE_URL=getAbsoluteUrl("/robocop/robocop_blank_01.html"); michael@0: inputAndLoadUrl(LINK_PAGE_URL); michael@0: waitForText(LINK_PAGE_TITLE); michael@0: michael@0: verifyContextMenuItems(linkMenuItems); // Verify context menu items are correct michael@0: openTabFromContextMenu(linkMenuItems[0],2); // Test the "Open in New Tab" option - expecting 2 tabs: the original and the new one michael@0: openTabFromContextMenu(linkMenuItems[1],2); // Test the "Open in Private Tab" option - expecting only 2 tabs in normal mode michael@0: verifyCopyOption(linkMenuItems[2], BLANK_PAGE_URL); // Test the "Copy Link" option michael@0: verifyShareOption(linkMenuItems[3], LINK_PAGE_TITLE); // Test the "Share Link" option michael@0: verifyBookmarkLinkOption(linkMenuItems[4], BLANK_PAGE_URL); // Test the "Bookmark Link" option michael@0: } michael@0: michael@0: @Override michael@0: public void tearDown() throws Exception { michael@0: mDatabaseHelper.deleteBookmark(BLANK_PAGE_URL); michael@0: super.tearDown(); michael@0: } michael@0: }