Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: third_party/WebKit/LayoutTests/fast/performance/longtasktiming.html

Issue 2422433002: Add a layout test for longtask timing (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/performance/longtasktiming.html
diff --git a/third_party/WebKit/LayoutTests/fast/performance/longtasktiming.html b/third_party/WebKit/LayoutTests/fast/performance/longtasktiming.html
new file mode 100644
index 0000000000000000000000000000000000000000..baa96a040233d907a1f8505a31da07a0271fc2f1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/performance/longtasktiming.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+
+async_test(function (t) {
+ var observer = new PerformanceObserver(
+ t.step_func(function (entryList) {
+ var entries = entryList.getEntries();
+ /* TODO(panicker): Update after fixing http://crbug.com/651461 */
+ for (var i = 0; i < entries.length; i++) {
+ assert_equals(entries[i].entryType, "longtask",
+ "entryType expected to be: longtask");
+ assert_equals(entries[i].name, "same-origin",
+ "name expected to be: same-origin");
+ assert_greater_than(entries[i].duration, 50000,
+ "duration expected to be greater than 50ms threshold");
+ }
+ observer.disconnect();
+ t.done();
+ })
+ );
+ observer.observe({entryTypes: ["longtask"]});
+
+ /* Generate a slow task */
+ var begin = window.performance.now();
+ while (window.performance.now() < begin + 51);
+
+}, "Performance longtask entries are observable");
+
+</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698