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

Unified Diff: third_party/WebKit/LayoutTests/editing/execCommand/paste-1.html

Issue 1459783003: Make layout tests in editing/deleting and editing/execCommand to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/execCommand/paste-1.html
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/paste-1.html b/third_party/WebKit/LayoutTests/editing/execCommand/paste-1.html
index 3877e339894c6c94936fd9fbbc0f067d6ec55f40..815476e7472fa1be20a8371b157e6f1f38d07d77 100644
--- a/third_party/WebKit/LayoutTests/editing/execCommand/paste-1.html
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/paste-1.html
@@ -1,23 +1,25 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<script>
-if (window.testRunner)
- testRunner.dumpEditingCallbacks();
-
-function foo() {
+var tester = async_test('iframe');
+function runTest() {
+ if (window.internals)
+ internals.settings.setEditingBehavior('win');
var frame = frames[0];
- var sel = frame.getSelection();
+ var selection = frame.getSelection();
var doc = frame.document;
-
- sel.collapse(doc.body, 0);
- doc.execCommand("InsertText", false, "foo bar baz");
- sel.modify("extend", "backward", "word");
- doc.execCommand("Cut");
- doc.execCommand("Paste");
- if (window.testRunner)
- window.testRunner.notifyDone();
+
+ selection.collapse(doc.body, 0);
+ doc.execCommand('InsertText', false, 'foo bar baz');
+ selection.modify('extend', 'backward', 'word');
+ doc.execCommand('Cut');
+ doc.execCommand('Paste');
+
+ tester.step(function() { assert_equals(doc.body.innerHTML.replace(/&nbsp;/, ' ', 'g'), 'foo bar baz'); });
+ tester.done();
}
-if (window.testRunner)
- window.testRunner.waitUntilDone();
</script>
-
<p>This tests cut/paste inside an editable iframe. You should see 'foo bar baz' below.</p>
-<iframe src="../resources/contenteditable-iframe-src.html" onload="foo();"></iframe>
+<iframe srcdoc="<body contenteditable></body>" onload="runTest()"></iframe>
+<div id="log"></div>

Powered by Google App Engine
This is Rietveld 408576698