New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 705919 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Android MediaRouter only (left Chro...
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocking:
issue 705920
issue 705925



Sign in to add a comment

Improve test coverage of MediaNotification

Project Member Reported by zqzh...@chromium.org, Mar 28 2017

Issue description

Use this as the meta bug.
 
Blocking: 705920
Blockedon: 705925
Blockedon: -705925
Blocking: 705925
Seems like I am able to do it as pure junit tests. Robolectric seems more powerful than I thought.

Using Mockito in instrumentation tests seems a bit overkill.
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a98c2132ee5335e39d6d83f70ed37678237637e9

commit a98c2132ee5335e39d6d83f70ed37678237637e9
Author: zqzhang <zqzhang@chromium.org>
Date: Thu Apr 13 11:44:49 2017

Adding JUnit tests for MediaNotificationManager

This CL adds a number of JUnit tests for testing
MediaNotificationManager in the following aspects:

* Check if MediaNotificationManager handles the ListenerService correctly.
* Check if ListenerService can correctly process Intents.
* Check if the Notification presrented to Android NotificationManager is
  correct.

Many MediaNotificationManager members are changed to package scope access
to avoid too many "ForTesting" names.

BUG= 705919 

Review-Url: https://codereview.chromium.org/2816603002
Cr-Commit-Position: refs/heads/master@{#464375}

[modify] https://crrev.com/a98c2132ee5335e39d6d83f70ed37678237637e9/chrome/android/java/src/org/chromium/chrome/browser/AppHooks.java
[modify] https://crrev.com/a98c2132ee5335e39d6d83f70ed37678237637e9/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java
[modify] https://crrev.com/a98c2132ee5335e39d6d83f70ed37678237637e9/chrome/android/java_sources.gni
[add] https://crrev.com/a98c2132ee5335e39d6d83f70ed37678237637e9/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerNotificationTest.java
[add] https://crrev.com/a98c2132ee5335e39d6d83f70ed37678237637e9/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerServiceActionsTest.java
[add] https://crrev.com/a98c2132ee5335e39d6d83f70ed37678237637e9/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerServiceLifecycleTest.java
[add] https://crrev.com/a98c2132ee5335e39d6d83f70ed37678237637e9/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerTestBase.java
[add] https://crrev.com/a98c2132ee5335e39d6d83f70ed37678237637e9/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationTestShadowNotificationManager.java
[add] https://crrev.com/a98c2132ee5335e39d6d83f70ed37678237637e9/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationTestShadowResources.java

Some follow-up tasks we could do:

* Fix several bugs which we found when writing the tests.
* Move existing instrumentation tests into junit tests.
Status: Fixed (was: Assigned)
Project Member

Comment 8 by bugdroid1@chromium.org, Apr 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/61d006d1ee4c7f53b6bf9cad73a59e761dc37e6a

commit 61d006d1ee4c7f53b6bf9cad73a59e761dc37e6a
Author: zqzhang <zqzhang@chromium.org>
Date: Mon Apr 24 05:30:21 2017

[Media>UI] Migrate media notification tests to JUnit tests

BUG= 705919 

Review-Url: https://codereview.chromium.org/2831223002
Cr-Commit-Position: refs/heads/master@{#466588}

[modify] https://crrev.com/61d006d1ee4c7f53b6bf9cad73a59e761dc37e6a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java
[modify] https://crrev.com/61d006d1ee4c7f53b6bf9cad73a59e761dc37e6a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaSessionTabHelper.java
[modify] https://crrev.com/61d006d1ee4c7f53b6bf9cad73a59e761dc37e6a/chrome/android/java_sources.gni
[delete] https://crrev.com/eaa6185759c3d8f7230851633c724caa73f544e9/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/NotificationActionsUpdatedTest.java
[delete] https://crrev.com/eaa6185759c3d8f7230851633c724caa73f544e9/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/NotificationTestUtils.java
[delete] https://crrev.com/eaa6185759c3d8f7230851633c724caa73f544e9/chrome/android/javatests/src/org/chromium/chrome/browser/media/ui/NotificationTitleUpdatedTest.java
[add] https://crrev.com/61d006d1ee4c7f53b6bf9cad73a59e761dc37e6a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationActionsUpdatedTest.java
[modify] https://crrev.com/61d006d1ee4c7f53b6bf9cad73a59e761dc37e6a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerServiceLifecycleTest.java
[modify] https://crrev.com/61d006d1ee4c7f53b6bf9cad73a59e761dc37e6a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationManagerTestBase.java
[modify] https://crrev.com/61d006d1ee4c7f53b6bf9cad73a59e761dc37e6a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationTestShadowResources.java
[add] https://crrev.com/61d006d1ee4c7f53b6bf9cad73a59e761dc37e6a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationTestTabHolder.java
[add] https://crrev.com/61d006d1ee4c7f53b6bf9cad73a59e761dc37e6a/chrome/android/junit/src/org/chromium/chrome/browser/media/ui/MediaNotificationTitleUpdatedTest.java
[modify] https://crrev.com/61d006d1ee4c7f53b6bf9cad73a59e761dc37e6a/content/public/android/java/src/org/chromium/content_public/browser/MediaSessionObserver.java

Sign in to add a comment