Title: [232033] trunk/LayoutTests
- Revision
- 232033
- Author
- [email protected]
- Date
- 2018-05-21 16:28:39 -0700 (Mon, 21 May 2018)
Log Message
REGRESSION: performance-api/performance-observer-entry-sort.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=185385
Reviewed by Saam Barati.
Add diagnostic assertions to test the hypothesis that performance.now is drifting backwards.
* performance-api/performance-observer-entry-sort.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (232032 => 232033)
--- trunk/LayoutTests/ChangeLog 2018-05-21 23:15:11 UTC (rev 232032)
+++ trunk/LayoutTests/ChangeLog 2018-05-21 23:28:39 UTC (rev 232033)
@@ -1,3 +1,14 @@
+2018-05-11 Ryosuke Niwa <[email protected]>
+
+ REGRESSION: performance-api/performance-observer-entry-sort.html is flaky
+ https://bugs.webkit.org/show_bug.cgi?id=185385
+
+ Reviewed by Saam Barati.
+
+ Add diagnostic assertions to test the hypothesis that performance.now is drifting backwards.
+
+ * performance-api/performance-observer-entry-sort.html:
+
2018-05-21 Daniel Bates <[email protected]>
REGRESSION (r231107): CSP report-only policies are ignored for beacon, importScripts, fetch(), EventSource, and XHR
Modified: trunk/LayoutTests/performance-api/performance-observer-entry-sort.html (232032 => 232033)
--- trunk/LayoutTests/performance-api/performance-observer-entry-sort.html 2018-05-21 23:15:11 UTC (rev 232032)
+++ trunk/LayoutTests/performance-api/performance-observer-entry-sort.html 2018-05-21 23:28:39 UTC (rev 232033)
@@ -8,10 +8,19 @@
description("Test PerformanceObserver mutating itself while in its callback.");
window.jsTestIsAsync = true;
+function assert(assertion)
+{
+ if (!assertion())
+ console.log(`Assertion "${assertion}" failed`);
+}
+
function wait() {
- let now = performance.now();
- while (now === performance.now())
- continue;
+ let start = performance.now();
+ let now;
+ do {
+ now = performance.now();
+ } while (start === now);
+ assert(() => now > start);
}
let observer = new PerformanceObserver((list) => {
@@ -57,6 +66,12 @@
shouldBeEqualToString(`list.getEntries()[6].name`, "measure-matching-mark2-2");
shouldBeEqualToString(`list.getEntries()[7].name`, "mark3");
+ const mark2 = list.getEntries().find((entry) => entry.name == 'mark2');
+ const mark3 = list.getEntries().find((entry) => entry.name == 'mark3');
+ assert(() => mark2.startTime <= mark2Time);
+ assert(() => mark3Time <= mark3.startTime);
+ assert(() => mark2.startTime < mark3.startTime);
+
finishJSTest();
});
@@ -66,10 +81,13 @@
performance.measure("measure1");
wait(); // Ensure mark1 !== mark2 startTime by making sure performance.now advances.
performance.mark("mark2");
+const mark2Time = performance.now();
performance.measure("measure2");
performance.measure("measure-matching-mark2-1", "mark2");
wait(); // Ensure mark2 !== mark3 startTime by making sure performance.now advances.
+const mark3Time = performance.now();
performance.mark("mark3");
+assert(() => mark3Time > mark2Time);
performance.measure("measure3");
performance.measure("measure-matching-mark2-2", "mark2");
</script>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes