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