Changeset 246012 in webkit
- Timestamp:
- May 31, 2019, 9:33:04 PM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm (modified) (2 diffs)
-
TestWebKitAPI/Tests/WebKitCocoa/local-storage-process-suspends-2.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r246010 r246012 1 2019-05-31 Sihui Liu <sihui_liu@apple.com> 2 3 TestWebKitAPI.WKWebView.LocalStorageProcessSuspends is flaky 4 https://bugs.webkit.org/show_bug.cgi?id=198450 5 6 Reviewed by Ryosuke Niwa. 7 8 In local-storage-process-suspends-2.html, we periodically checked local storage item and sent a message when the 9 item value was changed or times of check reached limit. We expected the message to be sent after network process 10 resumed from suspension, because that's when the item value should get updated. However, the limit we set seemed 11 to be not high enough, so that the message could be sent eariler than expected, when limit of check number was 12 reached. 13 14 We can solve this in different ways. To make the test robust, we can send the message on a storage event, which 15 notifies about changes in local storage. 16 17 * TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm: 18 (TEST): 19 * TestWebKitAPI/Tests/WebKitCocoa/local-storage-process-suspends-2.html: 20 1 21 2019-05-31 Ryosuke Niwa <rniwa@webkit.org> 2 22 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm
r245904 r246012 112 112 RetainPtr<WKProcessPool> processPool = adoptNS([[WKProcessPool alloc] init]); 113 113 [configuration setProcessPool:processPool.get()]; 114 [configuration _setAllowUniversalAccessFromFileURLs:YES]; 114 115 115 116 RetainPtr<WKWebView> webView1 = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]); … … 139 140 readyToContinue = false; 140 141 [webView2 evaluateJavaScript:@"window.localStorage.getItem('key')" completionHandler:^(id result, NSError *) { 141 EXPECT_ TRUE([@"value" isEqualToString:result]);142 EXPECT_WK_STREQ(@"value", result); 142 143 readyToContinue = true; 143 144 }]; -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/local-storage-process-suspends-2.html
r245904 r246012 2 2 <script> 3 3 4 var startValue = window.localStorage.getItem('key'); 5 window.webkit.messageHandlers.testHandler.postMessage(startValue); 4 function checkLocalStorage(event) { 5 window.webkit.messageHandlers.testHandler.postMessage(window.localStorage.getItem('key')); 6 } 6 7 7 var tries = 10; 8 var intervalID = setInterval(()=> { 9 var newValue = window.localStorage.getItem('key'); 10 if (newValue != startValue || tries == 0) { 11 window.webkit.messageHandlers.testHandler.postMessage(newValue); 12 clearInterval(intervalID); 13 } 14 --tries; 15 }, 100); 8 checkLocalStorage(); 9 window.addEventListener("storage", checkLocalStorage); 16 10 17 11 </script>
Note:
See TracChangeset
for help on using the changeset viewer.