-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(user-timing): fix clearing marks/measures by name #32120
Conversation
.as_ref() | ||
.map_or(true, |type_| *e.entry_type() != *type_) | ||
*e.entry_type() != *entry_type || | ||
name.as_ref().map_or(false, |name_| *e.name() != *name_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the name
is None
, then the expectation is that all marks/measures are removed. If it's Some
, then we need to compare the name and only remove entries that match.
Ah, I suspect that that wpt test directory is not part of the default set of enabled directories. We should update the test config to correct that! |
Ah, I see, so should I could do that in this PR or a separate one if you'd like. |
Why don't we make a separate PR that changes that file and adds the current set if expected results, then this PR can show the change in behavior more clearly? |
Alternatively, doing that work in this PR in two separate commits would also be ok. |
As discussed in #32120 (comment), this adds the WPT `user-timing` tests to the default list of WPT tests, and also commits the current status of the `user-timing` tests. --- <!-- 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] There are tests for these changes <!-- 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. -->
b1fd71f
to
e92fb1a
Compare
OK, now that #32123 is merged, I rebased on |
🔨 Triggering try run (#8775225338) for Linux WPT |
Test results for linux-wpt-layout-2013 from try job (#8775225338): Flaky unexpected result (12)
Stable unexpected results that are known to be intermittent (15)
|
Test results for linux-wpt-layout-2020 from try job (#8775225338): Flaky unexpected result (17)
Stable unexpected results that are known to be intermittent (18)
|
✨ Try run (#8775225338) succeeded. |
This fixes several tests in wpt/user-timing by fixing some logic errors in how marks/measures are cleared (via
clearMarks
andclearMeasures
).There are two changes:
clear_entries_by_name_and_type
so that, whenclearMarks('foo')
orclearMeasures('foo')
is called, the presence of the entry name correctly filters based on existing entry names.entry_name
param aDOMString
rather than anOption<DOMString>
since every API call has it asSome
anyway, and I'm not aware of any Performance APIs where you can clear all entries regardless of type. (This is not strictly required for the fix, but I think it makes the code easier to read.)I also considered adding the expected WPT results using(Update: added!)mach update-wpt
. But I'm not sure if you want these changes, since the expectations are currently missing (i.e.tests/wpt/meta/user-timing
does not exist).For the record, this PR fixes the following tests:
clearMarks.html.ini
clearMeasures.html.ini
clear_non_existent_mark.any.js.ini
clear_non_existent_measure.any.js.ini
clear_one_mark.any.js.ini
clear_one_measure.any.js.ini
In case you do want these meta files, here they are: nolanlawson@510e614./mach build -d
does not report any errors./mach test-tidy
does not report any errors