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

Unified Diff: third_party/WebKit/LayoutTests/editing/spelling/spellcheck_test.js

Issue 2734013002: Implement cold mode invocation for idle time spell checker (Closed)
Patch Set: rebased Mar 7 Created 3 years, 9 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: third_party/WebKit/LayoutTests/editing/spelling/spellcheck_test.js
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/spellcheck_test.js b/third_party/WebKit/LayoutTests/editing/spelling/spellcheck_test.js
index 6ce39b2419fd36677645facc4b6ab1e7610cada6..86302b36be3d911af3bc9657bcf57cefae123d14 100644
--- a/third_party/WebKit/LayoutTests/editing/spelling/spellcheck_test.js
+++ b/third_party/WebKit/LayoutTests/editing/spelling/spellcheck_test.js
@@ -290,6 +290,8 @@ const kTitle = 'title';
const kCallback = 'callback';
/** @type {string} */
const kIsSpellcheckTest = 'isSpellcheckTest';
+/** @type {string} */
+const kNeedsFullCheck = 'needsFullCheck';
// Spellchecker gets triggered not only by text and selection change, but also
// by focus change. For example, misspelling markers in <INPUT> disappear when
@@ -357,9 +359,13 @@ function invokeSpellcheckTest(testObject, input, tester, expectedText) {
});
};
- if (internals.idleTimeSpellCheckerState !== undefined &&
- internals.idleTimeSpellCheckerState(sample.document) === 'HotModeRequested') {
+ if (internals.idleTimeSpellCheckerState !== undefined) {
+ if (internals.idleTimeSpellCheckerState(sample.document) === 'HotModeRequested')
internals.runIdleTimeSpellChecker(sample.document);
+ if (testObject.properties[kNeedsFullCheck]) {
+ while (internals.idleTimeSpellCheckerState(sample.document) !== 'Inactive')
+ internals.runIdleTimeSpellChecker(sample.document);
+ }
}
// For a test that does not create new spell check request, a synchronous
@@ -407,7 +413,7 @@ add_result_callback(testObj => {
function getTestArguments(passedArgs) {
const args = {};
args[kIsSpellcheckTest] = true;
- [kTitle, kCallback].forEach(key => args[key] = undefined);
+ [kTitle, kCallback, kNeedsFullCheck].forEach(key => args[key] = undefined);
if (!passedArgs)
return args;
@@ -416,7 +422,8 @@ function getTestArguments(passedArgs) {
return args;
}
- [kTitle, kCallback].forEach(key => args[key] = passedArgs[key]);
+ [kTitle, kCallback, kNeedsFullCheck].forEach(
+ key => args[key] = passedArgs[key]);
return args;
}

Powered by Google App Engine
This is Rietveld 408576698