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

Issue 865034 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 24
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug

Blocking:
issue 853405



Sign in to add a comment

Split NotificationTestRule into EmbeddedTestServerRule and NotificationTestRule

Project Member Reported by awdf@chromium.org, Jul 18

Issue description

This will enable NotificationTestRule to be used alongside PermissionTestRule. Right now attempting to use both from NotificationPlatformBridgeTest results in a failure, presumably due to them both attempting to create a test server in setup:

C   79.613s Main  [FAIL] org.chromium.chrome.browser.notifications.NotificationPermissionTest#testPermissionGranted:
C   79.613s Main  org.chromium.net.test.EmbeddedTestServer$EmbeddedTestServerFailure: Failed to add default handlers a
nd start serving files from : android.os.DeadObjectException
C   79.613s Main        at org.chromium.net.test.EmbeddedTestServer.addDefaultHandlers(EmbeddedTestServer.java:213)
C   79.613s Main        at org.chromium.net.test.EmbeddedTestServer.initializeAndStartServer(EmbeddedTestServer.java:379)
C   79.613s Main        at org.chromium.net.test.EmbeddedTestServer.createAndStartServer(EmbeddedTestServer.java:345)
C   79.613s Main        at org.chromium.chrome.browser.notifications.NotificationTestRule.setUp(NotificationTestRule.j
ava:53)
C   79.613s Main        at org.chromium.chrome.browser.notifications.NotificationTestRule.access$100(NotificationTestR
ule.java:34)
C   79.613s Main        at org.chromium.chrome.browser.notifications.NotificationTestRule$3.evaluate(NotificationTestRule.java:137)
C   79.613s Main        at org.chromium.chrome.test.ChromeActivityTestRule$1.evaluate(ChromeActivityTestRule.java:116)
C   79.613s Main        at android.support.test.internal.statement.UiThreadStatement.evaluate(UiThreadStatement.java:5
5)
C   79.614s Main        at android.support.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java
:270)
C   79.614s Main        at org.chromium.chrome.browser.permissions.PermissionTestRule$1.evaluate(PermissionTestRule.ja
va:99)


 
(I want to use PermissionTestRule from there to reuse its code for granting/denying permission via the new permission modals, for  Issue 853405 )
Project Member

Comment 2 by bugdroid1@chromium.org, Jul 20

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

commit 56e2b19423bd8bfc79470df3aae8e6944993d9e2
Author: Anita Woodruff <awdf@chromium.org>
Date: Fri Jul 20 09:27:13 2018

[Android Tests] Use EmbeddedTestServerTestRule for notification tests

- Rather than using an embedded test server directly within
NotificationTestRule, use an EmbeddedTestServerTestRule from those
tests that use this rule explicitly.

- This is a precursor to being able to use PermissionTestRule from
NotificationPlatformBridgeTest in order to re-enable the permission
tests (because PermissionTestRule uses an EmbeddedServerTestRule
internally too atm and they clash).

Bug:  865034 
Change-Id: I2cc61938acf5cd449dc2a5fecdec69e0a1167c6d
Reviewed-on: https://chromium-review.googlesource.com/1142148
Reviewed-by: Helen Li <xunjieli@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Anita Woodruff <awdf@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576818}
[modify] https://crrev.com/56e2b19423bd8bfc79470df3aae8e6944993d9e2/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java
[modify] https://crrev.com/56e2b19423bd8bfc79470df3aae8e6944993d9e2/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationTestRule.java
[modify] https://crrev.com/56e2b19423bd8bfc79470df3aae8e6944993d9e2/chrome/android/javatests/src/org/chromium/chrome/browser/push_messaging/PushMessagingTest.java
[modify] https://crrev.com/56e2b19423bd8bfc79470df3aae8e6944993d9e2/net/test/android/javatests/src/org/chromium/net/test/EmbeddedTestServerRule.java

Status: Fixed (was: Assigned)

Sign in to add a comment