Bug 917944 - Remove "Most recent" header in history page, r=margaret
authorMark Capella <markcapella@twcny.rr.com>
Wed, 25 Sep 2013 21:48:16 -0400
changeset 162596 1c5e6b8ebbde8f18b96ae5b2929820e3b6f0d18c
parent 162595 500235e48132dd3a164a1a89adf46166cbfc1c17
child 162597 160ec7af5cb95369a0d5338ae035999f89563ee6
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs917944
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 917944 - Remove "Most recent" header in history page, r=margaret
mobile/android/base/home/MostRecentPage.java
mobile/android/base/tests/AboutHomeTest.java.in
mobile/android/base/tests/StringHelper.java.in
--- a/mobile/android/base/home/MostRecentPage.java
+++ b/mobile/android/base/home/MostRecentPage.java
@@ -43,19 +43,16 @@ public class MostRecentPage extends Home
     private static final int LOADER_ID_HISTORY = 0;
 
     // Adapter for the list of search results
     private MostRecentAdapter mAdapter;
 
     // The view shown by the fragment.
     private ListView mList;
 
-    // The title for this HomeFragment page.
-    private TextView mTitle;
-
     // Reference to the View to display when there are no results.
     private View mEmptyView;
 
     // Callbacks used for the search and favicon cursor loaders
     private CursorLoaderCallbacks mCursorLoaderCallbacks;
 
     // On URL open listener
     private OnUrlOpenListener mUrlOpenListener;
@@ -88,21 +85,16 @@ public class MostRecentPage extends Home
 
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
         return inflater.inflate(R.layout.home_most_recent_page, container, false);
     }
 
     @Override
     public void onViewCreated(View view, Bundle savedInstanceState) {
-        mTitle = (TextView) view.findViewById(R.id.title);
-        if (mTitle != null) {
-            mTitle.setText(R.string.home_most_recent_title);
-        }
-
         mList = (ListView) view.findViewById(R.id.list);
         mList.setTag(HomePager.LIST_TAG_MOST_RECENT);
 
         mList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
             @Override
             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                 position -= mAdapter.getMostRecentSectionsCountBefore(position);
                 final Cursor c = mAdapter.getCursor(position);
@@ -115,17 +107,16 @@ public class MostRecentPage extends Home
 
         registerForContextMenu(mList);
     }
 
     @Override
     public void onDestroyView() {
         super.onDestroyView();
         mList = null;
-        mTitle = null;
         mEmptyView = null;
     }
 
     @Override
     public void onActivityCreated(Bundle savedInstanceState) {
         super.onActivityCreated(savedInstanceState);
 
         // Intialize adapter
@@ -154,28 +145,20 @@ public class MostRecentPage extends Home
         public Cursor loadCursor() {
             final ContentResolver cr = getContext().getContentResolver();
             return BrowserDB.getRecentHistory(cr, HISTORY_LIMIT);
         }
     }
 
     private void updateUiFromCursor(Cursor c) {
         if (c != null && c.getCount() > 0) {
-            if (mTitle != null) {
-                mTitle.setVisibility(View.VISIBLE);
-            }
             return;
         }
 
-        // Cursor is empty, so hide the title and set the
-        // empty view if it hasn't been set already.
-        if (mTitle != null) {
-            mTitle.setVisibility(View.GONE);
-        }
-
+        // Cursor is empty, so set the empty view if it hasn't been set already.
         if (mEmptyView == null) {
             // Set empty page view. We delay this so that the empty view won't flash.
             final ViewStub emptyViewStub = (ViewStub) getView().findViewById(R.id.home_empty_view_stub);
             mEmptyView = emptyViewStub.inflate();
 
             final ImageView emptyIcon = (ImageView) mEmptyView.findViewById(R.id.home_empty_image);
             emptyIcon.setImageResource(R.drawable.icon_most_recent_empty);
 
--- a/mobile/android/base/tests/AboutHomeTest.java.in
+++ b/mobile/android/base/tests/AboutHomeTest.java.in
@@ -210,17 +210,18 @@ abstract class AboutHomeTest extends Bas
             // Just click for tablets, since all the titles are visible.
             if (AboutHomeTabs.MOST_RECENT == tab || AboutHomeTabs.TABS_FROM_LAST_TIME == tab) {
                 mSolo.clickOnText(AboutHomeTabs.HISTORY.toString());
                 TabWidget tabwidget = (TabWidget)mSolo.getView(TabWidget.class, 0);
 
                 switch (tab) {
                     case MOST_RECENT: {
                         mSolo.clickOnView(tabwidget.getChildAt(0));
-                        mAsserter.ok(waitForText(StringHelper.MOST_RECENT_LABEL), "Checking that we are in the most recent tab of about:home", "We are in the most recent tab");
+                        // We can determine if we are on the MOST_RECENT tab only if pages were first visited during the test
+                        mAsserter.ok(waitForText(StringHelper.TODAY_LABEL), "Checking that we are in the most recent tab of about:home", "We are in the most recent tab");
                         break;
                     }
                     case TABS_FROM_LAST_TIME: {
                         mSolo.clickOnView(tabwidget.getChildAt(1));
                         mAsserter.ok(waitForText(StringHelper.TABS_FROM_LAST_TIME_LABEL), "Checking that we are in the Tabs from last time tab of about:home", "We are in the Tabs from last time tab");
                         break;
                     }
                 }
@@ -246,17 +247,18 @@ abstract class AboutHomeTest extends Bas
             }
             case MOST_RECENT: {
                 // MOST_RECENT is contained in the HISTORY tab.
                 tabOffset = aboutHomeTabs.indexOf(AboutHomeTabs.HISTORY.toString()) - currentTabIndex;
                 swipeAboutHome(tabOffset);
                 waitForAboutHomeTab(aboutHomeTabs.indexOf(StringHelper.HISTORY_LABEL));
                 TabWidget tabwidget = (TabWidget)mSolo.getView(TabWidget.class, 0);
                 mSolo.clickOnView(tabwidget.getChildAt(0));
-                mAsserter.ok(waitForText(StringHelper.MOST_RECENT_LABEL), "Checking that we are in the most recent tab of about:home", "We are in the most recent tab");
+                // We can determine if we are on the MOST_RECENT tab only if pages were first visited during the test
+                mAsserter.ok(waitForText(StringHelper.TODAY_LABEL), "Checking that we are in the most recent tab of about:home", "We are in the most recent tab");
                 break;
             }
             case TABS_FROM_LAST_TIME: {
                 // TABS_FROM_LAST_TIME is contained in the HISTORY tab.
                 tabOffset = aboutHomeTabs.indexOf(AboutHomeTabs.HISTORY.toString()) - currentTabIndex;
                 swipeAboutHome(tabOffset);
                 waitForAboutHomeTab(aboutHomeTabs.indexOf(StringHelper.HISTORY_LABEL));
                 TabWidget tabwidget = (TabWidget)mSolo.getView(TabWidget.class, 0);
--- a/mobile/android/base/tests/StringHelper.java.in
+++ b/mobile/android/base/tests/StringHelper.java.in
@@ -88,17 +88,17 @@ class StringHelper {
     public static final String REMOTE_DEBUGGING_LABEL = "Remote debugging";
     public static final String LEARN_MORE_LABEL = "Learn more";
 
     // Labels for the about:home tabs
     public static final String HISTORY_LABEL = "HISTORY";
     public static final String TOP_SITES_LABEL = "TOP SITES";
     public static final String BOOKMARKS_LABEL = "BOOKMARKS";
     public static final String READING_LIST_LABEL = "READING LIST";
-    public static final String MOST_RECENT_LABEL = "Most recent";
+    public static final String TODAY_LABEL = "Today";
     public static final String TABS_FROM_LAST_TIME_LABEL = "Open all tabs from last time";
 
     // Desktop default bookmarks folders
     public static final String DESKTOP_FOLDER_LABEL = "Desktop Bookmarks";
     public static final String TOOLBAR_FOLDER_LABEL = "Bookmarks Toolbar";
     public static final String BOOKMARKS_MENU_FOLDER_LABEL = "Bookmarks Menu";
     public static final String UNSORTED_FOLDER_LABEL = "Unsorted Bookmarks";