Title: [253487] trunk
- Revision
- 253487
- Author
- [email protected]
- Date
- 2019-12-13 10:58:04 -0800 (Fri, 13 Dec 2019)
Log Message
Help debugging flaky http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html
https://bugs.webkit.org/show_bug.cgi?id=205209
Reviewed by Chris Dumez.
Source/WebKit:
Add a bunch of asserts that no pending activity is happening in the Cache Storage backend is happening
when querying the backend representation, which is a debug tool.
No change of behavior.
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::representation):
* NetworkProcess/cache/CacheStorageEngineCache.h:
(WebKit::CacheStorage::Cache::hasPendingOpeningCallbacks const):
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::appendRepresentation const):
LayoutTests:
In case of error, query the cache representation.
This will help debugging the flaky tests and ensure that no pending activity is happening in error cases.
* http/tests/cache-storage/page-cache-domcache-pending-promise.html:
* http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (253486 => 253487)
--- trunk/LayoutTests/ChangeLog 2019-12-13 18:39:40 UTC (rev 253486)
+++ trunk/LayoutTests/ChangeLog 2019-12-13 18:58:04 UTC (rev 253487)
@@ -1,3 +1,16 @@
+2019-12-13 youenn fablet <[email protected]>
+
+ Help debugging flaky http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html
+ https://bugs.webkit.org/show_bug.cgi?id=205209
+
+ Reviewed by Chris Dumez.
+
+ In case of error, query the cache representation.
+ This will help debugging the flaky tests and ensure that no pending activity is happening in error cases.
+
+ * http/tests/cache-storage/page-cache-domcache-pending-promise.html:
+ * http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html:
+
2019-12-13 Wenson Hsieh <[email protected]>
[Clipboard API] Sanitize HTML and image data written using clipboard.write
Modified: trunk/LayoutTests/http/tests/cache-storage/page-cache-domcache-pending-promise.html (253486 => 253487)
--- trunk/LayoutTests/http/tests/cache-storage/page-cache-domcache-pending-promise.html 2019-12-13 18:39:40 UTC (rev 253486)
+++ trunk/LayoutTests/http/tests/cache-storage/page-cache-domcache-pending-promise.html 2019-12-13 18:58:04 UTC (rev 253487)
@@ -52,8 +52,10 @@
testRunner.clearDOMCaches();
setTimeout(() => {
- handle1 = setTimeout(() => {
+ handle1 = setTimeout(async () => {
testFailed("Timed out while waiting for the cache to open");
+ if (window.internals)
+ console.log(await internals.cacheStorageEngineRepresentation());
finishJSTest();
}, 20000);
caches.open('page-cache-test').then((_cache) => {
Modified: trunk/LayoutTests/http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html (253486 => 253487)
--- trunk/LayoutTests/http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html 2019-12-13 18:39:40 UTC (rev 253486)
+++ trunk/LayoutTests/http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html 2019-12-13 18:58:04 UTC (rev 253487)
@@ -25,7 +25,15 @@
finishJSTest();
}
+ const handle1 = setTimeout(async () => {
+ testFailed("Timed out while waiting for the cache to open");
+ if (window.internals)
+ console.log(await internals.cacheStorageEngineRepresentation());
+ finishJSTest();
+ }, 10000);
+
caches.open('test').then(() => {
+ clearTimeout(handle1);
testPassed("Opened the cache");
shouldBeTrue("!!restoredFromPageCache");
finishJSTest();
Modified: trunk/Source/WebKit/ChangeLog (253486 => 253487)
--- trunk/Source/WebKit/ChangeLog 2019-12-13 18:39:40 UTC (rev 253486)
+++ trunk/Source/WebKit/ChangeLog 2019-12-13 18:58:04 UTC (rev 253487)
@@ -1,3 +1,21 @@
+2019-12-13 youenn fablet <[email protected]>
+
+ Help debugging flaky http/tests/cache-storage/page-cache-domcachestorage-pending-promise.html
+ https://bugs.webkit.org/show_bug.cgi?id=205209
+
+ Reviewed by Chris Dumez.
+
+ Add a bunch of asserts that no pending activity is happening in the Cache Storage backend is happening
+ when querying the backend representation, which is a debug tool.
+ No change of behavior.
+
+ * NetworkProcess/cache/CacheStorageEngine.cpp:
+ (WebKit::CacheStorage::Engine::representation):
+ * NetworkProcess/cache/CacheStorageEngineCache.h:
+ (WebKit::CacheStorage::Cache::hasPendingOpeningCallbacks const):
+ * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
+ (WebKit::CacheStorage::Caches::appendRepresentation const):
+
2019-12-13 Kate Cheney <[email protected]>
Create WebKit API calls for ITP Data
Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp (253486 => 253487)
--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp 2019-12-13 18:39:40 UTC (rev 253486)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp 2019-12-13 18:58:04 UTC (rev 253487)
@@ -802,6 +802,9 @@
String Engine::representation()
{
+ ASSERT(m_pendingClearCallbacks.isEmpty());
+ ASSERT(m_initializationCallbacks.isEmpty());
+
bool isFirst = true;
StringBuilder builder;
builder.append("{ \"path\": \"");
Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.h (253486 => 253487)
--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.h 2019-12-13 18:39:40 UTC (rev 253486)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.h 2019-12-13 18:58:04 UTC (rev 253487)
@@ -93,6 +93,8 @@
};
static Optional<DecodedRecord> decodeRecordHeader(const NetworkCache::Storage::Record&);
+ bool hasPendingOpeningCallbacks() const { return !m_pendingOpeningCallbacks.isEmpty(); }
+
private:
Vector<RecordInformation>* recordsFromURL(const URL&);
const Vector<RecordInformation>* recordsFromURL(const URL&) const;
Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp (253486 => 253487)
--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp 2019-12-13 18:39:40 UTC (rev 253486)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp 2019-12-13 18:58:04 UTC (rev 253487)
@@ -660,10 +660,14 @@
void Caches::appendRepresentation(StringBuilder& builder) const
{
+ ASSERT(m_pendingInitializationCallbacks.isEmpty());
+ ASSERT(m_pendingWritingCachesToDiskCallbacks.isEmpty());
+
builder.append("{ \"persistent\": [");
bool isFirst = true;
for (auto& cache : m_caches) {
+ ASSERT(!cache.hasPendingOpeningCallbacks());
if (!isFirst)
builder.append(", ");
isFirst = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes