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

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: fix typo... 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
« no previous file with comments | « components/test_runner/test_runner.h ('k') | no next file » | 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 e24c5b030855d78fd5bbd7356859d2c72d2c119a..b092c4b193b6f4cd84d1ebc8ac2fdd79365ab6a4 100644
--- a/components/test_runner/test_runner.cc
+++ b/components/test_runner/test_runner.cc
@@ -181,6 +181,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> {
const std::string& destination_protocol,
const std::string& destination_host,
bool allow_destination_subdomains);
+ void RemoveSpellCheckResolvedCallback();
void RemoveWebPageOverlay();
void ResetDeviceLight();
void ResetTestHelperControllers();
@@ -241,6 +242,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);
@@ -469,6 +471,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
.SetMethod("queueReload", &TestRunnerBindings::QueueReload)
.SetMethod("removeOriginAccessWhitelistEntry",
&TestRunnerBindings::RemoveOriginAccessWhitelistEntry)
+ .SetMethod("removeSpellCheckResolvedCallback",
+ &TestRunnerBindings::RemoveSpellCheckResolvedCallback)
.SetMethod("removeWebPageOverlay",
&TestRunnerBindings::RemoveWebPageOverlay)
.SetMethod("resetDeviceLight", &TestRunnerBindings::ResetDeviceLight)
@@ -560,6 +564,8 @@ gin::ObjectTemplateBuilder TestRunnerBindings::GetObjectTemplateBuilder(
.SetMethod(
"setShouldStayOnPageAfterHandlingBeforeUnload",
&TestRunnerBindings::SetShouldStayOnPageAfterHandlingBeforeUnload)
+ .SetMethod("setSpellCheckResolvedCallback",
+ &TestRunnerBindings::SetSpellCheckResolvedCallback)
.SetMethod("setStorageAllowed", &TestRunnerBindings::SetStorageAllowed)
.SetMethod("setTabKeyCyclesThroughElements",
&TestRunnerBindings::SetTabKeyCyclesThroughElements)
@@ -748,6 +754,17 @@ void TestRunnerBindings::SetMockSpellCheckerEnabled(bool enabled) {
runner_->SetMockSpellCheckerEnabled(enabled);
}
+void TestRunnerBindings::SetSpellCheckResolvedCallback(
+ v8::Local<v8::Function> callback) {
+ if (runner_)
+ runner_->spellcheck_->SetSpellCheckResolvedCallback(callback);
+}
+
+void TestRunnerBindings::RemoveSpellCheckResolvedCallback() {
+ if (runner_)
+ runner_->spellcheck_->RemoveSpellCheckResolvedCallback();
+}
+
v8::Local<v8::Value>
TestRunnerBindings::EvaluateScriptInIsolatedWorldAndReturnValue(
int world_id, const std::string& script) {
@@ -1680,7 +1697,7 @@ void TestRunner::Reset() {
else
close_remaining_windows_ = true;
- spellcheck_->SetEnabled(false);
+ spellcheck_->Reset();
}
void TestRunner::SetTestIsRunning(bool running) {
@@ -1922,6 +1939,10 @@ WebFrame* TestRunner::topLoadingFrame() const {
return top_loading_frame_;
}
+WebFrame* TestRunner::mainFrame() const {
+ return main_view_->mainFrame();
+}
+
void TestRunner::policyDelegateDone() {
DCHECK(layout_test_runtime_flags_.wait_until_done());
delegate_->TestFinished();
« no previous file with comments | « components/test_runner/test_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698