Bug 1357639 - part8 : add annotiation @RobocopTarget. draft
authorAlastor Wu <alwu@mozilla.com>
Mon, 08 May 2017 14:10:56 +0800
changeset 573970 b42d9cef62892dba67d5e6c9f5d3336ee4aeeb0a
parent 573969 a65956ccc2f2bd86c0b6b1101f15a1b86c250fc0
child 573971 b406b449d986f8384823b525c723b7de54ca0a56
push id57550
push useralwu@mozilla.com
push dateMon, 08 May 2017 07:06:13 +0000
bugs1357639
milestone55.0a1
Bug 1357639 - part8 : add annotiation @RobocopTarget. To make sure these functions can be used in robocop test. MozReview-Commit-ID: KPAKOrg5Ows
mobile/android/base/java/org/mozilla/gecko/Tabs.java
mobile/android/base/java/org/mozilla/gecko/media/AudioFocusAgent.java
--- a/mobile/android/base/java/org/mozilla/gecko/Tabs.java
+++ b/mobile/android/base/java/org/mozilla/gecko/Tabs.java
@@ -958,16 +958,17 @@ public class Tabs implements BundleEvent
     }
 
     /**
      * Looks for an open tab with the given URL.
      * @param url       the URL of the tab we're looking for
      *
      * @return first Tab with the given URL, or null if there is no such tab.
      */
+    @RobocopTarget
     public Tab getFirstTabForUrl(String url) {
         return getFirstTabForUrlHelper(url, null, TabType.BROWSING);
     }
 
     /**
      * Looks for an open tab with the given URL and private state.
      * @param url       the URL of the tab we're looking for
      * @param isPrivate if true, only look for tabs that are private. if false,
--- a/mobile/android/base/java/org/mozilla/gecko/media/AudioFocusAgent.java
+++ b/mobile/android/base/java/org/mozilla/gecko/media/AudioFocusAgent.java
@@ -141,17 +141,19 @@ public class AudioFocusAgent {
 
     private void notifyMediaControlService(String action) {
         Intent intent = new Intent(mContext, MediaControlService.class);
         intent.setAction(action);
         mContext.startService(intent);
     }
 
     @VisibleForTesting
+    @RobocopTarget
     public State getAudioFocusState() {
         return mAudioFocusState;
     }
 
     @VisibleForTesting
+    @RobocopTarget
     public void changeAudioFocus(int focusChange) {
         mAfChangeListener.onAudioFocusChange(focusChange);
     }
 }