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

Unified Diff: components/test_runner/spell_check_client.h

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 | « no previous file | components/test_runner/spell_check_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/spell_check_client.h
diff --git a/components/test_runner/spell_check_client.h b/components/test_runner/spell_check_client.h
index af23e133f4ef0f11e083ce28e51c4befaeab94ce..cb0d7abc8a2b39c3f61b1ce3071d0201ea113ccb 100644
--- a/components/test_runner/spell_check_client.h
+++ b/components/test_runner/spell_check_client.h
@@ -13,6 +13,7 @@
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebVector.h"
#include "third_party/WebKit/public/web/WebSpellCheckClient.h"
+#include "v8/include/v8.h"
namespace blink {
class WebTextCheckingCompletion;
@@ -31,6 +32,14 @@ class SpellCheckClient : public blink::WebSpellCheckClient {
void SetDelegate(WebTestDelegate* delegate);
void SetEnabled(bool enabled);
+ // Sets a callback that will be invoked after each request is revoled.
+ void SetSpellCheckResolvedCallback(v8::Local<v8::Function> callback);
+
+ // Remove the above callback. Beware: don't call it inside the callback.
+ void RemoveSpellCheckResolvedCallback();
+
+ void Reset();
+
// blink::WebSpellCheckClient implementation.
void spellCheck(
const blink::WebString& text,
@@ -47,6 +56,8 @@ class SpellCheckClient : public blink::WebSpellCheckClient {
private:
void FinishLastTextCheck();
+ void RequestResolved();
+
// Do not perform any checking when |enabled_ == false|.
// Tests related to spell checking should enable it manually.
bool enabled_ = false;
@@ -57,6 +68,8 @@ class SpellCheckClient : public blink::WebSpellCheckClient {
blink::WebString last_requested_text_check_string_;
blink::WebTextCheckingCompletion* last_requested_text_checking_completion_;
+ v8::Persistent<v8::Function> resolved_callback_;
+
TestRunner* test_runner_;
WebTestDelegate* delegate_;
« no previous file with comments | « no previous file | components/test_runner/spell_check_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698