Bug 917398 - Include test for new top sites. r=margaret a=lsblakk
authorChenxia Liu <liuche@mozilla.com>
Fri, 20 Sep 2013 13:35:29 -0400
changeset 155593 0a14b7023a95c56646554e7cb839f9dd8f8b8238
parent 155592 607a8726ced14cbb8358bd4b3640a24b96a1dbe9
child 155594 e0a96465890cab1f20078baaacdced5b585ce8f0
push id4330
push userlrocha@mozilla.com
push dateMon, 30 Sep 2013 16:23:45 +0000
treeherdermozilla-aurora@e0a96465890c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret, lsblakk
bugs917398
milestone26.0a2
Bug 917398 - Include test for new top sites. r=margaret a=lsblakk
mobile/android/base/tests/robocop_blank_04.html
mobile/android/base/tests/robocop_blank_05.html
mobile/android/base/tests/testShareLink.java.in
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/tests/robocop_blank_04.html
@@ -0,0 +1,7 @@
+<html>
+<meta charset="utf-8">
+<title>Browser Blank Page 04</title>
+<body>
+<p>Browser Blank Page 04</p>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/tests/robocop_blank_05.html
@@ -0,0 +1,7 @@
+<html>
+<meta charset="utf-8">
+<title>Browser Blank Page 05</title>
+<body>
+<p>Browser Blank Page 05</p>
+</body>
+</html>
--- a/mobile/android/base/tests/testShareLink.java.in
+++ b/mobile/android/base/tests/testShareLink.java.in
@@ -73,17 +73,43 @@ public class testShareLink extends About
 
         ListView bookmarksList = findListViewWithTag("bookmarks");
         mAsserter.is(waitForListToLoad(bookmarksList), true, "list is properly loaded");
 
         View bookmarksItem = bookmarksList.getChildAt(bookmarksList.getHeaderViewsCount());
         mSolo.clickLongOnView(bookmarksItem);
         verifySharePopup(shareOptions,"bookmarks");
 
-        // TODO: Tests for new top sites list.
+        // Prepopulate top sites with history items to overflow tiles.
+        // We are trying to move away from using reflection and doing more black-box testing.
+        inputAndLoadUrl(getAbsoluteUrl("/robocop/robocop_blank_01.html"));
+        inputAndLoadUrl(getAbsoluteUrl("/robocop/robocop_blank_02.html"));
+        inputAndLoadUrl(getAbsoluteUrl("/robocop/robocop_blank_03.html"));
+        inputAndLoadUrl(getAbsoluteUrl("/robocop/robocop_blank_04.html"));
+        if (mDevice.type.equals("tablet")) {
+            // Tablets have more tile spaces to fill.
+            inputAndLoadUrl(getAbsoluteUrl("/robocop/robocop_blank_05.html"));
+            inputAndLoadUrl(getAbsoluteUrl("/robocop/robocop_boxes.html"));
+            inputAndLoadUrl(getAbsoluteUrl("/robocop/robocop_search.html"));
+            inputAndLoadUrl(getAbsoluteUrl("/robocop/robocop_text_page.html"));
+        }
+
+        // Test the share popup in Top Sites.
+        openAboutHomeTab(AboutHomeTabs.TOP_SITES);
+
+        // Scroll down a bit so that the top sites list has more items on screen.
+        int width = mDriver.getGeckoWidth();
+        int height = mDriver.getGeckoHeight();
+        mActions.drag(width / 2, width / 2, height - 10, height / 2);
+
+        ListView topSitesList = findListViewWithTag("top_sites");
+        mAsserter.is(waitForListToLoad(topSitesList), true, "list is properly loaded");
+        View mostVisitedItem = topSitesList.getChildAt(topSitesList.getHeaderViewsCount());
+        mSolo.clickLongOnView(mostVisitedItem);
+        verifySharePopup(shareOptions,"top_sites");
 
         // Test the share popup in the Most Recent tab
         openAboutHomeTab(AboutHomeTabs.MOST_RECENT);
 
         ListView mostRecentList = findListViewWithTag("most_recent");
         mAsserter.is(waitForListToLoad(mostRecentList), true, "list is properly loaded");
 
         // Getting second child after header views because the first is the "Today" label