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

Unified Diff: LayoutTests/editing/spelling/focusing-other-frame.html

Issue 21235009: Make sure the last selection gets spell checked when focusing different frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 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
« no previous file with comments | « no previous file | LayoutTests/editing/spelling/focusing-other-frame-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/spelling/focusing-other-frame.html
diff --git a/LayoutTests/editing/spelling/focusing-other-frame.html b/LayoutTests/editing/spelling/focusing-other-frame.html
new file mode 100644
index 0000000000000000000000000000000000000000..d5dbb5633bcc0a0cd26069ccdfa8942ed567b733
--- /dev/null
+++ b/LayoutTests/editing/spelling/focusing-other-frame.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<iframe id="frame1" src="data:text/html,<body contenteditable></body>"></iframe>
+<iframe id="frame2" src="data:text/html,<body contenteditable></body>"></iframe>
+
+<script>
+
+description("Last word written in an editable in one frame should be " +
+"spellchecked when focusing other frame. To test manually type some " +
+"misspelled word in one frame and focus other frame. The word should be marked.");
+
+if (window.internals) {
+ internals.settings.setAsynchronousSpellCheckingEnabled(false);
+
+ var frame1 = document.getElementById("frame1");
+ var testEditable1 = frame1.contentWindow.document.createElement("div");
+ testEditable1.setAttribute("contentEditable", "true");
+ frame1.contentWindow.document.body.appendChild(testEditable1);
+ var frame2 = document.getElementById("frame2");
+ var testEditable2 = frame1.contentWindow.document.createElement("div");
+ testEditable2.setAttribute("contentEditable", "true");
+ frame2.contentWindow.document.body.appendChild(testEditable2);
+ testEditable1.focus();
+ frame1.contentWindow.document.execCommand("InsertText", false, "zz");
+ shouldBe('internals.markerCountForNode(testEditable1.childNodes[0], "spelling")', '0');
+ testEditable2.focus();
+ shouldBe('internals.markerCountForNode(testEditable1.childNodes[0], "spelling")', '1');
+} else {
+ alert("Automatic testing impossible. Test manually. See steps in the description.");
+}
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/editing/spelling/focusing-other-frame-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698