Merge m-c to b2g-inbound
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Thu, 26 Sep 2013 15:53:39 +0200
changeset 148886 589d669ef848e15662b36fcb554d94213ce2c435
parent 148885 70ec111942ca8da98490698d1d71dce5d6ecbca0 (current diff)
parent 148796 1be9c19c23ee195b3983e4f1622c5a45ae3690ea (diff)
child 148887 03ee2343b34ef71bfc484716cc91a92de69c7acf
push id34380
push userryanvm@gmail.com
push dateFri, 27 Sep 2013 01:41:00 +0000
treeherdermozilla-inbound@fdc6054e33e4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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
Merge m-c to b2g-inbound
--- a/browser/base/content/browser-plugins.js
+++ b/browser/base/content/browser-plugins.js
@@ -419,17 +419,17 @@ var gPluginHandler = {
   // Callback for user clicking on a disabled plugin
   managePlugins: function (aEvent) {
     BrowserOpenAddonsMgr("addons://list/plugin");
   },
 
   // Callback for user clicking on the link in a click-to-play plugin
   // (where the plugin has an update)
   openPluginUpdatePage: function (aEvent) {
-    openURL(Services.urlFormatter.formatURLPref("plugins.update.url"));
+    openUILinkIn(Services.urlFormatter.formatURLPref("plugins.update.url"), "tab");
   },
 
 #ifdef MOZ_CRASHREPORTER
   submitReport: function submitReport(pluginDumpID, browserDumpID, plugin) {
     let keyVals = {};
     if (plugin) {
       let userComment = this.getPluginUI(plugin, "submitComment").value.trim();
       if (userComment)
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -2127,18 +2127,17 @@
         <body><![CDATA[
           this._viewsLeft = 0;
           this.hidden = true;
         ]]></body>
       </method>
       <method name="onLinkClick">
         <body><![CDATA[
           // Open a new selected tab and close the current panel.
-          gBrowser.loadOneTab(this._promolink.getAttribute("href"),
-                              { inBackground: false });
+          openUILinkIn(this._promolink.getAttribute("href"), "tab");
           this._panel.hidePopup();
         ]]></body>
       </method>
       <method name="handleEvent">
         <parameter name="event"/>
         <body><![CDATA[
           if (event.type != "popupshowing" || event.target != this._panel)
             return;
--- a/mobile/android/base/background/healthreport/HealthReportBroadcastService.java
+++ b/mobile/android/base/background/healthreport/HealthReportBroadcastService.java
@@ -114,17 +114,18 @@ public class HealthReportBroadcastServic
    */
   protected boolean attemptHandleIntentForUpload(final Intent intent) {
     if (HealthReportConstants.UPLOAD_FEATURE_DISABLED) {
       Logger.debug(LOG_TAG, "Health report upload feature is compile-time disabled; not handling intent.");
       return false;
     }
 
     final String action = intent.getAction();
-    Logger.debug(LOG_TAG, "Health report upload feature is compile-time enabled; handling intent with action " + action + ".");
+    Logger.debug(LOG_TAG, "Health report upload feature is compile-time enabled; attempting to " +
+        "handle intent with action " + action + ".");
 
     if (HealthReportConstants.ACTION_HEALTHREPORT_UPLOAD_PREF.equals(action)) {
       handleUploadPrefIntent(intent);
       return true;
     }
 
     if (Intent.ACTION_BOOT_COMPLETED.equals(action) ||
         Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(action)) {
@@ -191,17 +192,17 @@ public class HealthReportBroadcastServic
     toggleSubmissionAlarm(this, profileName, profilePath, enabled, serviceEnabled);
   }
 
   /**
    * Attempts to handle the given intent for FHR data pruning. If it cannot, false is returned.
    */
   protected boolean attemptHandleIntentForPrune(final Intent intent) {
     final String action = intent.getAction();
-    Logger.debug(LOG_TAG, "Prune: Handling intent with action, " + action + ".");
+    Logger.debug(LOG_TAG, "Prune: Attempting to handle intent with action, " + action + ".");
 
     if (HealthReportConstants.ACTION_HEALTHREPORT_PRUNE.equals(action)) {
       handlePruneIntent(intent);
       return true;
     }
 
     if (Intent.ACTION_BOOT_COMPLETED.equals(action) ||
         Intent.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE.equals(action)) {
--- a/mobile/android/base/background/healthreport/prune/PrunePolicy.java
+++ b/mobile/android/base/background/healthreport/prune/PrunePolicy.java
@@ -77,16 +77,18 @@ public class PrunePolicy {
       return false;
     }
 
     if (nextPrune > time) {
       Logger.debug(LOG_TAG, "Skipping prune-by-size - wait period has not yet elapsed.");
       return false;
     }
 
+    Logger.debug(LOG_TAG, "Attempting prune-by-size.");
+
     // Prune environments first because their cascading deletions may delete some events. These
     // environments are pruned in order of least-recently used first. Note that orphaned
     // environments are ignored here and should be removed elsewhere.
     final int environmentCount = storage.getEnvironmentCount();
     if (environmentCount > getMaxEnvironmentCount()) {
       final int environmentPruneCount = environmentCount - getEnvironmentCountAfterPrune();
       Logger.debug(LOG_TAG, "Pruning " + environmentPruneCount + " environments.");
       storage.pruneEnvironments(environmentPruneCount);
@@ -148,16 +150,17 @@ public class PrunePolicy {
     }
 
     if (nextCleanup > time) {
       Logger.debug(LOG_TAG, "Skipping cleanup - wait period has not yet elapsed.");
       return false;
     }
 
     editor.setNextCleanupTime(time + getMinimumTimeBetweenCleanupChecks());
+    Logger.debug(LOG_TAG, "Cleaning up storage.");
     storage.cleanup();
     return true;
   }
 
   protected static class Editor {
     protected final SharedPreferences.Editor editor;
 
     public Editor(final SharedPreferences.Editor editor) {
--- a/mobile/android/base/home/BrowserSearch.java
+++ b/mobile/android/base/home/BrowserSearch.java
@@ -220,16 +220,17 @@ public class BrowserSearch extends HomeF
         mList = null;
         mSuggestionsOptInPrompt = null;
         mSuggestClient = null;
     }
 
     @Override
     public void onViewCreated(View view, Bundle savedInstanceState) {
         super.onViewCreated(view, savedInstanceState);
+        mList.setTag(HomePager.LIST_TAG_BROWSER_SEARCH);
 
         mList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
             @Override
             public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                 // Perform the user-entered search if the user clicks on a search engine row.
                 // This row will be disabled if suggestions (in addition to the user-entered term) are showing.
                 if (view instanceof SearchEngineRow) {
                     ((SearchEngineRow) view).performUserEnteredSearch();
--- a/mobile/android/base/home/HomePager.java
+++ b/mobile/android/base/home/HomePager.java
@@ -47,16 +47,17 @@ public class HomePager extends ViewPager
     // This is mostly used by UI tests to easily fetch
     // specific list views at runtime.
     static final String LIST_TAG_HISTORY = "history";
     static final String LIST_TAG_BOOKMARKS = "bookmarks";
     static final String LIST_TAG_READING_LIST = "reading_list";
     static final String LIST_TAG_TOP_SITES = "top_sites";
     static final String LIST_TAG_MOST_RECENT = "most_recent";
     static final String LIST_TAG_LAST_TABS = "last_tabs";
+    static final String LIST_TAG_BROWSER_SEARCH = "browser_search";
 
     private EnumMap<Page, Fragment> mPages = new EnumMap<Page, Fragment>(Page.class);
 
     public interface OnUrlOpenListener {
         public enum Flags {
             ALLOW_SWITCH_TO_TAB
         }
 
--- 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";
 
--- a/mobile/android/services/manifests/HealthReportAndroidManifest_activities.xml.in
+++ b/mobile/android/services/manifests/HealthReportAndroidManifest_activities.xml.in
@@ -1,28 +1,27 @@
         <provider android:name="org.mozilla.gecko.background.healthreport.HealthReportProvider"
                   android:authorities="@ANDROID_PACKAGE_NAME@.health"
                   android:permission="@ANDROID_PACKAGE_NAME@.permissions.HEALTH_PROVIDER">
         </provider>
 
-        <!-- As well as system actions, we also listen for "Health
-             Report upload preference changed" notifications sent by
-             Fennec: @ANDROID_PACKAGE_NAME@.HEALTHREPORT_UPLOAD_PREF.
-
-             BroadcastReceiver is a thin receiver whose purpose is to
-             start the background service in response to external events.
+        <!-- BroadcastReceiver is a thin receiver whose purpose is to
+             start the background service in response to external events,
+             some sent by the system and some particular to Health Report.
           -->
         <receiver android:name="org.mozilla.gecko.background.healthreport.HealthReportBroadcastReceiver" >
             <intent-filter>
                 <!-- Startup. -->
                 <action android:name="android.intent.action.BOOT_COMPLETED" />
             </intent-filter>
             <intent-filter>
                 <!-- SD card remounted. -->
                 <action android:name="android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE" />
             </intent-filter>
             <intent-filter >
-              <action android:name="@ANDROID_PACKAGE_NAME@.HEALTHREPORT_UPLOAD_PREF" />
+                <!-- Toggle Health Report upload service alarm (based on preferences value) -->
+                <action android:name="@ANDROID_PACKAGE_NAME@.HEALTHREPORT_UPLOAD_PREF" />
             </intent-filter>
             <intent-filter >
-              <action android:name="@ANDROID_PACKAGE_NAME@.HEALTHREPORT_PRUNE" />
+                <!-- Enable Health Report prune service alarm -->
+                <action android:name="@ANDROID_PACKAGE_NAME@.HEALTHREPORT_PRUNE" />
             </intent-filter>
         </receiver>
--- a/mobile/android/services/manifests/HealthReportAndroidManifest_services.xml.in
+++ b/mobile/android/services/manifests/HealthReportAndroidManifest_services.xml.in
@@ -1,13 +1,12 @@
-        <!-- We have two services.  BroadcastService responds to
-             external events and starts the regular Service, which
-             does the actual background work, in a uniform manner.  We
-             don't export either of these services, since they are
-             only started by receivers internal to the Fennec package.
+        <!-- BroadcastService responds to external events and starts
+             the other background services. We don't export any of
+             these services, since they are only started by components
+             internal to the Fennec package.
           -->
         <service
             android:exported="false"
             android:name="org.mozilla.gecko.background.healthreport.HealthReportBroadcastService" >
         </service>
         <service
             android:exported="false"
             android:name="org.mozilla.gecko.background.healthreport.upload.HealthReportUploadService" >