Index: components/test_runner/test_runner.cc |
diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc |
index f186060753e6d4b5a73571966675f6e9c2181082..d684316db47eb4d336a3f798342f01e96a2999f0 100644 |
--- a/components/test_runner/test_runner.cc |
+++ b/components/test_runner/test_runner.cc |
@@ -214,6 +214,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> { |
void SetDomainRelaxationForbiddenForURLScheme(bool forbidden, |
const std::string& scheme); |
void SetDumpConsoleMessages(bool value); |
+ void SetMockSpellCheckerEnabled(bool enabled); |
void SetImagesAllowed(bool allowed); |
void SetIsolatedWorldContentSecurityPolicy(int world_id, |
const std::string& policy); |
@@ -514,6 +515,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder( |
&TestRunnerBindings::SetDomainRelaxationForbiddenForURLScheme) |
.SetMethod("setDumpConsoleMessages", |
&TestRunnerBindings::SetDumpConsoleMessages) |
+ .SetMethod("setMockSpellCheckerEnabled", |
+ &TestRunnerBindings::SetMockSpellCheckerEnabled) |
.SetMethod("setIconDatabaseEnabled", &TestRunnerBindings::NotImplemented) |
.SetMethod("setImagesAllowed", &TestRunnerBindings::SetImagesAllowed) |
.SetMethod("setIsolatedWorldContentSecurityPolicy", |
@@ -705,6 +708,11 @@ void TestRunnerBindings::SetDumpConsoleMessages(bool enabled) { |
runner_->SetDumpConsoleMessages(enabled); |
} |
+void TestRunnerBindings::SetMockSpellCheckerEnabled(bool enabled) { |
+ if (runner_) |
+ runner_->SetMockSpellCheckerEnabled(enabled); |
+} |
+ |
v8::Local<v8::Value> |
TestRunnerBindings::EvaluateScriptInIsolatedWorldAndReturnValue( |
int world_id, const std::string& script) { |
@@ -1629,6 +1637,8 @@ void TestRunner::Reset() { |
delegate_->CloseRemainingWindows(); |
else |
close_remaining_windows_ = true; |
+ |
+ spellcheck_->SetEnabled(false); |
} |
void TestRunner::SetTestIsRunning(bool running) { |
@@ -2570,6 +2580,10 @@ void TestRunner::SetDumpConsoleMessages(bool value) { |
OnLayoutTestRuntimeFlagsChanged(); |
} |
+void TestRunner::SetMockSpellCheckerEnabled(bool enabled) { |
+ spellcheck_->SetEnabled(enabled); |
+} |
+ |
bool TestRunner::ShouldDumpConsoleMessages() const { |
return layout_test_runtime_flags_.dump_console_messages(); |
} |