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

Unified Diff: components/scheduler/child/idle_helper.h

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: components/scheduler/child/idle_helper.h
diff --git a/components/scheduler/child/idle_helper.h b/components/scheduler/child/idle_helper.h
index 333c8674a36e85176d1420abda4543275d18c7ba..bea0e0ca56687a1a6243838bce05dd2e84d5aaf9 100644
--- a/components/scheduler/child/idle_helper.h
+++ b/components/scheduler/child/idle_helper.h
@@ -99,6 +99,11 @@ class SCHEDULER_EXPORT IdleHelper
// EnableLongIdlePeriod.
void EndIdlePeriod();
+ // Enter a long idle period that automatically ends when all queued
+ // idle tasks have run. The callback argument will be run after the
+ // idle period ends.
+ void RunIdleTasksForTesting(const base::Closure& callback);
+
// Returns true if a currently running idle task could exceed its deadline
// without impacting user experience too much. This should only be used if
// there is a task which cannot be pre-empted and is likely to take longer
@@ -187,6 +192,9 @@ class SCHEDULER_EXPORT IdleHelper
void OnIdleTaskPostedOnMainThread();
void UpdateLongIdlePeriodStateAfterIdleTask();
+ void EndIdlePeriodForTesting(const base::Closure& callback,
+ base::TimeTicks time_remaining);
+
void SetIdlePeriodState(IdlePeriodState new_state,
base::TimeTicks new_deadline,
base::TimeTicks optional_now);

Powered by Google App Engine
This is Rietveld 408576698