Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Issue 186713002: Add new layout tests for the Web Notification API. (Closed)

Created:
6 years, 9 months ago by Peter Beverloo
Modified:
6 years, 5 months ago
CC:
blink-reviews
Visibility:
Public.

Description

Add new layout tests for the Web Notification API. This patch adds tests for the following scenarios: * Notification.permission should default to "default". * Notification.onshow() and Notification.onclose() should be called. * Notification.onclick() should be called when it gets clicked on. * Notification.tag should allow an existing notification to be replaced. * Sandboxed iframes should influence notification inheritance behavior. * Notifications can focus their opening window when it's in the background. The expected output of "notifications-constructor-with-permission.html" has been amended to reflect the updated output format. Two tests have been updated to include the second argument to the testRunner.grantWebNotificationPermission() call (whether to grant it). BUG=349015

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : onclick() test #

Patch Set 4 : Moar tests #

Patch Set 5 : Update existing tests #

Total comments: 4

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+298 lines, -3 lines) Patch
A LayoutTests/fast/notifications/notification-click.html View 1 2 1 chunk +34 lines, -0 lines 0 comments Download
A LayoutTests/fast/notifications/notification-click-expected.txt View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
A LayoutTests/fast/notifications/notification-click-window-focus.html View 1 2 3 1 chunk +49 lines, -0 lines 0 comments Download
A LayoutTests/fast/notifications/notification-click-window-focus-expected.txt View 1 2 3 1 chunk +13 lines, -0 lines 0 comments Download
A LayoutTests/fast/notifications/notification-close.html View 1 2 1 chunk +30 lines, -0 lines 0 comments Download
A LayoutTests/fast/notifications/notification-close-expected.txt View 1 1 chunk +10 lines, -0 lines 0 comments Download
M LayoutTests/fast/notifications/notification-properties.html View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/fast/notifications/notification-replace.html View 1 2 3 1 chunk +38 lines, -0 lines 0 comments Download
A LayoutTests/fast/notifications/notification-replace-expected.txt View 1 2 3 1 chunk +11 lines, -0 lines 0 comments Download
A LayoutTests/fast/notifications/notification-sandbox-permission.html View 1 2 3 1 chunk +26 lines, -0 lines 0 comments Download
A LayoutTests/fast/notifications/notification-sandbox-permission-expected.txt View 1 2 3 1 chunk +26 lines, -0 lines 0 comments Download
M LayoutTests/fast/notifications/notifications-constructor-with-permission.html View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/notifications/notifications-constructor-with-permission-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/fast/notifications/notifications-permission-values.html View 1 chunk +26 lines, -0 lines 0 comments Download
A LayoutTests/fast/notifications/notifications-permission-values-expected.txt View 1 chunk +9 lines, -0 lines 0 comments Download
A LayoutTests/fast/notifications/resources/display-permission.html View 1 2 3 1 chunk +13 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Peter Beverloo
Shiny new and updated tests :-). These depend on a few cleanups in the test ...
6 years, 9 months ago (2014-03-04 18:36:49 UTC) #1
abarth-chromium
lgtm
6 years, 9 months ago (2014-03-04 19:07:13 UTC) #2
abarth-chromium
https://codereview.chromium.org/186713002/diff/70001/LayoutTests/fast/notifications/notifications-constructor-with-permission.html File LayoutTests/fast/notifications/notifications-constructor-with-permission.html (right): https://codereview.chromium.org/186713002/diff/70001/LayoutTests/fast/notifications/notifications-constructor-with-permission.html#newcode13 LayoutTests/fast/notifications/notifications-constructor-with-permission.html:13: testRunner.grantWebNotificationPermission("file://", true); What does |true| mean here? Can we ...
6 years, 9 months ago (2014-03-04 19:07:35 UTC) #3
Peter Beverloo
https://codereview.chromium.org/186713002/diff/70001/LayoutTests/fast/notifications/notifications-constructor-with-permission.html File LayoutTests/fast/notifications/notifications-constructor-with-permission.html (right): https://codereview.chromium.org/186713002/diff/70001/LayoutTests/fast/notifications/notifications-constructor-with-permission.html#newcode13 LayoutTests/fast/notifications/notifications-constructor-with-permission.html:13: testRunner.grantWebNotificationPermission("file://", true); On 2014/03/04 19:07:35, abarth wrote: > What ...
6 years, 9 months ago (2014-03-04 19:49:51 UTC) #4
abarth-chromium
On 2014/03/04 19:49:51, Peter Beverloo wrote: > https://codereview.chromium.org/186713002/diff/70001/LayoutTests/fast/notifications/notifications-constructor-with-permission.html > File > LayoutTests/fast/notifications/notifications-constructor-with-permission.html > (right): > ...
6 years, 9 months ago (2014-03-04 21:04:39 UTC) #5
Andrew T Wilson (Slow)
6 years, 9 months ago (2014-03-04 21:26:37 UTC) #6
LGTM.

BTW, one other test that might be interesting is making sure that
requestPermission() can only be called in the context of a user gesture. Not
sure if testrunner has the facilities to let us test this case though.

https://codereview.chromium.org/186713002/diff/70001/LayoutTests/fast/notific...
File LayoutTests/fast/notifications/notification-close-expected.txt (right):

https://codereview.chromium.org/186713002/diff/70001/LayoutTests/fast/notific...
LayoutTests/fast/notifications/notification-close-expected.txt:8: PASS
notification.onshow() has been called.
BTW, weird to see the PASS lines show up in the output *after* "TEST COMPLETE"

https://codereview.chromium.org/186713002/diff/70001/LayoutTests/fast/notific...
File LayoutTests/fast/notifications/notification-replace.html (right):

https://codereview.chromium.org/186713002/diff/70001/LayoutTests/fast/notific...
LayoutTests/fast/notifications/notification-replace.html:31:
testPassed("updatedNotification.onshow() has been called.");
Does this test actually ensure that the first notification is closed/replaced?
Maybe we should register an onclose handler on the first one to ensure this? Or
is this just inherent in the test runner because it only shows one notification
at once?

Powered by Google App Engine
This is Rietveld 408576698