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

Unified Diff: components/test_runner/test_runner.cc

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
« no previous file with comments | « components/test_runner/test_runner.h ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/test_runner.cc
diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc
index e6f6a39180cc8dd6eb4102d9f99eac9e3f8a47dd..9f79dbbd68279633999e4604991fb9e4855d8bec 100644
--- a/components/test_runner/test_runner.cc
+++ b/components/test_runner/test_runner.cc
@@ -190,6 +190,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
void ResetTestHelperControllers();
void ResolveBeforeInstallPromptPromise(int request_id,
const std::string& platform);
+ void RunIdleTasks(v8::Local<v8::Function> callback);
void SendBluetoothManualChooserEvent(const std::string& event,
const std::string& argument);
void SetAcceptLanguages(const std::string& accept_languages);
@@ -474,6 +475,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
&TestRunnerBindings::ResetTestHelperControllers)
.SetMethod("resolveBeforeInstallPromptPromise",
&TestRunnerBindings::ResolveBeforeInstallPromptPromise)
+ .SetMethod("runIdleTasks",
+ &TestRunnerBindings::RunIdleTasks)
.SetMethod("selectionAsMarkup", &TestRunnerBindings::SelectionAsMarkup)
// The Bluetooth functions are specified at
@@ -1462,6 +1465,12 @@ void TestRunnerBindings::ResolveBeforeInstallPromptPromise(
runner_->ResolveBeforeInstallPromptPromise(request_id, platform);
}
+void TestRunnerBindings::RunIdleTasks(v8::Local<v8::Function> callback) {
+ if (!runner_)
+ return;
+ runner_->RunIdleTasks(callback);
+}
+
std::string TestRunnerBindings::PlatformName() {
if (runner_)
return runner_->platform_name_;
@@ -2952,6 +2961,11 @@ void TestRunner::ResolveBeforeInstallPromptPromise(
test_interfaces_->GetAppBannerClient()->ResolvePromise(request_id, platform);
}
+void TestRunner::RunIdleTasks(v8::Local<v8::Function> callback) {
+ delegate_->RunIdleTasks(
+ CreateClosureThatPostsV8Callback(callback));
+}
+
void TestRunner::SetPOSIXLocale(const std::string& locale) {
delegate_->SetLocale(locale);
}
« no previous file with comments | « components/test_runner/test_runner.h ('k') | components/test_runner/web_test_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698