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

Unified Diff: LayoutTests/editing/spelling/spelling-marker-description.html

Issue 23534071: Use shouldBecomeEqual in asynchronous spellchecking tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Apply Tony's review and use asynchronous spellchecking in two tests Created 7 years, 3 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: LayoutTests/editing/spelling/spelling-marker-description.html
diff --git a/LayoutTests/editing/spelling/spelling-marker-description.html b/LayoutTests/editing/spelling/spelling-marker-description.html
index 6264c55d5de15baa9cb050956f62cecbb8e03225..79a9a5bc41e49f0fdd0a2f792d2f359e6fcaab66 100644
--- a/LayoutTests/editing/spelling/spelling-marker-description.html
+++ b/LayoutTests/editing/spelling/spelling-marker-description.html
@@ -10,33 +10,6 @@
<script>
-function verify(nretry)
-{
- if (!nretry) {
- finishJSTest()
- return;
- }
-
- var texts = destination.childNodes;
- markedText = null;
- for (var i = 0; i < texts.length; ++i) {
- if (internals.markerCountForNode(texts[i], "spelling")) {
- markedText = internals.markerRangeForNode(texts[i], "spelling", 0).toString();
- markerDescription = internals.markerDescriptionForNode(texts[i], "spelling", 0);
- break;
- }
- }
-
- if (markedText != null) {
- shouldBeEqualToString("markedText", "wellcome");
- shouldBeEqualToString("markerDescription", "welcome");
- finishJSTest();
- }
-
- // Wait until the async spellchecking is done.
- window.setTimeout(function() { verify(nretry - 1); }, 0);
-}
-
function test()
{
jsTestIsAsync = true;
@@ -49,7 +22,7 @@ function test()
document.execCommand("InsertHTML", false, "wellcome");
document.execCommand("InsertText", false, ".");
- window.setTimeout(function() { verify(10); }, 0);
+ shouldBecomeEqualToString('internals.markerDescriptionForNode(destination.firstChild, "spelling", 0)', 'welcome', finishJSTest);
}
description("The spellchecker should store replacement text in each marker.");

Powered by Google App Engine
This is Rietveld 408576698