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

Unified Diff: third_party/WebKit/LayoutTests/editing/pasteboard/paste-table-002.html

Issue 2370683002: Convert editing/pasteboard/paste-table-002.html to use w3c test harness (Closed)
Patch Set: 2016-09-26T15:49:39 Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/pasteboard/paste-table-002-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/pasteboard/paste-table-002.html
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/paste-table-002.html b/third_party/WebKit/LayoutTests/editing/pasteboard/paste-table-002.html
index f77ac9edeeaa0d4a7c9de1c48604c3b572233d03..c9a96c6ec1b24175258b8f89957409195633c625 100644
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/paste-table-002.html
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/paste-table-002.html
@@ -1,65 +1,39 @@
-<html>
-<head>
-
-<style>
-.editing {
- border: 2px solid red;
- font-size: 24px;
-}
-.explanation {
- border: 2px solid blue;
- padding: 12px;
- font-size: 24px;
- margin-bottom: 24px;
-}
-.scenario { margin-bottom: 16px;}
-.scenario:first-line { font-weight: bold; margin-bottom: 16px;}
-.expected-results:first-line { font-weight: bold }
-</style>
-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
-
-<script>
-function log(message) {
- var console = document.getElementById("console");
- var li = document.createElement("li");
- var text = document.createTextNode(message);
- li.appendChild(text);
- console.appendChild(li);
-}
-
-function editingTest() {
- execSelectAllCommand();
- copyCommand();
- execDeleteCommand();
- pasteCommand();
-}
-
-</script>
-
-<title>Editing Test</title>
-</head>
-<body>
-Problem: copy/pasting some HTML including tables can give rise to a &lt;div&gt; element as the first child of the table element. This is invalid.
-<div contenteditable id="root">
-<div id="test" class="editing">
-<div>
-abcdef
-<div style="text-align: center" >
-<table><tr><td>foo</td><td>bar</td></tr></table>
-ghijk
-</div>
-</div>
-</div>
-</div>
-
-<ol id="console" />
-
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
<script>
-runEditingTest();
-log(root.innerHTML);
-if (window.testRunner)
- testRunner.dumpAsText();
+test(() => {
+ assert_not_equals(window.internals, undefined,
+ 'This test requires window.internals to access clipboard');
+
+ assert_selection(
+ [
+ '<div contenteditable>',
+ '<div>',
+ '<div>',
+ '^abcdef',
+ '<div style="text-align: center;">',
+ '<table><tr><td>foo</td><td>bar</td></tr></table>',
+ '</div>',
Xiaocheng 2016/09/26 09:13:36 This <div> also contains |ghijk| in the original t
yosin_UTC9 2016/09/26 10:05:15 Done.
+ 'ghijk|',
+ '</div>',
+ '</div>',
+ '</div>',
+ ].join(''),
+ selection => {
+ selection.document.execCommand('copy');
+ selection.document.execCommand('delete');
+ selection.document.execCommand('paste');
+ },
+ [
+ '<div contenteditable>',
+ 'abcdef',
+ '<div style="text-align: center;">',
+ '<table><tbody><tr><td>foo</td><td>bar</td></tr></tbody></table>',
+ '</div>',
+ 'ghijk|',
+ '</div>',
+ ].join(''));
+});
</script>
-
-</body>
-</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/pasteboard/paste-table-002-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698