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

Unified Diff: components/test_runner/test_runner.cc

Issue 2270293003: Add a switch to TestRunner to enable/disable mock spell checker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebaselined tests Created 4 years, 4 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/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();
}

Powered by Google App Engine
This is Rietveld 408576698