Title: [289419] trunk/Source
Revision
289419
Author
[email protected]
Date
2022-02-08 13:16:22 -0800 (Tue, 08 Feb 2022)

Log Message

http/tests/cache-storage/cache-origins.https.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=236263

Reviewed by Darin Adler.

Source/WebCore:

Drop workaround landed in r289247 to try and maintain HashMap ordering.

* page/SecurityOriginData.h:
(WebCore::add):

Source/WebKit:

Update CacheStorage::Engine::representation() (which is used by the layout tests) to return
origins in a stable order in order to address test flakiness.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::representation):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (289418 => 289419)


--- trunk/Source/WebCore/ChangeLog	2022-02-08 20:45:41 UTC (rev 289418)
+++ trunk/Source/WebCore/ChangeLog	2022-02-08 21:16:22 UTC (rev 289419)
@@ -1,3 +1,15 @@
+2022-02-08  Chris Dumez  <[email protected]>
+
+        http/tests/cache-storage/cache-origins.https.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=236263
+
+        Reviewed by Darin Adler.
+
+        Drop workaround landed in r289247 to try and maintain HashMap ordering.
+
+        * page/SecurityOriginData.h:
+        (WebCore::add):
+
 2022-02-08  Chris Lord  <[email protected]>
 
         [GTK][WPE] Fallback path for WebGL rendering with ANGLE is incorrectly scheduling on the compositor thread

Modified: trunk/Source/WebCore/page/SecurityOriginData.h (289418 => 289419)


--- trunk/Source/WebCore/page/SecurityOriginData.h	2022-02-08 20:45:41 UTC (rev 289418)
+++ trunk/Source/WebCore/page/SecurityOriginData.h	2022-02-08 21:16:22 UTC (rev 289419)
@@ -100,7 +100,7 @@
 
 inline void add(Hasher& hasher, const SecurityOriginData& data)
 {
-    add(hasher, data.protocol, data.host, data.port.value_or(0));
+    add(hasher, data.protocol, data.host, data.port);
 }
 
 template<class Encoder>

Modified: trunk/Source/WebKit/ChangeLog (289418 => 289419)


--- trunk/Source/WebKit/ChangeLog	2022-02-08 20:45:41 UTC (rev 289418)
+++ trunk/Source/WebKit/ChangeLog	2022-02-08 21:16:22 UTC (rev 289419)
@@ -1,3 +1,16 @@
+2022-02-08  Chris Dumez  <[email protected]>
+
+        http/tests/cache-storage/cache-origins.https.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=236263
+
+        Reviewed by Darin Adler.
+
+        Update CacheStorage::Engine::representation() (which is used by the layout tests) to return
+        origins in a stable order in order to address test flakiness.
+
+        * NetworkProcess/cache/CacheStorageEngine.cpp:
+        (WebKit::CacheStorage::Engine::representation):
+
 2022-02-08  Razvan Caliman  <[email protected]>
 
         Web Inspector: [Flexbox] Add support for showing/hiding flex container overlays and basic overlay drawing

Modified: trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp (289418 => 289419)


--- trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp	2022-02-08 20:45:41 UTC (rev 289418)
+++ trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp	2022-02-08 21:16:22 UTC (rev 289419)
@@ -790,23 +790,21 @@
     ASSERT(m_pendingClearCallbacks.isEmpty());
     ASSERT(m_initializationCallbacks.isEmpty());
 
-    bool isFirst = true;
+    auto origins = WTF::map(m_caches, [](auto& keyValue) {
+        StringBuilder originBuilder;
+        originBuilder.append("\n{ \"origin\" : { \"topOrigin\" : \"", keyValue.key.topOrigin.toString(), "\", \"clientOrigin\": \"", keyValue.key.clientOrigin.toString(), "\" }, \"caches\" : ");
+        keyValue.value->appendRepresentation(originBuilder);
+        originBuilder.append('}');
+        return originBuilder.toString();
+    });
+    std::sort(origins.begin(), origins.end(), [](auto& a, auto& b) { return codePointCompareLessThan(a, b); });
+
     StringBuilder builder;
-    builder.append("{ \"path\": \"");
-    builder.append(m_rootPath);
-    builder.append("\", \"origins\": [");
-    for (auto& keyValue : m_caches) {
-        if (!isFirst)
-            builder.append(",");
-        isFirst = false;
-
-        builder.append("\n{ \"origin\" : { \"topOrigin\" : \"");
-        builder.append(keyValue.key.topOrigin.toString());
-        builder.append("\", \"clientOrigin\": \"");
-        builder.append(keyValue.key.clientOrigin.toString());
-        builder.append("\" }, \"caches\" : ");
-        keyValue.value->appendRepresentation(builder);
-        builder.append("}");
+    builder.append("{ \"path\": \"", m_rootPath, "\", \"origins\": [");
+    const char* divider = "";
+    for (auto& origin : origins) {
+        builder.append(divider, origin);
+        divider = ",";
     }
     builder.append("]}");
     return builder.toString();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to