Changeset 63326 in webkit
- Timestamp:
- Jul 14, 2010 9:45:54 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r63319 r63326 1 2010-07-14 Tony Gentilcore <tonyg@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Implement Web Timing redirectStart, redirectEnd, redirectCount 6 https://bugs.webkit.org/show_bug.cgi?id=42018 7 8 Tests pass with --web-timing. Expectations set to FAIL because disabled by default. 9 10 * fast/dom/script-tests/webtiming.js: Since this is not a redirect, redirect times and count should be zero. 11 (checkTimingBeforeLoad): 12 (checkWebTimingOnLoad): 13 (checkWebTimingAfterLoad): 14 * fast/dom/webtiming-expected.txt: 15 * fast/js/resources/js-test-pre.js: 16 (shouldBeGreaterThanOrEqual): Factored out so that other tests can share this method. 17 * http/tests/misc/resources/webtiming-one-redirect.html: Added. 18 * http/tests/misc/resources/webtiming-two-redirects.html: Added. 19 * http/tests/misc/webtiming-one-redirect-expected.txt: Added. 20 * http/tests/misc/webtiming-one-redirect.php: Added. 21 * http/tests/misc/webtiming-two-redirects-expected.txt: Added. 22 * http/tests/misc/webtiming-two-redirects.php: Added. 23 1 24 2010-07-14 Eric Carlson <eric.carlson@apple.com> 2 25 -
trunk/LayoutTests/fast/dom/Window/window-property-descriptors-expected.txt
r62880 r63326 459 459 PASS typeof Object.getOwnPropertyDescriptor(window, 'shouldBeEqualToString') is 'object' 460 460 PASS typeof Object.getOwnPropertyDescriptor(window, 'shouldBeFalse') is 'object' 461 PASS typeof Object.getOwnPropertyDescriptor(window, 'shouldBeGreaterThanOrEqual') is 'object' 461 462 PASS typeof Object.getOwnPropertyDescriptor(window, 'shouldBeNaN') is 'object' 462 463 PASS typeof Object.getOwnPropertyDescriptor(window, 'shouldBeNonNull') is 'object' -
trunk/LayoutTests/fast/dom/script-tests/webtiming.js
r63259 r63326 2 2 3 3 var performance = window.webkitPerformance || {}; 4 var navigation = performance.navigation || {}; 4 5 var timing = performance.timing || {}; 5 6 … … 15 16 window.addEventListener("load", sleepFiftyMilliseconds, false); 16 17 17 // FIXME: Move this to js-test-pre.js if it is needed by other tests.18 function shouldBeGreaterThanOrEqual(_a, _b) {19 if (typeof _a != "string" || typeof _b != "string")20 debug("WARN: shouldBeGreaterThanOrEqual expects string arguments");21 22 var exception;23 var _av;24 try {25 _av = eval(_a);26 } catch (e) {27 exception = e;28 }29 var _bv = eval(_b);30 31 if (exception)32 testFailed(_a + " should be >= " + _b + ". Threw exception " + exception);33 else if (typeof _av == "undefined" || _av < _bv)34 testFailed(_a + " should be >= " + _b + ". Was " + _av + " (of type " + typeof _av + ").");35 else36 testPassed(_a + " is >= " + _b);37 }38 39 18 function checkTimingBeforeLoad() 40 19 { … … 42 21 43 22 shouldBeGreaterThanOrEqual("timing.unloadEventEnd", "timing.navigationStart"); 23 24 shouldBe("timing.redirectStart", "0"); 25 shouldBe("timing.redirectEnd", "0"); 26 shouldBe("navigation.redirectCount", "0"); 44 27 45 28 shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); … … 67 50 68 51 shouldBeGreaterThanOrEqual("timing.unloadEventEnd", "timing.navigationStart"); 52 53 shouldBe("timing.redirectStart", "0"); 54 shouldBe("timing.redirectEnd", "0"); 55 shouldBe("navigation.redirectCount", "0"); 69 56 70 57 shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); … … 94 81 shouldBeGreaterThanOrEqual("timing.unloadEventEnd", "timing.navigationStart"); 95 82 83 shouldBe("timing.redirectStart", "0"); 84 shouldBe("timing.redirectEnd", "0"); 85 shouldBe("navigation.redirectCount", "0"); 86 96 87 shouldBeGreaterThanOrEqual("timing.fetchStart", "timing.navigationStart"); 97 88 -
trunk/LayoutTests/fast/dom/webtiming-expected.txt
r63259 r63326 6 6 FAIL timing.navigationStart should be >= oneHourAgoUTC. Was undefined (of type undefined). 7 7 FAIL timing.unloadEventEnd should be >= timing.navigationStart. Was undefined (of type undefined). 8 FAIL timing.redirectStart should be 0 (of type number). Was undefined (of type undefined). 9 FAIL timing.redirectEnd should be 0 (of type number). Was undefined (of type undefined). 10 FAIL navigation.redirectCount should be 0 (of type number). Was undefined (of type undefined). 8 11 FAIL timing.fetchStart should be >= timing.navigationStart. Was undefined (of type undefined). 9 12 FAIL timing.domainLookupStart should be 0 (of type number). Was undefined (of type undefined). … … 18 21 FAIL timing.navigationStart should be >= oneHourAgoUTC. Was undefined (of type undefined). 19 22 FAIL timing.unloadEventEnd should be >= timing.navigationStart. Was undefined (of type undefined). 23 FAIL timing.redirectStart should be 0 (of type number). Was undefined (of type undefined). 24 FAIL timing.redirectEnd should be 0 (of type number). Was undefined (of type undefined). 25 FAIL navigation.redirectCount should be 0 (of type number). Was undefined (of type undefined). 20 26 FAIL timing.fetchStart should be >= timing.navigationStart. Was undefined (of type undefined). 21 27 FAIL timing.domainLookupStart should be 0 (of type number). Was undefined (of type undefined). … … 31 37 FAIL timing.navigationStart should be >= oneHourAgoUTC. Was undefined (of type undefined). 32 38 FAIL timing.unloadEventEnd should be >= timing.navigationStart. Was undefined (of type undefined). 39 FAIL timing.redirectStart should be 0 (of type number). Was undefined (of type undefined). 40 FAIL timing.redirectEnd should be 0 (of type number). Was undefined (of type undefined). 41 FAIL navigation.redirectCount should be 0 (of type number). Was undefined (of type undefined). 33 42 FAIL timing.fetchStart should be >= timing.navigationStart. Was undefined (of type undefined). 34 43 FAIL timing.domainLookupStart should be 0 (of type number). Was undefined (of type undefined). -
trunk/LayoutTests/fast/js/resources/js-test-pre.js
r59602 r63326 219 219 } 220 220 221 function shouldBeGreaterThanOrEqual(_a, _b) { 222 if (typeof _a != "string" || typeof _b != "string") 223 debug("WARN: shouldBeGreaterThanOrEqual expects string arguments"); 224 225 var exception; 226 var _av; 227 try { 228 _av = eval(_a); 229 } catch (e) { 230 exception = e; 231 } 232 var _bv = eval(_b); 233 234 if (exception) 235 testFailed(_a + " should be >= " + _b + ". Threw exception " + exception); 236 else if (typeof _av == "undefined" || _av < _bv) 237 testFailed(_a + " should be >= " + _b + ". Was " + _av + " (of type " + typeof _av + ")."); 238 else 239 testPassed(_a + " is >= " + _b); 240 } 221 241 222 242 function shouldThrow(_a, _e) -
trunk/WebCore/ChangeLog
r63325 r63326 1 2010-07-14 Tony Gentilcore <tonyg@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Implement Web Timing redirectStart, redirectEnd, redirectCount 6 https://bugs.webkit.org/show_bug.cgi?id=42018 7 8 Tests: http/tests/misc/webtiming-one-redirect.php 9 http/tests/misc/webtiming-two-redirects.php 10 11 * loader/FrameLoaderTypes.h: 12 (WebCore::FrameLoadTimeline::FrameLoadTimeline): 13 * loader/MainResourceLoader.cpp: 14 (WebCore::MainResourceLoader::willSendRequest): This method is called for each request (including server redirects). fetchStart is updated to the current time on each invocation so that it represents fetching of the final document and doesn't include redirect time. For each redirect, redirectCount is incremented and redirectStart to redirectEnd measures the cumulative fetch time for all redirects. 15 * page/Navigation.cpp: 16 (WebCore::Navigation::redirectCount): http://dev.w3.org/2006/webapi/WebTiming/#nt-redirect-count 17 * page/Timing.cpp: 18 (WebCore::Timing::redirectStart): http://dev.w3.org/2006/webapi/WebTiming/#nt-redirect-start 19 (WebCore::Timing::redirectEnd): http://dev.w3.org/2006/webapi/WebTiming/#nt-redirect-end 20 * page/Timing.h: 21 * page/Timing.idl: 22 1 23 2010-07-14 Lucas De Marchi <lucas.demarchi@profusion.mobi> 2 24 -
trunk/WebCore/loader/FrameLoaderTypes.h
r63231 r63326 61 61 }; 62 62 63 // FIXME: Move this to a new header file. 63 64 struct FrameLoadTimeline { 64 65 FrameLoadTimeline() 65 : navigationStart(0) 66 , unloadEventEnd(0) 67 , fetchStart(0) 68 , responseEnd(0) 69 , loadEventStart(0) 70 , loadEventEnd(0) 66 : navigationStart(0.0) 67 , unloadEventEnd(0.0) 68 , redirectStart(0.0) 69 , redirectEnd(0.0) 70 , redirectCount(0) 71 , fetchStart(0.0) 72 , responseEnd(0.0) 73 , loadEventStart(0.0) 74 , loadEventEnd(0.0) 71 75 { 72 76 } … … 74 78 double navigationStart; 75 79 double unloadEventEnd; 80 double redirectStart; 81 double redirectEnd; 82 short redirectCount; 76 83 double fetchStart; 77 84 double responseEnd; -
trunk/WebCore/loader/MainResourceLoader.cpp
r63231 r63326 159 159 // reference to this object; one example of this is 3266216. 160 160 RefPtr<MainResourceLoader> protect(this); 161 162 frameLoader()->frameLoadTimeline()->fetchStart = currentTime(); 161 162 FrameLoadTimeline* frameLoadTimeline = frameLoader()->frameLoadTimeline(); 163 double fetchTime = currentTime(); 164 if (double fetchStart = frameLoadTimeline->fetchStart) { 165 if (!frameLoadTimeline->redirectCount++) 166 frameLoadTimeline->redirectStart = fetchStart; 167 frameLoadTimeline->redirectEnd = fetchTime; 168 } 169 frameLoadTimeline->fetchStart = fetchTime; 163 170 164 171 // Update cookie policy base URL as URL changes, except for subframes, which use the -
trunk/WebCore/page/Navigation.cpp
r62947 r63326 80 80 return 0; 81 81 82 return 0; // FIXME82 return m_frame->loader()->frameLoadTimeline()->redirectCount; 83 83 } 84 84 -
trunk/WebCore/page/Timing.cpp
r63259 r63326 71 71 return toIntegerMilliseconds(m_frame->loader()->frameLoadTimeline()->unloadEventEnd); 72 72 } 73 74 unsigned long long Timing::redirectStart() const 75 { 76 if (!m_frame) 77 return 0; 78 79 return toIntegerMilliseconds(m_frame->loader()->frameLoadTimeline()->redirectStart); 80 } 81 82 unsigned long long Timing::redirectEnd() const 83 { 84 if (!m_frame) 85 return 0; 86 87 return toIntegerMilliseconds(m_frame->loader()->frameLoadTimeline()->redirectEnd); 88 } 73 89 74 90 unsigned long long Timing::fetchStart() const -
trunk/WebCore/page/Timing.h
r63259 r63326 51 51 unsigned long long navigationStart() const; 52 52 unsigned long long unloadEventEnd() const; 53 unsigned long long redirectStart() const; 54 unsigned long long redirectEnd() const; 53 55 unsigned long long fetchStart() const; 54 56 unsigned long long domainLookupStart() const; -
trunk/WebCore/page/Timing.idl
r63259 r63326 33 33 // See: http://dev.w3.org/2006/webapi/WebTiming/ 34 34 interface [Conditional=WEB_TIMING, OmitConstructor] Timing { 35 // FIXME: Implement remainder of interface.36 35 readonly attribute unsigned long long navigationStart; 37 36 readonly attribute unsigned long long unloadEventEnd; 38 //readonly attribute unsigned long long redirectStart;39 //readonly attribute unsigned long long redirectEnd;37 readonly attribute unsigned long long redirectStart; 38 readonly attribute unsigned long long redirectEnd; 40 39 readonly attribute unsigned long long fetchStart; 41 40 readonly attribute unsigned long long domainLookupStart;
Note: See TracChangeset
for help on using the changeset viewer.