Bug 182543 - Add API test to validate setting of service worker and cache storage directories
Summary: Add API test to validate setting of service worker and cache storage directories
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-02-06 11:12 PST by youenn fablet
Modified: 2019-03-20 06:18 PDT (History)
7 users (show)

See Also:


Attachments
Patch (26.96 KB, patch)
2018-02-06 11:25 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (16.72 KB, patch)
2018-02-28 15:40 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (16.64 KB, patch)
2018-02-28 16:50 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2018-02-06 11:12:16 PST
Add API test to validate setting of service worker and cache storage directories
Comment 1 youenn fablet 2018-02-06 11:25:41 PST
Created attachment 333194 [details]
Patch
Comment 2 Radar WebKit Bug Importer 2018-02-06 11:26:31 PST
<rdar://problem/37281698>
Comment 3 EWS Watchlist 2018-02-06 11:28:27 PST
Attachment 333194 [details] did not pass style-queue:


ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:842:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  They're ugly and unnecessary, and you should use concatenation instead".  [readability/multiline_string] [5]
ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:851:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  They're ugly and unnecessary, and you should use concatenation instead".  [readability/multiline_string] [5]
ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:853:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  They're ugly and unnecessary, and you should use concatenation instead".  [readability/multiline_string] [5]
ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:862:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  They're ugly and unnecessary, and you should use concatenation instead".  [readability/multiline_string] [5]
ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:947:  Consider using EXPECT_EQ instead of EXPECT_TRUE(a == b)  [readability/check] [2]
Total errors found: 5 in 22 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Chris Dumez 2018-02-06 15:12:09 PST
Comment on attachment 333194 [details]
Patch

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

> Source/WebCore/testing/Internals.idl:575
> +    [Conditional=SERVICE_WORKER] Promise<DOMString> serviceWorkerRegistrationDirectory();

Since this is only used in an API test, I don't think we need this internals API and all this piping through to the SW process. The API test can just check that the path on disk got created.
There are existing API tests doing this I believe, I'll point you to one.
Comment 5 Chris Dumez 2018-02-06 15:14:56 PST
Comment on attachment 333194 [details]
Patch

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

>> Source/WebCore/testing/Internals.idl:575
>> +    [Conditional=SERVICE_WORKER] Promise<DOMString> serviceWorkerRegistrationDirectory();
> 
> Since this is only used in an API test, I don't think we need this internals API and all this piping through to the SW process. The API test can just check that the path on disk got created.
> There are existing API tests doing this I believe, I'll point you to one.

LocalStorageClear is an example of such API test, although it is for the opposite. Also ResourceLoadStatistics.GrandfatherCallback which is closer to what you want I think.
Comment 6 youenn fablet 2018-02-28 15:40:32 PST
Created attachment 334778 [details]
Patch
Comment 7 EWS Watchlist 2018-02-28 15:42:58 PST
Attachment 334778 [details] did not pass style-queue:


ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:1036:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  They're ugly and unnecessary, and you should use concatenation instead".  [readability/multiline_string] [5]
ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:1045:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  They're ugly and unnecessary, and you should use concatenation instead".  [readability/multiline_string] [5]
Total errors found: 2 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 youenn fablet 2018-02-28 16:50:13 PST
Created attachment 334786 [details]
Patch
Comment 9 EWS Watchlist 2018-02-28 16:52:25 PST
Attachment 334786 [details] did not pass style-queue:


ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:983:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  They're ugly and unnecessary, and you should use concatenation instead".  [readability/multiline_string] [5]
ERROR: Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:992:  Multi-line string ("...") found.  This lint script doesn't do well with such strings, and may give bogus warnings.  They're ugly and unnecessary, and you should use concatenation instead".  [readability/multiline_string] [5]
Total errors found: 2 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 10 WebKit Commit Bot 2018-03-01 15:18:34 PST
Comment on attachment 334786 [details]
Patch

Clearing flags on attachment: 334786

Committed r229150: <https://trac.webkit.org/changeset/229150>
Comment 11 WebKit Commit Bot 2018-03-01 15:18:36 PST
All reviewed patches have been landed.  Closing bug.