WebKit Bugzilla
Attachment 371107 Details for
Bug 198450
: TestWebKitAPI.WKWebView.LocalStorageProcessSuspends is flaky
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-198450-20190531211741.patch (text/plain), 4.00 KB, created by
Sihui Liu
on 2019-05-31 21:17:41 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Sihui Liu
Created:
2019-05-31 21:17:41 PDT
Size:
4.00 KB
patch
obsolete
>Subversion Revision: 246010 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 7de47b5263f6a25de491a787dd514cbc7cb9bf41..288349033ceec728bdcd2b28d92272549e0c674c 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,23 @@ >+2019-05-31 Sihui Liu <sihui_liu@apple.com> >+ >+ TestWebKitAPI.WKWebView.LocalStorageProcessSuspends is flaky >+ https://bugs.webkit.org/show_bug.cgi?id=198450 >+ >+ Reviewed by Ryosuke Niwa. >+ >+ In local-storage-process-suspends-2.html, we periodically checked local storage item and sent a message when the >+ item value was changed or times of check reached limit. We expected the message to be sent after network process >+ resumed from suspension, because that's when the item value should get updated. However, the limit we set seemed >+ to be not high enough, so that the message could be sent eariler than expected, when limit of check number was >+ reached. >+ >+ We can solve this in different ways. To make the test robust, we can send the message on a storage event, which >+ notifies about changes in local storage. >+ >+ * TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm: >+ (TEST): >+ * TestWebKitAPI/Tests/WebKitCocoa/local-storage-process-suspends-2.html: >+ > 2019-05-31 Ryosuke Niwa <rniwa@webkit.org> > > DragAndDropTests.DragImageLocationForLinkInSubframe fails on some iPad >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm >index 1bc78d71949ba9724116bcfd726eca35b66a3ae2..3db173f882b2a9cd3294b316909176c31bb04cc5 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm >@@ -111,6 +111,7 @@ TEST(WKWebView, LocalStorageProcessSuspends) > [[configuration userContentController] addScriptMessageHandler:handler.get() name:@"testHandler"]; > RetainPtr<WKProcessPool> processPool = adoptNS([[WKProcessPool alloc] init]); > [configuration setProcessPool:processPool.get()]; >+ [configuration _setAllowUniversalAccessFromFileURLs:YES]; > > RetainPtr<WKWebView> webView1 = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); > NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"local-storage-process-suspends-1" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; >@@ -138,7 +139,7 @@ TEST(WKWebView, LocalStorageProcessSuspends) > > readyToContinue = false; > [webView2 evaluateJavaScript:@"window.localStorage.getItem('key')" completionHandler:^(id result, NSError *) { >- EXPECT_TRUE([@"value" isEqualToString:result]); >+ EXPECT_WK_STREQ(@"value", result); > readyToContinue = true; > }]; > TestWebKitAPI::Util::run(&readyToContinue); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/local-storage-process-suspends-2.html b/Tools/TestWebKitAPI/Tests/WebKitCocoa/local-storage-process-suspends-2.html >index d3a2764d6e34f9fa45e2dd169e69a40cf55189cb..6ba25d103dbe71180a59c624598fb931bad11d56 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/local-storage-process-suspends-2.html >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/local-storage-process-suspends-2.html >@@ -1,17 +1,11 @@ > <!DOCTYPE html> > <script> > >-var startValue = window.localStorage.getItem('key'); >-window.webkit.messageHandlers.testHandler.postMessage(startValue); >+function checkLocalStorage(event) { >+ window.webkit.messageHandlers.testHandler.postMessage(window.localStorage.getItem('key')); >+} > >-var tries = 10; >-var intervalID = setInterval(()=> { >- var newValue = window.localStorage.getItem('key'); >- if (newValue != startValue || tries == 0) { >- window.webkit.messageHandlers.testHandler.postMessage(newValue); >- clearInterval(intervalID); >- } >- --tries; >-}, 100); >+checkLocalStorage(); >+window.addEventListener("storage", checkLocalStorage); > >-</script> >\ No newline at end of file >+</script>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198450
: 371107