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

Unified Diff: third_party/WebKit/LayoutTests/editing/spelling/resources/util.js

Issue 2224103003: Convert some spell-checking layout tests to use unified text checker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SpellCheckerDebugInfo
Patch Set: add setUnifiedTextCheckerEnabled(true) in util.js 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: third_party/WebKit/LayoutTests/editing/spelling/resources/util.js
diff --git a/third_party/WebKit/LayoutTests/editing/spelling/resources/util.js b/third_party/WebKit/LayoutTests/editing/spelling/resources/util.js
index 5f2522041a6e988395220b6a8aa3b0883cb449b2..4f1c4d16a3eb84432140a26c5c973849730c9339 100644
--- a/third_party/WebKit/LayoutTests/editing/spelling/resources/util.js
+++ b/third_party/WebKit/LayoutTests/editing/spelling/resources/util.js
@@ -66,3 +66,32 @@ function typeText(elem, text)
typeCharacterCommand(text[i]);
}
}
+
+function runNextStep(test, steps, assertions) {
+ if (!steps.length) {
+ test.done();
+ return;
+ }
+
+ var step = steps.shift();
+ var assertion = assertions.shift();
+
+ step();
+ step_timeout(() => {
+ test.step(() => assertion());
+ runNextStep(test, steps, assertions);
+ }, 50);
+}
+
+function runSpellingTest(steps, assertions, opt_title)
+{
+ var t = async_test(opt_title);
+ if (!window.internals) {
+ t.step(() => assert_unreached('internals is required for this test'));
+ t.done();
+ return;
+ }
+
+ internals.settings.setUnifiedTextCheckerEnabled(true);
+ runNextStep(t, steps, assertions);
+}

Powered by Google App Engine
This is Rietveld 408576698