RESOLVED WONTFIX 102808
Add tests for CachedResourceRequest initiators
https://bugs.webkit.org/show_bug.cgi?id=102808
Summary Add tests for CachedResourceRequest initiators
Marja Hölttä
Reported 2012-11-20 05:50:57 PST
Bug 101935 added initiators to CachedResourceRequests (for simple cases), and this adds tests. When / if resource timing is implemented, there will be more tests (and these might be obsolete).
Attachments
Patch (11.12 KB, patch)
2012-11-20 05:56 PST, Marja Hölttä
no flags
Patch. (11.88 KB, patch)
2012-11-20 06:48 PST, Marja Hölttä
no flags
Patch. (11.88 KB, patch)
2012-11-20 06:50 PST, Marja Hölttä
no flags
Patch. (11.88 KB, patch)
2012-11-20 06:51 PST, Marja Hölttä
no flags
Patch (17.11 KB, patch)
2012-11-20 10:06 PST, Marja Hölttä
abarth: review-
Marja Hölttä
Comment 1 2012-11-20 05:56:48 PST
jochen
Comment 2 2012-11-20 06:12:55 PST
Comment on attachment 175198 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=175198&action=review > Source/WebCore/loader/cache/CachedResourceLoader.h:163 > + void startTrackingCahcedResourceRequests() { m_shouldTrackRequests = true; } Cahced -> Cached > LayoutTests/fast/loader/cached-resource-request-callbacks.html:16 > +internals.startTrackingCachedResourceRequests(); can you write the test such that it fails gracefully if you don't run it in DRT? i.e. something like if (!window.internals) testFailed("Requires DRT to run"); > LayoutTests/fast/loader/cached-resource-request-callbacks.html:20 > +"empty-script.js SCRIPT normal-script-tag", nit. indent 4 spaces > LayoutTests/fast/loader/cached-resource-request-callbacks.html:60 > + if (contains(requests[i], expected[expectedIx])) { nit. strange indent? 7 spaces, should be 8 also, no { } required for single line if bodies > LayoutTests/fast/loader/cached-resource-request-callbacks.html:81 > + This test checks that the initiators of CachedResourceRequests are set correctly. indent 4 spaces
jochen
Comment 3 2012-11-20 06:13:50 PST
Comment on attachment 175198 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=175198&action=review > Source/WebCore/loader/cache/CachedResourceLoader.h:184 > + Vector<String> m_trackedRequests; we could consider to turn this into an OwnPtr to save some bytes when not running tests
Marja Hölttä
Comment 4 2012-11-20 06:48:00 PST
Marja Hölttä
Comment 5 2012-11-20 06:50:42 PST
Marja Hölttä
Comment 6 2012-11-20 06:51:59 PST
Marja Hölttä
Comment 7 2012-11-20 06:54:14 PST
(The latest patch addresses all comments.)
jochen
Comment 8 2012-11-20 06:54:56 PST
Comment on attachment 175204 [details] Patch. View in context: https://bugs.webkit.org/attachment.cgi?id=175204&action=review > Source/WebCore/ChangeLog:17 > + (WebCore::CachedResourceLoader::startTrackingCahcedResourceRequests): Cahced > Source/WebCore/loader/cache/CachedResourceLoader.cpp:951 > + m_trackedRequests = adoptPtr(new Vector<String>); should we maybe reset the tracked requests when we start tracking them again? > LayoutTests/fast/loader/cached-resource-request-callbacks.html:38 > + document.getElementById("with-background").style.backgroundImage="url(../images/resources/palatted-color-png-gamma-one-color-profile.png)"; nit. spaces around = > LayoutTests/fast/loader/cached-resource-request-callbacks.html:63 > + if (expectedIx == expected.length) { no { } for single lines ifs and elses > LayoutTests/fast/loader/cached-resource-request-callbacks.html:102 > +<img id="img-fail" /> can you add another image that has a URL which points to a non-existant file?
Build Bot
Comment 9 2012-11-20 06:57:36 PST
Build Bot
Comment 10 2012-11-20 07:13:56 PST
kov's GTK+ EWS bot
Comment 11 2012-11-20 07:14:06 PST
kov's GTK+ EWS bot
Comment 12 2012-11-20 07:24:37 PST
Build Bot
Comment 13 2012-11-20 07:29:51 PST
Build Bot
Comment 14 2012-11-20 08:16:43 PST
Marja Hölttä
Comment 15 2012-11-20 10:06:47 PST
Marja Hölttä
Comment 16 2012-11-20 10:08:41 PST
Thanks for comments again, the latest patch fixes them.
Adam Barth
Comment 17 2012-11-20 10:56:31 PST
Comment on attachment 175239 [details] Patch This is too much test code in the production binary. I thought you were going to add a willSendRequest equivalent for CachedResourceRequests. Can't we go further down that path and get something that tests this code the way we plan to use it?
Marja Hölttä
Comment 18 2012-11-22 02:14:44 PST
I'll close this, and I'll add tests as part of reviving bug 92761.
Note You need to log in before you can comment on or make changes to this bug.