|
|
Chromium Code Reviews
DescriptionFixup tests for Android N in chrome.browser.notifications
No longer need to @SuppressLint in any of these files :)
BUG=643182, 528076, 501900
Committed: https://crrev.com/edcfa0258d501c3b93e0bbc00dd72f53380940bb
Cr-Commit-Position: refs/heads/master@{#416611}
Patch Set 1 : Fixup tests for Android N in chrome.browser.notifications #
Total comments: 4
Patch Set 2 : Review comments (test utils file + use hidden things on J) #
Total comments: 2
Patch Set 3 : Fixup tests for Android N in chrome.browser.notifications #Patch Set 4 : add assert as suggested #
Messages
Total messages: 34 (24 generated)
The CQ bit was checked by awdf@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
The CQ bit was checked by awdf@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
awdf@chromium.org changed reviewers: + peter@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Fixup tests for Android N in chrome.browser.notifications No longer need to @SuppressLint in any of these files :) BUG=643182,605963,528076,501900 ========== to ========== Fixup tests for Android N in chrome.browser.notifications No longer need to @SuppressLint in any of these files :) BUG=643182,528076,501900 ==========
Patchset #1 (id:1) has been deleted
Patchset #1 (id:20001) has been deleted
Patchset #1 (id:40001) has been deleted
Cool, thanks! https://codereview.chromium.org/2303373002/diff/60001/chrome/android/javatest... File chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java (right): https://codereview.chromium.org/2303373002/diff/60001/chrome/android/javatest... chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java:93: // Notification.extras was added in Android K. It's unfortunate that we lose test coverage for these (important) fields in JellyBean. I see that |notification.extras|, but also the constants and |notification.actions|, exist in JellyBean but were annotated with @hide, which means they wouldn't show up in the API documentations. That's why these tests used to pass on JB too. Could we perhaps extract these to utility methods as well, annotating them to suppress the warning, and rely on the fact that nobody will modify JB anymore? https://codereview.chromium.org/2303373002/diff/60001/chrome/android/javatest... chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java:318: return ((BitmapDrawable) icon.loadDrawable(context)).getBitmap(); Some of these methods are being repeated in the other files. Should we separate them out to a NotificationTestUtil file of sorts?
Patchset #2 (id:80001) has been deleted
https://codereview.chromium.org/2303373002/diff/60001/chrome/android/javatest... File chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java (right): https://codereview.chromium.org/2303373002/diff/60001/chrome/android/javatest... chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java:93: // Notification.extras was added in Android K. On 2016/09/05 12:41:34, Peter Beverloo wrote: > It's unfortunate that we lose test coverage for these (important) fields in > JellyBean. > > I see that |notification.extras|, but also the constants and > |notification.actions|, exist in JellyBean but were annotated with @hide, which > means they wouldn't show up in the API documentations. That's why these tests > used to pass on JB too. > > Could we perhaps extract these to utility methods as well, annotating them to > suppress the warning, and rely on the fact that nobody will modify JB anymore? Done. https://codereview.chromium.org/2303373002/diff/60001/chrome/android/javatest... chrome/android/javatests/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilderTest.java:318: return ((BitmapDrawable) icon.loadDrawable(context)).getBitmap(); On 2016/09/05 12:41:34, Peter Beverloo wrote: > Some of these methods are being repeated in the other files. Should we separate > them out to a NotificationTestUtil file of sorts? Done.
lgtm! Thank you! https://codereview.chromium.org/2303373002/diff/100001/chrome/android/javates... File chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationTestUtil.java (right): https://codereview.chromium.org/2303373002/diff/100001/chrome/android/javates... chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationTestUtil.java:42: return ((BitmapDrawable) icon.loadDrawable(context)).getBitmap(); Even though "assert" statements are still no-ops in our builds, what about adding the following for documentation purposes? (Which automagically becomes functional when "assert" does start doing something.) assert Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
The CQ bit was checked by awdf@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2303373002/diff/100001/chrome/android/javates... File chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationTestUtil.java (right): https://codereview.chromium.org/2303373002/diff/100001/chrome/android/javates... chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationTestUtil.java:42: return ((BitmapDrawable) icon.loadDrawable(context)).getBitmap(); On 2016/09/05 15:29:59, Peter Beverloo wrote: > Even though "assert" statements are still no-ops in our builds, what about > adding the following for documentation purposes? (Which automagically becomes > functional when "assert" does start doing something.) > > assert Build.VERSION.SDK_INT >= Build.VERSION_CODES.M; Done. It adds a lint warning in Android Studio ("Assertions are unreliable") but doesn't seem to produce extra warnings when building from the command line, so I guess I'll just disable that inspection in Android Studio.
The CQ bit was checked by awdf@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by awdf@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from peter@chromium.org Link to the patchset: https://codereview.chromium.org/2303373002/#ps140001 (title: "add assert as suggested")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Fixup tests for Android N in chrome.browser.notifications No longer need to @SuppressLint in any of these files :) BUG=643182,528076,501900 ========== to ========== Fixup tests for Android N in chrome.browser.notifications No longer need to @SuppressLint in any of these files :) BUG=643182,528076,501900 ==========
Message was sent while issue was closed.
Committed patchset #4 (id:140001)
Message was sent while issue was closed.
Description was changed from ========== Fixup tests for Android N in chrome.browser.notifications No longer need to @SuppressLint in any of these files :) BUG=643182,528076,501900 ========== to ========== Fixup tests for Android N in chrome.browser.notifications No longer need to @SuppressLint in any of these files :) BUG=643182,528076,501900 Committed: https://crrev.com/edcfa0258d501c3b93e0bbc00dd72f53380940bb Cr-Commit-Position: refs/heads/master@{#416611} ==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/edcfa0258d501c3b93e0bbc00dd72f53380940bb Cr-Commit-Position: refs/heads/master@{#416611} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
