Auto merge of #25590 - pshaughn:perfobs, r=jdm

Make performance observers take "type" and "buffered" options without panicking.

<!-- Please describe your changes on the following line: -->
I updated the observe() method to align with spec, and fixed the borrow duration bug @jdm pointed out in #25589 so it wouldn't cause a hard crash. Some tests go from failing to passing, but others go from early failing to later timeout; performance observers still aren't doing the right thing in all cases.

---
<!-- 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 #24781 and fix #25589 and fix #23225

<!-- Either: -->
- [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. -->
This commit is contained in:
bors-servo 2020-02-12 11:09:52 -05:00 committed by GitHub
commit ed9b584344
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 171 additions and 205 deletions

View file

@ -1,9 +0,0 @@
[buffered-flag-after-timeout.any.html]
[PerformanceObserver with buffered flag sees entry after timeout]
expected: FAIL
[buffered-flag-after-timeout.any.worker.html]
[PerformanceObserver with buffered flag sees entry after timeout]
expected: FAIL

View file

@ -1,9 +0,0 @@
[buffered-flag-observer.any.html]
[PerformanceObserver with buffered flag should see past and future entries.]
expected: FAIL
[buffered-flag-observer.any.worker.html]
[PerformanceObserver with buffered flag should see past and future entries.]
expected: FAIL

View file

@ -8,12 +8,6 @@
[idlharness.any.worker.html]
[PerformanceObserver interface: operation takeRecords()]
expected: FAIL
[PerformanceObserver interface: observer must inherit property "takeRecords()" with the proper type]
expected: FAIL
[Test default toJSON operation of PerformanceMark]
expected: FAIL
@ -29,20 +23,11 @@
[PerformanceMark interface object length]
expected: FAIL
[PerformanceObserver interface: operation observe(PerformanceObserverInit)]
expected: FAIL
[idlharness.any.html]
[Untitled]
expected: FAIL
[PerformanceObserver interface: operation takeRecords()]
expected: FAIL
[PerformanceObserver interface: observer must inherit property "takeRecords()" with the proper type]
expected: FAIL
[Test default toJSON operation of PerformanceMark]
expected: FAIL
@ -58,9 +43,6 @@
[PerformanceMark interface object length]
expected: FAIL
[PerformanceObserver interface: operation observe(PerformanceObserverInit)]
expected: FAIL
[idlharness.https.any.serviceworker.html]
type: testharness

View file

@ -1,11 +0,0 @@
[multiple-buffered-flag-observers.any.html]
expected: ERROR
[Multiple PerformanceObservers with buffered flag see all entries]
expected: TIMEOUT
[multiple-buffered-flag-observers.any.worker.html]
expected: ERROR
[Multiple PerformanceObservers with buffered flag see all entries]
expected: TIMEOUT

View file

@ -1,9 +0,0 @@
[observer-buffered-false.any.html]
[PerformanceObserver without buffered flag set to false cannot see past entries.]
expected: FAIL
[observer-buffered-false.any.worker.html]
[PerformanceObserver without buffered flag set to false cannot see past entries.]
expected: FAIL

View file

@ -1,11 +0,0 @@
[po-callback-mutate.any.worker.html]
type: testharness
[PerformanceObserver modifications inside callback should update filtering and not clear buffer]
expected: FAIL
[po-callback-mutate.any.html]
type: testharness
[PerformanceObserver modifications inside callback should update filtering and not clear buffer]
expected: FAIL

View file

@ -1,33 +0,0 @@
[po-observe-type.any.html]
[Calling observe() with entryTypes and then type should throw an InvalidModificationError]
expected: FAIL
[Calling observe() with type and then entryTypes should throw an InvalidModificationError]
expected: FAIL
[Calling observe() with type and entryTypes should throw a SyntaxError]
expected: FAIL
[Passing in unknown values to type does throw an exception.]
expected: FAIL
[observe() with different type values stacks.]
expected: FAIL
[po-observe-type.any.worker.html]
[Calling observe() with entryTypes and then type should throw an InvalidModificationError]
expected: FAIL
[Calling observe() with type and then entryTypes should throw an InvalidModificationError]
expected: FAIL
[Calling observe() with type and entryTypes should throw a SyntaxError]
expected: FAIL
[Passing in unknown values to type does throw an exception.]
expected: FAIL
[observe() with different type values stacks.]
expected: FAIL

View file

@ -1,41 +0,0 @@
[po-observe.any.worker.html]
type: testharness
[Empty sequence entryTypes is a no-op]
expected: FAIL
[Unknown entryTypes are no-op]
expected: FAIL
[Check observer callback parameter and this values]
expected: FAIL
[no 'type' or 'entryTypes' throws a SyntaxError]
expected: FAIL
[Empty sequence entryTypes does not throw an exception.]
expected: FAIL
[Unknown entryTypes do not throw an exception.]
expected: FAIL
[po-observe.any.html]
type: testharness
[Empty sequence entryTypes is a no-op]
expected: FAIL
[Unknown entryTypes are no-op]
expected: FAIL
[Check observer callback parameter and this values]
expected: FAIL
[no 'type' or 'entryTypes' throws a SyntaxError]
expected: FAIL
[Empty sequence entryTypes does not throw an exception.]
expected: FAIL
[Unknown entryTypes do not throw an exception.]
expected: FAIL

View file

@ -1,3 +1,5 @@
[po-observe.html]
type: testharness
expected: CRASH
expected: TIMEOUT
[PerformanceObserverInit.buffered should retrieve previously buffered entries]
expected: TIMEOUT

View file

@ -1,9 +0,0 @@
[po-takeRecords.any.worker.html]
[Test PerformanceObserver's takeRecords()]
expected: FAIL
[po-takeRecords.any.html]
[Test PerformanceObserver's takeRecords()]
expected: FAIL

View file

@ -1,11 +1,7 @@
[buffered-flag.any.worker.html]
expected: ERROR
[PerformanceObserver with buffered flag sees previous resource entries.]
expected: TIMEOUT
expected: FAIL
[buffered-flag.any.html]
expected: ERROR
[PerformanceObserver with buffered flag sees previous resource entries.]
expected: TIMEOUT
expected: FAIL