Changeset 286715 in webkit
- Timestamp:
- Dec 8, 2021, 1:25:24 PM (5 years ago)
- Location:
- branches/safari-612.4.2.1-branch/Tools
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-612.4.2.1-branch/Tools/ChangeLog
r286510 r286715 1 2021-12-01 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r286368. rdar://problem/85928816 4 5 REGRESSION (r286346): ResourceLoadDelegate.LoadInfo fails 6 https://bugs.webkit.org/show_bug.cgi?id=233689 7 8 Reviewed by Simon Fraser. 9 10 * TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm: 11 This test asserts that archiving a _WKResourceLoadInfo via NSKeyedArchiver 12 encodes to a particular size (607 bytes). 13 14 If you look at the resultant plist before r286346, the encoded frameID 15 and resourceLoadID have the same value, and because of NSKeyedArchiver 16 deduplication, share the same object. 17 18 If you look at the resultant plist *after* r286346, the encoded frameID 19 is one larger than the resourceLoadID, thus cannot be deduplicated, and 20 end up encoding as separate objects. This results in the encoded size 21 increasing to 612 bytes. 22 23 The reason that the encoded frameID is now one value larger is that 24 ObjectIdentifier uses a global identifier pool, and r286346 creates 25 one more ObjectIdentifier during EventHandler construction, destroying 26 our entirely coincidental ID overlap, and causing the aforementioned 27 encoded size change. 28 29 Remove this assertion from the test, since it is very aggressive and 30 seems unnecessary. We could instead just rebaseline the test, but it 31 seems insufficiently important to burden some future developer with 32 a repeat of this evening of exploration and discovery. 33 34 35 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286368 268f45cc-cd09-0410-ab3c-d52691b4dbfc 36 37 2021-12-01 Tim Horton <timothy_horton@apple.com> 38 39 REGRESSION (r286346): ResourceLoadDelegate.LoadInfo fails 40 https://bugs.webkit.org/show_bug.cgi?id=233689 41 42 Reviewed by Simon Fraser. 43 44 * TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm: 45 This test asserts that archiving a _WKResourceLoadInfo via NSKeyedArchiver 46 encodes to a particular size (607 bytes). 47 48 If you look at the resultant plist before r286346, the encoded frameID 49 and resourceLoadID have the same value, and because of NSKeyedArchiver 50 deduplication, share the same object. 51 52 If you look at the resultant plist *after* r286346, the encoded frameID 53 is one larger than the resourceLoadID, thus cannot be deduplicated, and 54 end up encoding as separate objects. This results in the encoded size 55 increasing to 612 bytes. 56 57 The reason that the encoded frameID is now one value larger is that 58 ObjectIdentifier uses a global identifier pool, and r286346 creates 59 one more ObjectIdentifier during EventHandler construction, destroying 60 our entirely coincidental ID overlap, and causing the aforementioned 61 encoded size change. 62 63 Remove this assertion from the test, since it is very aggressive and 64 seems unnecessary. We could instead just rebaseline the test, but it 65 seems insufficiently important to burden some future developer with 66 a repeat of this evening of exploration and discovery. 67 1 68 2021-12-03 Russell Epstein <repstein@apple.com> 2 69 -
branches/safari-612.4.2.1-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm
r273062 r286715 375 375 NSError *error = nil; 376 376 NSData *archiveData = [NSKeyedArchiver archivedDataWithRootObject:original requiringSecureCoding:YES error:&error]; 377 EXPECT_EQ(archiveData.length, 607ull);378 377 EXPECT_FALSE(error); 379 378 _WKResourceLoadInfo *deserialized = [NSKeyedUnarchiver unarchivedObjectOfClass:[_WKResourceLoadInfo class] fromData:archiveData error:&error];
Note:
See TracChangeset
for help on using the changeset viewer.