Bug 917398 - Include test for new top sites. r=margaret
authorChenxia Liu <liuche@mozilla.com>
Fri, 20 Sep 2013 13:35:29 -0400
changeset 148103 ccea777b40027e70650fa5325b489a428e0b6587
parent 148102 20d55d6b15ec09fda044979c0c5bdc609795b31f
child 148104 622912e96991e19c0f711e8b91b1cb28285beb88
push id25325
push userryanvm@gmail.com
push dateFri, 20 Sep 2013 22:13:11 +0000
treeherdermozilla-central@354c958ba7d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs917398
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 917398 - Include test for new top sites. r=margaret
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