Bug 95093 - Update TestRunner API for web notifications
Summary: Update TestRunner API for web notifications
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jon Lee
URL:
Keywords: InRadar
Depends on:
Blocks: 77969 79492 95154
  Show dependency treegraph
 
Reported: 2012-08-27 08:51 PDT by Jon Lee
Modified: 2012-08-29 10:41 PDT (History)
12 users (show)

See Also:


Attachments
Patch (38.84 KB, patch)
2012-08-27 09:48 PDT, Jon Lee
ap: review+
ap: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Lee 2012-08-27 08:51:54 PDT
Remove some unused legacy API, add some new API, and rename the functions from "desktop notifications" to "web notifications", since that is the official name of the spec.
Comment 1 Radar WebKit Bug Importer 2012-08-27 08:52:08 PDT
<rdar://problem/12179649>
Comment 2 Jon Lee 2012-08-27 09:48:10 PDT
Created attachment 160734 [details]
Patch
Comment 3 Eric Seidel (no email) 2012-08-27 13:15:28 PDT
Could we do this in window.internals instead? so we only have to implement it once instead of for each DRT?
Comment 4 Jon Lee 2012-08-27 13:45:02 PDT
(In reply to comment #3)
> Could we do this in window.internals instead? so we only have to implement it once instead of for each DRT?

It would be great if we can only do this once, but I do not think it is possible with this feature.

There are three sets of APIs involved:

1) Permissions management: retrieving and requesting from JS.
2) Notification management: showing and closing from JS.
3) Platform events: mimicking a user clicking on and closing a notification from the platform.

The first two sets are handled at the WK1/2 layer through port-specific implementations of NotificationClient, which I think implies different solutions for each DRT/WTR port.

The last set is needed only by DRT/WTR, so I think it should remain in testRunner.
Comment 5 Alexey Proskuryakov 2012-08-29 09:41:27 PDT
Comment on attachment 160734 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=160734&action=review

I going to say r+, but I think that naming needs to be clarified.

> Tools/ChangeLog:22
> +        (simulateLegacyWebNotificationClickCallback): Renamed.

Unsure if you are talking about "legacy web notifications", or a "legacy way to simulate working with them". From the ChangeLog it sounds like the latter, but function name shouts the former.

> Tools/DumpRenderTree/TestRunner.h:421
> -    bool m_areDesktopNotificationPermissionRequestsIgnored;
> +    bool m_areLegacyWebNotificationPermissionRequestsIgnored;

I could have used a comment here explaining what "legacy" means in this context. Specifically, how will one determine that it's time to remove this code?
Comment 6 Jon Lee 2012-08-29 10:17:28 PDT
(In reply to comment #5)
> (From update of attachment 160734 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=160734&action=review
> 
> I going to say r+, but I think that naming needs to be clarified.
> 
> > Tools/ChangeLog:22
> > +        (simulateLegacyWebNotificationClickCallback): Renamed.
> 
> Unsure if you are talking about "legacy web notifications", or a "legacy way to simulate working with them". From the ChangeLog it sounds like the latter, but function name shouts the former.

You're right. I mean to say the latter. I'll make a comment about this. I hope we can deprecate it soon enough when the tests get migrated to http/tests.

> 
> > Tools/DumpRenderTree/TestRunner.h:421
> > -    bool m_areDesktopNotificationPermissionRequestsIgnored;
> > +    bool m_areLegacyWebNotificationPermissionRequestsIgnored;
> 
> I could have used a comment here explaining what "legacy" means in this context. Specifically, how will one determine that it's time to remove this code?

Added.
Comment 7 Jon Lee 2012-08-29 10:27:28 PDT
Looks like in my fervor to check in 95099 (r126909) I ended up accidentally including this patch!

I'll still check in another patch to add comments as ap suggested.
Comment 8 Jon Lee 2012-08-29 10:41:49 PDT
Committed r127018: <http://trac.webkit.org/changeset/127018>