Skip to content

Commit

Permalink
Android: remove isAtLeastO from robolectric test
Browse files Browse the repository at this point in the history
This removes the final use of BuildInfo.isAtLeastO from chromium code.

This was previously blocked on robolectric not supporting O (but this
has since been resolved by crbug.com/729135).

Bug: 783418
Test: ninja chrome_junit_tests
Change-Id: Ib7d4af9ff74912ccadfa3c9cae57553f3a217e94
Reviewed-on: https://chromium-review.googlesource.com/806745
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521811}
  • Loading branch information
ntfschr-chromium authored and Commit Bot committed Dec 5, 2017
1 parent c5d4791 commit 2c73cf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
23 changes: 1 addition & 22 deletions base/android/java/src/org/chromium/base/BuildInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,7 @@ public static boolean isDebugAndroid() {

// The markers Begin:BuildCompat and End:BuildCompat delimit code
// that is autogenerated from Android sources.
// Begin:BuildCompat O,OMR1,P

/**
* Checks if the device is running on a pre-release version of Android O or newer.
* <p>
* @return {@code true} if O APIs are available for use, {@code false} otherwise
* @deprecated Android O is a finalized release and this method is no longer necessary. It will
* be removed in a future release of the Support Library. Instead use
* {@code Build.SDK_INT >= Build.VERSION_CODES#O}.
*/
@Deprecated
public static boolean isAtLeastO() {
return VERSION.SDK_INT >= 26;
}
// Begin:BuildCompat OMR1,P

/**
* Checks if the device is running on a pre-release version of Android O MR1 or newer.
Expand Down Expand Up @@ -168,14 +155,6 @@ public static boolean isAtLeastP() {
return VERSION.CODENAME.equals("P");
}

/**
* Checks if the application targets at least released SDK O
*/
@Deprecated
public static boolean targetsAtLeastO() {
return ContextUtils.getApplicationContext().getApplicationInfo().targetSdkVersion >= 26;
}

/**
* Checks if the application targets at least released SDK OMR1
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import org.chromium.base.BaseChromiumApplication;
import org.chromium.base.BaseSwitches;
import org.chromium.base.BuildInfo;
import org.chromium.base.CommandLine;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.media.ui.MediaNotificationManager.ListenerService;
Expand Down Expand Up @@ -88,7 +87,8 @@ public void testSetNotificationIcon_lowMem_O() {

mTabHolder.simulateMediaSessionStateChanged(true, false);
mTabHolder.simulateFaviconUpdated(mFavicon);
assertEquals(BuildInfo.isAtLeastO() ? null : mFavicon, getDisplayedIcon());
assertEquals(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ? null : mFavicon,
getDisplayedIcon());
}

private Bitmap getDisplayedIcon() {
Expand Down

0 comments on commit 2c73cf0

Please sign in to comment.