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

Unified Diff: components/test_runner/test_runner.cc

Issue 2587823003: Allow test runner to run a callback when finishing a spellcheck request (Closed)
Patch Set: Created 4 years 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/test_runner/test_runner.cc
diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc
index e24c5b030855d78fd5bbd7356859d2c72d2c119a..d2a1d5a196ce3121ae0e519e40fea0e875e61c84 100644
--- a/components/test_runner/test_runner.cc
+++ b/components/test_runner/test_runner.cc
@@ -241,6 +241,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
void SetPrinting();
void SetScriptsAllowed(bool allowed);
void SetShouldStayOnPageAfterHandlingBeforeUnload(bool value);
+ void SetSpellCheckResolvedCallback(v8::Local<v8::Function> callback);
void SetStorageAllowed(bool allowed);
void SetTabKeyCyclesThroughElements(bool tab_key_cycles_through_elements);
void SetTextDirection(const std::string& direction_name);
@@ -560,6 +561,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
.SetMethod(
"setShouldStayOnPageAfterHandlingBeforeUnload",
&TestRunnerBindings::SetShouldStayOnPageAfterHandlingBeforeUnload)
+ .SetMethod("setSpellCheckResolvedCallback",
+ &TestRunnerBindings::SetSpellCheckResolvedCallback)
.SetMethod("setStorageAllowed", &TestRunnerBindings::SetStorageAllowed)
.SetMethod("setTabKeyCyclesThroughElements",
&TestRunnerBindings::SetTabKeyCyclesThroughElements)
@@ -748,6 +751,12 @@ void TestRunnerBindings::SetMockSpellCheckerEnabled(bool enabled) {
runner_->SetMockSpellCheckerEnabled(enabled);
}
+void TestRunnerBindings::SetSpellCheckResolvedCallback(
+ v8::Local<v8::Function> callback) {
+ if (runner_)
+ runner_->spellcheck_->SetSpellCheckResolvedCallback(callback);
+}
+
v8::Local<v8::Value>
TestRunnerBindings::EvaluateScriptInIsolatedWorldAndReturnValue(
int world_id, const std::string& script) {
@@ -1680,7 +1689,7 @@ void TestRunner::Reset() {
else
close_remaining_windows_ = true;
- spellcheck_->SetEnabled(false);
+ spellcheck_->Reset();
}
void TestRunner::SetTestIsRunning(bool running) {
« components/test_runner/test_runner.h ('K') | « components/test_runner/test_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698