Title: [286368] trunk/Tools
Revision
286368
Author
timothy_hor...@apple.com
Date
2021-12-01 09:50:30 -0800 (Wed, 01 Dec 2021)

Log Message

REGRESSION (r286346): ResourceLoadDelegate.LoadInfo fails
https://bugs.webkit.org/show_bug.cgi?id=233689

Reviewed by Simon Fraser.

* TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm:
This test asserts that archiving a _WKResourceLoadInfo via NSKeyedArchiver
encodes to a particular size (607 bytes).

If you look at the resultant plist before r286346, the encoded frameID
and resourceLoadID have the same value, and because of NSKeyedArchiver
deduplication, share the same object.

If you look at the resultant plist *after* r286346, the encoded frameID
is one larger than the resourceLoadID, thus cannot be deduplicated, and
end up encoding as separate objects. This results in the encoded size
increasing to 612 bytes.

The reason that the encoded frameID is now one value larger is that
ObjectIdentifier uses a global identifier pool, and r286346 creates
one more ObjectIdentifier during EventHandler construction, destroying
our entirely coincidental ID overlap, and causing the aforementioned
encoded size change.

Remove this assertion from the test, since it is very aggressive and
seems unnecessary. We could instead just rebaseline the test, but it
seems insufficiently important to burden some future developer with
a repeat of this evening of exploration and discovery.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (286367 => 286368)


--- trunk/Tools/ChangeLog	2021-12-01 17:45:30 UTC (rev 286367)
+++ trunk/Tools/ChangeLog	2021-12-01 17:50:30 UTC (rev 286368)
@@ -1,3 +1,34 @@
+2021-12-01  Tim Horton  <timothy_hor...@apple.com>
+
+        REGRESSION (r286346): ResourceLoadDelegate.LoadInfo fails
+        https://bugs.webkit.org/show_bug.cgi?id=233689
+
+        Reviewed by Simon Fraser.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm:
+        This test asserts that archiving a _WKResourceLoadInfo via NSKeyedArchiver
+        encodes to a particular size (607 bytes).
+
+        If you look at the resultant plist before r286346, the encoded frameID
+        and resourceLoadID have the same value, and because of NSKeyedArchiver
+        deduplication, share the same object.
+
+        If you look at the resultant plist *after* r286346, the encoded frameID
+        is one larger than the resourceLoadID, thus cannot be deduplicated, and
+        end up encoding as separate objects. This results in the encoded size
+        increasing to 612 bytes.
+
+        The reason that the encoded frameID is now one value larger is that
+        ObjectIdentifier uses a global identifier pool, and r286346 creates
+        one more ObjectIdentifier during EventHandler construction, destroying
+        our entirely coincidental ID overlap, and causing the aforementioned
+        encoded size change.
+
+        Remove this assertion from the test, since it is very aggressive and
+        seems unnecessary. We could instead just rebaseline the test, but it
+        seems insufficiently important to burden some future developer with
+        a repeat of this evening of exploration and discovery.
+
 2021-12-01  Brady Eidson  <beid...@apple.com>
 
         Add WKWebsiteDataStore configuration option to enable Mock app bundle testing.

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm (286367 => 286368)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm	2021-12-01 17:45:30 UTC (rev 286367)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm	2021-12-01 17:50:30 UTC (rev 286368)
@@ -379,7 +379,6 @@
     _WKResourceLoadInfo *original = loadInfos[0].get();
     NSError *error = nil;
     NSData *archiveData = [NSKeyedArchiver archivedDataWithRootObject:original requiringSecureCoding:YES error:&error];
-    EXPECT_EQ(archiveData.length, 607ull);
     EXPECT_FALSE(error);
     _WKResourceLoadInfo *deserialized = [NSKeyedUnarchiver unarchivedObjectOfClass:[_WKResourceLoadInfo class] fromData:archiveData error:&error];
     EXPECT_FALSE(error);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to