mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #24508 - pajamapants3000:21254, r=jdm
Add start_time to resource timing. <!-- Please describe your changes on the following line: --> `start_time` property added to `ResourceFetchTiming`, which enables the setting of `start_time` in the `PerformanceEntry` member of `PerformanceResourceTiming`. Following the specification at https://w3c.github.io/resource-timing/#dfn-starttime, `start_time` is set to the value of `redirect_start` if redirection occurs and the timing allow check passes. Otherwise it has the same value as `fetch_start`. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #21254 <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
bf587f22d7
8 changed files with 277 additions and 15 deletions
|
@ -19634,7 +19634,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"mozilla/window_performance.html": [
|
||||
"690870b7080e179481ca0255f7c30337e8b6636a",
|
||||
"302073e8041763102d678326509d7ef0a1fb5c79",
|
||||
"testharness"
|
||||
],
|
||||
"mozilla/window_performance_topLevelDomComplete.html": [
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[window_performance.html]
|
||||
[window_performance]
|
||||
expected: FAIL
|
||||
|
|
@ -16,8 +16,13 @@ test(function() {
|
|||
assert_not_equals(entries.length, 0);
|
||||
assert_true(entries[0] instanceof PerformanceNavigationTiming);
|
||||
|
||||
// TODO(#21254) navigationTiming/startTime is not fully implemented yet, so this assertion will fail
|
||||
assert_greater_than(entries[0].startTime, 0);
|
||||
/* PerformanceResourceTiming */
|
||||
var resourceEntries = window.performance.getEntriesByType("resource");
|
||||
assert_not_equals(resourceEntries.length, 0);
|
||||
assert_true(resourceEntries[0] instanceof PerformanceResourceTiming);
|
||||
// no redirects => 0 < startTime == fetchStart
|
||||
assert_greater_than(resourceEntries[0].startTime, 0);
|
||||
assert_equals(resourceEntries[0].startTime, resourceEntries[0].fetchStart);
|
||||
|
||||
var last = window.performance.now();
|
||||
assert_greater_than(last, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue