Commit 67245b48 authored by tanvir.rizvi's avatar tanvir.rizvi Committed by Commit Bot

Apply testharness for copy-paste-ruby-text.html webtest.

Use testharness for copy-paste-ruby-text.html
and remove expected text.

Bug: 679977
Change-Id: I257da179cd3cdbf9e41ec1fd99a8ca6fe5726e71
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1498805Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Tanvir Rizvi <tanvir.rizvi@samsung.com>
Cr-Commit-Position: refs/heads/master@{#637622}
parent 903cc2ae
This tests copying and pasting text with ruby doesn't insert new lines before and after rt.To manually test, copy and paste the text into the textarea. There should be not new line in the textarea.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS textarea.value.indexOf('\n') is -1
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<script src="../../resources/js-test.js"></script>
</head>
<body>
<div id="container">
<div id="content" contenteditable>
<ruby>今日<rt>きょう</rt></ruby><ruby><rt></rt></ruby><ruby>天気<rt>てんき</rt></ruby>ですね。
<ruby><ruby><rt>ni</rt></ruby><ruby><rt>zai</rt></ruby><ruby>拉里<rt>zali</rt></ruby>
</div>
<textarea cols=50 rows=5></textarea>
</div>
<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
description("This tests copying and pasting text with ruby doesn't insert new lines before and after rt."
+ "To manually test, copy and paste the text into the textarea. There should be not new line in the textarea.");
document.getElementById('content').focus();
document.execCommand('SelectAll', false, null);
if (document.queryCommandSupported('Copy')) {
document.execCommand('Copy', false, null);
var textarea = document.querySelector('textarea');
textarea.focus();
document.execCommand('Paste', false, null);
shouldBe("textarea.value.indexOf('\\n')", "-1");
document.getElementById('container').style.display = 'none';
}
selection_test(
[
'<div contenteditable>',
'^<ruby>今日<rt>きょう</rt></ruby>',
'は<ruby>良<rt>よ</rt></ruby>い',
'<ruby>天気<rt>てんき</rt></ruby>ですね。',
'<ruby><ruby>你<rt>ni</rt></ruby>',
'<ruby>在<rt>zai</rt></ruby>',
'<ruby>拉里<rt>zali</rt></ruby>?',
'|</div>',
'<textarea cols=50 rows=5></textarea>',
],
selection => {
selection.document.execCommand('copy');
selection.document.querySelector('textarea').focus();
selection.document.execCommand('paste');
},
[
'<div contenteditable>',
'<ruby>今日<rt>きょう</rt></ruby>',
'は<ruby>良<rt>よ</rt></ruby>い',
'<ruby>天気<rt>てんき</rt></ruby>ですね。',
'<ruby><ruby>你<rt>ni</rt></ruby>',
'<ruby>在<rt>zai</rt></ruby>',
'<ruby>拉里<rt>zali</rt></ruby>?</ruby>',
'</div>',
'<textarea cols="50" rows="5">今日きょうは良よい天気てんきですね。你ni在zai拉里zali?|</textarea>',
],
'This tests copying and pasting text with ruby doesnot',
'insert new lines before and after rt.',
'To manually test, copy and paste the text into the textarea',
'There should be not new line in the textarea');
</script>
\ No newline at end of file
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment