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

Unified Diff: third_party/WebKit/LayoutTests/idle-callback/test-runner-run-idle-tasks.html

Issue 1832673002: Add testRunner.runIdleTasks() to force idle tasks to run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: rebase Created 4 years, 8 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
Index: third_party/WebKit/LayoutTests/idle-callback/test-runner-run-idle-tasks.html
diff --git a/third_party/WebKit/LayoutTests/idle-callback/test-runner-run-idle-tasks.html b/third_party/WebKit/LayoutTests/idle-callback/test-runner-run-idle-tasks.html
new file mode 100644
index 0000000000000000000000000000000000000000..d5a36836e2768745c07fc6d4dccd24c9f1efa37f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/idle-callback/test-runner-run-idle-tasks.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<script src="../resources/js-test.js"></script>
+<div>Hello, world!</div>
+<script>
+description("Tests that testRunner.runIdleTasks will force idle tasks to run.");
+self.jsTestIsAsync = true;
+
+var x = false;
+
+function cb1(t) {
+ shouldBeFalse("x");
+ x = true;
+}
+
+function cb2(t) {
+ shouldBeTrue("x");
+ finishJSTest();
+}
+
+requestIdleCallback(cb1);
+if (self.testRunner)
+ testRunner.runIdleTasks(cb2);
+else
+ requestIdleCallback(cb2);
+</script>

Powered by Google App Engine
This is Rietveld 408576698