2 * Copyright (C) 2016 Red Hat, Inc. (www.redhat.com)
4 * This library is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library. If not, see <http://www.gnu.org/licenses/>.
17 #include "evolution-config.h"
19 #include <e-util/e-util.h>
21 #include "test-html-editor-units-utils.h"
23 #include "test-html-editor-units-bugs.h"
26 test_bug_726548 (TestFixture
*fixture
)
30 const gchar
*expected_plain
=
36 /* This test is known to fail, skip it. */
40 if (!test_utils_run_simple_test (fixture
,
43 "action:style-list-number\n"
44 "type:a\\nb\\nc\\n\\n\n"
48 HTML_PREFIX
"<div style=\"width: 71ch;\">aaa</div>"
49 "<ol style=\"width: 65ch;\">"
50 "<li>a</li><li>b</li><li>c</li></ol>"
51 "<div style=\"width: 71ch;\"><br></div>" HTML_SUFFIX
,
57 text
= test_utils_get_clipboard_text (FALSE
);
58 success
= test_utils_html_equal (fixture
, text
, expected_plain
);
61 g_warning ("%s: clipboard Plain text \n---%s---\n does not match expected Plain\n---%s---",
62 G_STRFUNC
, text
, expected_plain
);
71 test_bug_750657 (TestFixture
*fixture
)
73 if (!test_utils_process_commands (fixture
,
79 test_utils_insert_content (fixture
,
80 "<html><head></head><body>\n"
81 "<blockquote type=\"cite\">\n"
82 "<div>This is the first paragraph of a quoted text which has some long text to test. It has the second sentence as well.</div>\n"
84 "<div>This is the third paragraph of a quoted text which has some long text to test. It has the second sentence as well.</div>\n"
85 "<blockquote type=\"cite\">\n"
86 "<div>This is the first paragraph of a sub-quoted text which has some long text to test. It has the second sentence as well.</div>\n"
89 "<div>This is the fourth paragraph of a quoted text which has some long text to test. It has the second sentence as well.</div>\n"
93 E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
95 if (!test_utils_run_simple_test (fixture
,
98 "<blockquote type=\"cite\">\n"
99 "<div>This is the first paragraph of a quoted text which has some long text to test. It has the second sentence as well.</div>\n"
101 "<div>This is the third paragraph of a quoted text which has some long text to test. It has the second sentence as well.</div>\n"
102 "<blockquote type=\"cite\">\n"
105 "<div>This is the fourth paragraph of a quoted text which has some long text to test. It has the second sentence as well.</div>\n"
116 test_bug_760989 (TestFixture
*fixture
)
118 if (!test_utils_process_commands (fixture
,
125 test_utils_insert_content (fixture
,
126 "<html><head></head><body>\n"
127 "One line before quotation<br>\n"
128 "<blockquote type=\"cite\">\n"
129 "<div>Single line quoted.</div>\n"
132 E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
134 if (!test_utils_run_simple_test (fixture
,
136 HTML_PREFIX
"<div>One line before quotation</div>\n"
137 "<blockquote type=\"cite\">\n"
138 "<div>Single line quoted.</div>\n"
139 "</blockquote>" HTML_SUFFIX
,
140 "One line before quotation\n"
141 "> Single line quoted.")) {
146 if (!test_utils_run_simple_test (fixture
,
148 HTML_PREFIX
"<div>One line before quotation</div>\n"
149 "<blockquote type=\"cite\">\n"
150 "<div>Single line quoted</div>\n"
151 "</blockquote>" HTML_SUFFIX
,
152 "One line before quotation\n"
153 "> Single line quoted")) {
160 test_bug_767903 (TestFixture
*fixture
)
162 if (!test_utils_run_simple_test (fixture
,
164 "type:This is the first line:\\n\n"
165 "action:style-list-bullet\n"
166 "type:First item\\n\n"
167 "type:Second item\n",
168 HTML_PREFIX
"<div style=\"width: 71ch;\">This is the first line:</div>"
169 "<ul style=\"width: 68ch;\">"
170 "<li>First item</li><li>Second item<br></li></ul>" HTML_SUFFIX
,
171 "This is the first line:\n"
178 if (!test_utils_run_simple_test (fixture
,
181 HTML_PREFIX
"<div style=\"width: 71ch;\">This is the first line:</div>"
182 "<ul style=\"width: 68ch;\">"
183 "<li>First item</li><li>Second item<br></li></ul>" HTML_SUFFIX
,
184 "This is the first line:\n"
193 test_bug_769708 (TestFixture
*fixture
)
195 if (!test_utils_process_commands (fixture
,
201 test_utils_insert_content (fixture
,
202 "<html><head><style id=\"-x-evo-quote-style\" type=\"text/css\">.-x-evo-quoted { -webkit-user-select: none; }</style>"
203 "<style id=\"-x-evo-style-a\" type=\"text/css\">a { cursor: text; }</style></head>"
204 "<body data-evo-draft=\"\" data-evo-plain-text=\"\" spellcheck=\"true\">"
205 "<div data-evo-paragraph=\"\" id=\"-x-evo-input-start\">aaa</div>"
206 "<div class=\"-x-evo-signature-wrapper\"><span class=\"-x-evo-signature\" id=\"autogenerated\"><pre>-- <br></pre>"
207 "<div data-evo-paragraph=\"\">user <user@no.where></div>"
208 "</span></div></body></html>",
209 E_CONTENT_EDITOR_INSERT_REPLACE_ALL
| E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
211 if (!test_utils_run_simple_test (fixture
,
213 HTML_PREFIX
"<div>aaa</div><div><span><pre>-- <br></pre>"
214 "<div>user <user@no.where></div>"
215 "</span></div>" HTML_SUFFIX
,
218 "user <user@no.where>"))
223 test_bug_769913 (TestFixture
*fixture
)
225 if (!test_utils_process_commands (fixture
,
231 if (!test_utils_run_simple_test (fixture
,
234 HTML_PREFIX
"<div>ab</div>" HTML_SUFFIX
,
240 if (!test_utils_run_simple_test (fixture
,
242 HTML_PREFIX
"<div>ab</div>" HTML_SUFFIX
,
248 if (!test_utils_run_simple_test (fixture
,
250 HTML_PREFIX
"<div>ab</div>" HTML_SUFFIX
,
256 if (!test_utils_run_simple_test (fixture
,
258 HTML_PREFIX
"<div>ab</div>" HTML_SUFFIX
,
264 if (!test_utils_run_simple_test (fixture
,
266 HTML_PREFIX
"<div>ab</div>" HTML_SUFFIX
,
272 if (!test_utils_run_simple_test (fixture
,
274 HTML_PREFIX
"<div>ab</div>" HTML_SUFFIX
,
280 if (!test_utils_run_simple_test (fixture
,
282 HTML_PREFIX
"<div>ab</div>" HTML_SUFFIX
,
288 if (!test_utils_run_simple_test (fixture
,
290 HTML_PREFIX
"<div>ab</div>" HTML_SUFFIX
,
296 if (!test_utils_run_simple_test (fixture
,
298 HTML_PREFIX
"<div>ab</div>" HTML_SUFFIX
,
304 if (!test_utils_run_simple_test (fixture
,
306 HTML_PREFIX
"<div>ab</div>" HTML_SUFFIX
,
314 test_bug_769955 (TestFixture
*fixture
)
316 test_utils_set_clipboard_text ("http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines", FALSE
);
318 /* Use paste action, pretty the same as Ctrl+V */
320 if (!test_utils_run_simple_test (fixture
,
324 "action:style-preformat\n",
326 "<a href=\"http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines\">"
327 "http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines</a></pre>"
329 "http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines")) {
334 if (!test_utils_run_simple_test (fixture
,
337 "action:style-normal\n"
341 "action:style-preformat\n",
343 "[1] <a href=\"http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines\">"
344 "http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines</a></pre>" HTML_SUFFIX
,
345 "[1] http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines")) {
350 if (!test_utils_run_simple_test (fixture
,
353 "action:style-normal\n"
358 "action:style-preformat\n",
360 "[2] <a href=\"http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines\">"
361 "http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines</a></pre>" HTML_SUFFIX
,
362 "[2] http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines")) {
367 if (!test_utils_run_simple_test (fixture
,
370 "action:style-normal\n"
375 "action:style-preformat\n",
377 "[3] <a href=\"http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines\">"
378 "http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines</a></pre>" HTML_SUFFIX
,
379 "[3] http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines")) {
384 if (!test_utils_run_simple_test (fixture
,
387 "action:style-normal\n"
392 "action:style-preformat\n",
394 "[4] <a href=\"http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines\">"
395 "http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines</a></pre>" HTML_SUFFIX
,
396 "[4] http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines")) {
401 /* Use Shift+Insert instead of paste action */
403 if (!test_utils_run_simple_test (fixture
,
406 "action:style-normal\n"
410 "action:style-preformat\n",
412 "<a href=\"http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines\">"
413 "http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines</a></pre>"
415 "http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines")) {
420 if (!test_utils_run_simple_test (fixture
,
423 "action:style-normal\n"
427 "action:style-preformat\n",
429 "[5] <a href=\"http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines\">"
430 "http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines</a></pre>" HTML_SUFFIX
,
431 "[5] http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines")) {
436 if (!test_utils_run_simple_test (fixture
,
439 "action:style-normal\n"
444 "action:style-preformat\n",
446 "[6] <a href=\"http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines\">"
447 "http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines</a></pre>" HTML_SUFFIX
,
448 "[6] http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines")) {
453 if (!test_utils_run_simple_test (fixture
,
456 "action:style-normal\n"
461 "action:style-preformat\n",
463 "[7] <a href=\"http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines\">"
464 "http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines</a></pre>" HTML_SUFFIX
,
465 "[7] http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines")) {
470 if (!test_utils_run_simple_test (fixture
,
473 "action:style-normal\n"
478 "action:style-preformat\n",
480 "[8] <a href=\"http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines\">"
481 "http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines</a></pre>" HTML_SUFFIX
,
482 "[8] http://www.example.com/this-is-a-very-long-link-which-should-not-be-wrapped-into-multiple-lines")) {
489 test_bug_770073 (TestFixture
*fixture
)
491 if (!test_utils_process_commands (fixture
,
497 test_utils_insert_content (fixture
,
499 "<div><span>the 1st line text</span></div>"
501 "<div><span>the 3rd line text</span></div>"
502 "<span class=\"-x-evo-to-body\" data-credits=\"On Today, User wrote:\"></span><span class=\"-x-evo-cite-body\"></span>",
503 E_CONTENT_EDITOR_INSERT_REPLACE_ALL
| E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
505 if (!test_utils_run_simple_test (fixture
,
507 HTML_PREFIX
"<div style=\"width: 71ch;\">On Today, User wrote:</div>"
508 "<blockquote type=\"cite\">"
509 "<div style=\"width: 71ch;\">> the 1st line text</div>"
510 "<div style=\"width: 71ch;\">> the 3rd line text</div>"
511 "</blockquote>" HTML_SUFFIX
,
512 "On Today, User wrote:\n"
513 "> the 1st line text\n"
514 "> the 3rd line text")) {
519 if (!test_utils_process_commands (fixture
,
525 test_utils_insert_content (fixture
,
527 "<div><span>the first line text</span></div>"
529 "<div><span>the third line text</span></div>"
530 "<span class=\"-x-evo-to-body\" data-credits=\"On Today, User wrote:\"></span><span class=\"-x-evo-cite-body\"></span>",
531 E_CONTENT_EDITOR_INSERT_REPLACE_ALL
| E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
533 if (!test_utils_run_simple_test (fixture
,
535 HTML_PREFIX
"<div>On Today, User wrote:</div>"
536 "<blockquote type=\"cite\">"
537 "<div><span>the first line text</span></div>"
538 "<div><span>the third line text</span></div>"
539 "</blockquote>" HTML_SUFFIX
,
540 "On Today, User wrote:\n"
541 "> the first line text\n"
542 "> the third line text"))
548 test_bug_770074 (TestFixture
*fixture
)
550 if (!test_utils_process_commands (fixture
,
556 test_utils_insert_content (fixture
,
558 "<div><span>the 1st line text</span></div>"
560 "<div><span>the 3rd line text</span></div>"
561 "<span class=\"-x-evo-to-body\" data-credits=\"On Today, User wrote:\"></span><span class=\"-x-evo-cite-body\"></span>",
562 E_CONTENT_EDITOR_INSERT_REPLACE_ALL
| E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
564 if (!test_utils_run_simple_test (fixture
,
568 HTML_PREFIX
"<div style=\"width: 71ch;\">On Today, User wrote:</div>"
569 "<blockquote type=\"cite\">"
570 "<div style=\"width: 71ch;\">> the 1st line text</div>"
571 "<div style=\"width: 71ch;\">> the 3rd line text</div>"
572 "</blockquote>" HTML_SUFFIX
,
573 "On Today, User wrote:\n"
574 "> the 1st line text\n"
575 "> the 3rd line text"))
580 test_bug_771044 (TestFixture
*fixture
)
582 if (!test_utils_run_simple_test (fixture
,
583 "type:123 456\\n789 abc\\n\n"
594 test_bug_771131 (TestFixture
*fixture
)
596 if (!test_utils_process_commands (fixture
,
602 test_utils_insert_content (fixture
,
603 "<body><pre>On <date1>, <name1> wrote:\n"
604 "<blockquote type=\"cite\">\n"
607 "Goodbye</blockquote>"
608 "<div><span>the 3rd line text</span></div>"
609 "</pre><span class=\"-x-evo-to-body\" data-credits=\"On Sat, 2016-09-10 at 20:00 +0000, example@example.com wrote:\"></span>"
610 "<span class=\"-x-evo-cite-body\"></span></body>",
611 E_CONTENT_EDITOR_INSERT_REPLACE_ALL
| E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
613 if (!test_utils_run_simple_test (fixture
,
615 HTML_PREFIX
"<div style=\"width: 71ch;\">On Sat, 2016-09-10 at 20:00 +0000, example@example.com wrote:</div>"
616 "<blockquote type=\"cite\">"
617 "<div style=\"width: 71ch;\">> On <date1>, <name1> wrote:</div>"
618 "<blockquote type=\"cite\">"
619 "<div style=\"width: 71ch;\">> > Hello</div>"
620 "<div style=\"width: 71ch;\">> > <br></div>"
621 "<div style=\"width: 71ch;\">> > Goodbye</div>"
623 "<div style=\"width: 71ch;\">> <br></div>"
624 "<div style=\"width: 71ch;\">> the 3rd line text</div>"
627 "On Sat, 2016-09-10 at 20:00 +0000, example@example.com wrote:\n"
628 "> On <date1>, <name1> wrote:\n"
633 "> the 3rd line text"))
638 test_bug_771493 (TestFixture
*fixture
)
640 if (!test_utils_process_commands (fixture
,
646 test_utils_insert_content (fixture
,
648 "----- Original Message -----\n"
649 "<blockquote type=\"cite\">\n"
652 "</pre><span class=\"-x-evo-to-body\" data-credits=\"On Thu, 2016-09-15 at 08:08 -0400, user wrote:\"></span>"
653 "<span class=\"-x-evo-cite-body\"></span></body>",
654 E_CONTENT_EDITOR_INSERT_REPLACE_ALL
| E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
656 if (!test_utils_run_simple_test (fixture
,
658 HTML_PREFIX
"<div style=\"width: 71ch;\">On Thu, 2016-09-15 at 08:08 -0400, user wrote:</div>"
659 "<blockquote type=\"cite\">"
660 "<div style=\"width: 71ch;\">> <br></div>"
661 "<div style=\"width: 71ch;\">> ----- Original Message -----</div>"
662 "<blockquote type=\"cite\">"
663 "<div style=\"width: 71ch;\">> > This week summary:</div>"
667 "On Thu, 2016-09-15 at 08:08 -0400, user wrote:\n"
669 "> ----- Original Message -----\n"
670 "> > This week summary:"))
675 test_bug_772171 (TestFixture
*fixture
)
677 if (!test_utils_process_commands (fixture
,
683 test_utils_insert_content (fixture
,
687 "<span class=\"-x-evo-to-body\" data-credits=\"On Thu, 2016-09-15 at 08:08 -0400, user wrote:\"></span>"
688 "<span class=\"-x-evo-cite-body\"></span></body>",
689 E_CONTENT_EDITOR_INSERT_REPLACE_ALL
| E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
691 if (!test_utils_run_simple_test (fixture
,
693 HTML_PREFIX
"<div style=\"width: 71ch;\">On Thu, 2016-09-15 at 08:08 -0400, user wrote:</div>"
694 "<blockquote type=\"cite\">"
695 "<div style=\"width: 71ch;\">> <br></div>"
696 "<div style=\"width: 71ch;\">> b</div>"
699 "On Thu, 2016-09-15 at 08:08 -0400, user wrote:\n"
706 test_bug_772513 (TestFixture
*fixture
)
708 EContentEditor
*cnt_editor
;
709 gboolean set_signature_from_message
, check_if_signature_is_changed
, ignore_next_signature_change
;
711 test_utils_fixture_change_setting_boolean (fixture
, "org.gnome.evolution.mail", "composer-reply-start-bottom", TRUE
);
713 if (!test_utils_process_commands (fixture
,
719 cnt_editor
= test_utils_get_content_editor (fixture
);
721 e_content_editor_insert_signature (
726 &set_signature_from_message
,
727 &check_if_signature_is_changed
,
728 &ignore_next_signature_change
);
730 if (!test_utils_run_simple_test (fixture
,
732 HTML_PREFIX
"<div style=\"width: 71ch;\"><br></div>" HTML_SUFFIX
,
738 test_bug_772918 (TestFixture
*fixture
)
740 if (!test_utils_run_simple_test (fixture
,
747 HTML_PREFIX
"<div>a b 1 2 3 c d</div>" HTML_SUFFIX
,
753 test_bug_773164 (TestFixture
*fixture
)
755 test_utils_set_clipboard_text ("This is paragraph 1\n\nThis is paragraph 2\n\nThis is a longer paragraph 3", FALSE
);
757 if (!test_utils_run_simple_test (fixture
,
764 "seq:huuuue\n" /* Go to the end of the first line */
767 "seq:dde\n" /* Go to the end of the last line */
772 HTML_PREFIX
"<div style=\"width: 71ch;\">This is paragraph 1</div>"
773 "<div style=\"width: 71ch;\"><br></div>"
774 "<div style=\"width: 71ch;\">This is a longer paragraph 3</div>"
775 "<div style=\"width: 71ch;\"><br></div>"
776 "<div style=\"width: 71ch;\">This is paragraph 2</div>"
778 "This is paragraph 1\n"
780 "This is a longer paragraph 3\n"
782 "This is paragraph 2"))
787 test_bug_775042 (TestFixture
*fixture
)
789 test_utils_insert_content (fixture
,
793 "<span class=\"-x-evo-to-body\" data-credits=\"On Fri, 2016-11-25 at 08:18 +0000, user wrote:\"></span>"
794 "<span class=\"-x-evo-cite-body\"></span></body>",
795 E_CONTENT_EDITOR_INSERT_REPLACE_ALL
| E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
797 if (!test_utils_run_simple_test (fixture
,
800 HTML_PREFIX
"<div style=\"width: 71ch;\">On Fri, 2016-11-25 at 08:18 +0000, user wrote:</div>"
801 "<blockquote type=\"cite\">"
807 "On Fri, 2016-11-25 at 08:18 +0000, user wrote:\n"
815 test_bug_775691 (TestFixture
*fixture
)
817 if (!test_utils_run_simple_test (fixture
,
819 "type:abc def ghi\\n\n"
824 HTML_PREFIX
"<div style=\"width: 71ch;\">abc def ghi</div>"
825 "<div style=\"width: 71ch;\">def</div>"
833 test_bug_779707 (TestFixture
*fixture
)
835 test_utils_fixture_change_setting_boolean (fixture
, "org.gnome.evolution.mail", "composer-reply-start-bottom", TRUE
);
836 test_utils_fixture_change_setting_boolean (fixture
, "org.gnome.evolution.mail", "composer-wrap-quoted-text-in-replies", FALSE
);
838 if (!test_utils_process_commands (fixture
,
844 test_utils_insert_content (fixture
,
848 "</pre><span class=\"-x-evo-to-body\" data-credits=\"Credits:\"></span>"
849 "<span class=\"-x-evo-cite-body\"></span>",
850 E_CONTENT_EDITOR_INSERT_REPLACE_ALL
| E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
852 if (!test_utils_run_simple_test (fixture
,
854 "type:a very long text, which splits into multiple lines when this paragraph is not marked as preformatted, but as normal, as it should be\n"
856 HTML_PREFIX
"<div style=\"width: 71ch;\">Credits:</div>"
857 "<blockquote type=\"cite\">"
858 "<pre>> line 1</pre>"
860 "<div style=\"width: 71ch;\"><br></div>"
861 "<div style=\"width: 71ch;\">a very long text, which splits into multiple lines when this paragraph is not marked as preformatted, but as normal, as it should be</div>"
862 "<div style=\"width: 71ch;\"><br></div>"
863 "<blockquote type=\"cite\">"
864 "<pre>> line 3</pre>"
866 "<div style=\"width: 71ch;\"><br></div>"
871 "a very long text, which splits into multiple lines when this paragraph\n"
872 "is not marked as preformatted, but as normal, as it should be\n"
879 test_bug_780275_html (TestFixture
*fixture
)
881 test_utils_set_clipboard_text ("line 1\nline 2\nline 3", FALSE
);
883 if (!test_utils_run_simple_test (fixture
,
887 "action:paste-quote\n"
888 "undo:save\n" /* 1 */
897 "undo:save\n" /* 1 */
903 HTML_PREFIX
"<div>line 0</div>"
904 "<blockquote type=\"cite\">"
918 test_bug_780275_plain (TestFixture
*fixture
)
920 test_utils_set_clipboard_text ("line 1\nline 2\nline 3", FALSE
);
922 if (!test_utils_run_simple_test (fixture
,
926 "action:paste-quote\n"
927 "undo:save\n" /* 1 */
936 "undo:save\n" /* 1 */
941 HTML_PREFIX
"<div style=\"width: 71ch;\">line 0</div>"
942 "<blockquote type=\"cite\">"
943 "<div style=\"width: 71ch;\">> Xline 1</div>"
944 "<div style=\"width: 71ch;\">> line 2</div>"
946 "<div style=\"width: 71ch;\">line 4</div>"
956 test_bug_781722 (TestFixture
*fixture
)
958 if (!test_utils_process_commands (fixture
,
964 test_utils_insert_content (fixture
,
965 "<pre>Signed-off-by: User <<a href=\"mailto:user@no.where\">user@no.where</a>>\n"
966 "</pre><span class=\"-x-evo-to-body\" data-credits=\"Credits:\"></span>"
967 "<span class=\"-x-evo-cite-body\"></span>",
968 E_CONTENT_EDITOR_INSERT_REPLACE_ALL
| E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
970 if (!test_utils_run_simple_test (fixture
,
972 "action:style-preformat\n",
973 HTML_PREFIX
"<div style=\"width: 71ch;\">Credits:</div>"
974 "<blockquote type=\"cite\">"
975 "<pre>> Signed-off-by: User <<a href=\"mailto:user@no.where\">user@no.where</a>></pre>"
979 "> Signed-off-by: User <user@no.where>"))
984 test_bug_781116 (TestFixture
*fixture
)
986 test_utils_fixture_change_setting_boolean (fixture
, "org.gnome.evolution.mail", "composer-wrap-quoted-text-in-replies", FALSE
);
988 if (!test_utils_process_commands (fixture
,
994 test_utils_insert_content (fixture
,
995 "<pre>a very long text, which splits into multiple lines when this paragraph is not marked as preformatted, but as normal, as it should be</pre>\n"
996 "</pre><span class=\"-x-evo-to-body\" data-credits=\"Credits:\"></span>"
997 "<span class=\"-x-evo-cite-body\"></span>",
998 E_CONTENT_EDITOR_INSERT_REPLACE_ALL
| E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
1000 if (!test_utils_run_simple_test (fixture
,
1002 "action:wrap-lines\n",
1003 HTML_PREFIX
"<div style=\"width: 71ch;\">Credits:</div>"
1004 "<blockquote type=\"cite\">"
1005 "<pre>> a very long text, which splits into multiple lines when this<br>"
1006 "> paragraph is not marked as preformatted, but as normal, as it should<br>"
1011 "> a very long text, which splits into multiple lines when this\n"
1012 "> paragraph is not marked as preformatted, but as normal, as it should\n"
1018 test_bug_780088 (TestFixture
*fixture
)
1020 if (!test_utils_process_commands (fixture
,
1026 test_utils_set_clipboard_text ("Seeing @blah instead of @foo XX'ed on" UNICODE_NBSP
"https://example.sub" UNICODE_NBSP
"domain.org/page I'd recommend to XX YY <https://example.subdomain.org/p/user/> , click fjwvne on the left, click skjd sjewncj on the right, and set wqje wjfdn Xs to something like wqjfnm www.example.com/~user wjfdncj or such.", FALSE
);
1028 if (!test_utils_run_simple_test (fixture
,
1031 HTML_PREFIX
"<div style=\"width: 71ch;\">"
1032 "Seeing @blah instead of @foo XX'ed on <a href=\"https://example.sub\">https://example.sub</a>"
1033 " domain.org/page I'd recommend to XX YY "
1034 "<<a href=\"https://example.subdomain.org/p/user/\">https://example.subdomain.org/p/user/</a>> , "
1035 "click fjwvne on the left, click skjd sjewncj on the right, and set wqje wjfdn Xs to something like "
1036 "wqjfnm <a href=\"www.example.com/~user\">www.example.com/~user</a> wjfdncj or such.</div>"
1037 "</div><div style=\"width: 71ch;\"><br></div>"
1039 "Seeing @blah instead of @foo XX'ed on" UNICODE_NBSP
"https://example.sub" UNICODE_NBSP
"domain.org/pa\n"
1040 "ge I'd recommend to XX YY <https://example.subdomain.org/p/user/> ,\n"
1041 "click fjwvne on the left, click skjd sjewncj on the right, and set wqje\n"
1042 "wjfdn Xs to something like wqjfnm www.example.com/~user wjfdncj or\n"
1048 test_bug_788829 (TestFixture
*fixture
)
1050 test_utils_fixture_change_setting_boolean (fixture
, "org.gnome.evolution.mail", "composer-wrap-quoted-text-in-replies", TRUE
);
1051 test_utils_fixture_change_setting_int32 (fixture
, "org.gnome.evolution.mail", "composer-word-wrap-length", 71);
1053 if (!test_utils_process_commands (fixture
,
1059 test_utils_insert_content (fixture
,
1060 "<div>Xxxxx xx xxxxxxxxx xx xxxxxxx xx xxxxx xxxx xxxx xx xxx xxx xxxx xxx xxxçx xôxé "
1061 "\"xxxxx xxxx xxxxxxx xxx\" xx xxxx xxxxé xxx xxx xxxéx xxx x'x xéxxxxé x'xxxxxxxxx xx "
1062 "xxx \"<a href=\"https://gnome.org\">Xxxx XXX Xxxxxx Xxx</a>\". Xx xxxx xxxxxxxx xxx <a"
1063 " href=\"https://gnome.org/\">xxxxxxxxxxxxxxxx.xx</a> (xxxxxxx xxxxxxxxxx xx .xxx). Xxxx "
1064 "êxxx xxx xxxxxxxxxxx xxxéxxxxxxxx, xxxx xxxxx xx XXX xx xéxxx à xx xxx \"xxx xxxxxx xxxx "
1065 "xx xxxxxxx\" xx xxxx xx xxxxx xxxxxxxx xxxxxxxx xx $ xx xxxx x'xxxxxx.</div><div><br>"
1066 "</div><div>Xxxx xx xéxxxxxxx, xxxxxxxx xxxxxxx (!), xxxxxxx à xxx, xxxx ooo$ XXX xxxxé: "
1067 "<a href=\"https://gnome.org\">https://xxxxxxxxxxxxxxxx.xx/xxxxxxx/xxxxx-xxxx-xxxxxxxx-x"
1068 "xxxx-xxxx-xxx-xxxxxxxx-xxx/</a> xx xx xxxx xéxéxxxxxxx x'xxxxxx xxxx xx xxxxxx xx xxxxxx"
1069 "xxxxxx xx xxx (xxxxx Xxxxxx) xxxx xxxx x'xxxxxxx xx xxxxxx: <a href=\"https://gnome.org\">"
1070 "https://xxxxxxxxxxxxxxxx.xxx/xx-xxxxxxx/xxxxxxx/Xxxxxxxxxxxx-Xxxxx-Xxxx-XXX-Xxxxxx-Xxx.xxx"
1071 "</a></div><div><br></div><div>Xxxx xxx xxx xxxxxxx xxxxxxxéxx x'xxxêxxxx à xxxxx, xxx xx x"
1072 "xxxé xx oooxooo xxxxx xxxxx xxxx... xxxx x'xxx xxxxxxxxxxxx xxxxx xxx xxxxxxxx xx \"xx xxx"
1073 "xx xxx xxx xxxxxxx xxxxxxx xxxxxxxxxxxxxx xxxx xxxxx xxxxxx xx xx xxxx xx x'xxxxxx\". Xx "
1074 "xxxx-êxxx xxx xx xxxxxxxx xx xxxx \"x'xxxêxx à xxxxx xx oooxooo xxxx xxx xéxxxxxxxx, xxxx"
1075 "\"...</div><div><br></div><div>Xxxxx xxxxxx'xx xxx x xxxx xxxxxxx xxxxx xx xxèx xxxxxxxxx "
1076 "xxxxxxxxxxxxxxxx à xx xxx x'xx xx xêxx (éxxxxxxxxx xxxx-xx-xxxxxxxx): <a href=\"https://"
1077 "gnome.org\">https://xxxxxxxxxxxxxxxx.xxx/xx-xxxxxxx/xxxxxxx/Xxxxx-xxxx-xxx-xxxxxxxxxx-xx"
1078 "xxx.xxx</a> ; </div><div><br></div><div>...x'x xxxxx xx xxxxxx x'xxxxxx xéxxxxxxx, "
1079 "xx xxx xxxx xxxxxx x'xxxxxxxxxxx xxxxxx, xxxx <a href=\"https://gnome.org\">https://xxxx"
1080 "xxxxxxxxxxxx.xxx/xxxxxxxx-xxxxxxx-xxxx-xxx-o/</a> xxxxx xxx <a href=\"https://gnome.org/\""
1081 ">https://xxxxxxxxxxxxxxxx.xxx/xxxxxxxx-xxxxxxx-xxxx-xxx-o/</a> ...</div>"
1082 "<span class=\"-x-evo-to-body\" data-credits=\"On Today, User wrote:\"></span>"
1083 "<span class=\"-x-evo-cite-body\"></span>",
1084 E_CONTENT_EDITOR_INSERT_REPLACE_ALL
| E_CONTENT_EDITOR_INSERT_TEXT_HTML
);
1086 if (!test_utils_run_simple_test (fixture
,
1088 HTML_PREFIX
"<div style=\"width: 71ch;\">On Today, User wrote:</div><blockquote type=\"cite\" "
1089 "style=\"margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex\">"
1090 "<div style=\"width: 71ch;\">> Xxxxx xx xxxxxxxxx xx xxxxxxx xx xxxxx xxxx "
1091 "xxxx xx xxx xxx xxxx xxx<br>> xxxçx xôxé \"xxxxx xxxx xxxxxxx xxx\" xx xxxx "
1092 "xxxxé xxx xxx xxxéx xxx<br>> x'x xéxxxxé x'xxxxxxxxx xx xxx \"Xxxx XXX Xxxxxx "
1093 "Xxx\". Xx xxxx<br>> xxxxxxxx xxx xxxxxxxxxxxxxxxx.xx (xxxxxxx xxxxxxxxxx xx .xx"
1094 "x). Xxxx<br>> êxxx xxx xxxxxxxxxxx xxxéxxxxxxxx, xxxx xxxxx xx XXX xx xéxxx à "
1095 "xx<br>> xxx \"xxx xxxxxx xxxx xx xxxxxxx\" xx xxxx xx xxxxx xxxxxxxx xxxxxxxx"
1096 "<br>> xx $ xx xxxx x'xxxxxx.</div><div style=\"width: 71ch;\">> <br></div>"
1097 "<div style=\"width: 71ch;\">> Xxxx xx xéxxxxxxx, xxxxxxxx xxxxxxx (!), "
1098 "xxxxxxx à xxx, xxxx ooo$ XXX<br>> xxxxé: https://xxxxxxxxxxxxxxxx.xx/xxx"
1099 "xxxx/xxxxx-xxxx-xxxxxxxx-xxxxx-<br>> xxxx-xxx-xxxxxxxx-xxx/ xx xx xxxx "
1100 "xéxéxxxxxxx x'xxxxxx xxxx xx xxxxxx<br>> xx xxxxxxxxxxxx xx xxx (xxxxx "
1101 "Xxxxxx) xxxx xxxx x'xxxxxxx xx xxxxxx: <br>> https://xxxxxxxxxxxxxxxx.xx"
1102 "x/xx-xxxxxxx/xxxxxxx/Xxxxxxxxxxxx-Xxxxx-Xx<br>> xx-XXX-Xxxxxx-Xxx.xxx</div>"
1103 "<div style=\"width: 71ch;\">> <br></div><div style=\"width: 71ch;\">> Xx"
1104 "xx xxx xxx xxxxxxx xxxxxxxéxx x'xxxêxxxx à xxxxx, xxx xx xxxxé xx<br>> oooxo"
1105 "oo xxxxx xxxxx xxxx... xxxx x'xxx xxxxxxxxxxxx xxxxx xxx<br>> xxxxxxxx xx \""
1106 "xx xxxxx xxx xxx xxxxxxx xxxxxxx xxxxxxxxxxxxxx xxxx<br>> xxxxx xxxxxx xx xx "
1107 "xxxx xx x'xxxxxx\". Xx xxxx-êxxx xxx xx xxxxxxxx xx<br>> xxxx \"x'xxxêxx à "
1108 "xxxxx xx oooxooo xxxx xxx xéxxxxxxxx, xxxx\"...</div><div style=\"width: 71ch;\">"
1109 "> <br></div><div style=\"width: 71ch;\">> Xxxxx xxxxxx'xx xxx x xxxx xxxxxxx "
1110 "xxxxx xx xxèx xxxxxxxxx<br>> <br>> xxxxxxxxxxxxxxxx à xx xxx x'xx xx xêxx "
1111 "(éxxxxxxxxx xxxx-xx-xxxxxxxx): <a href=\"https://xxxxxxxxxxxxxxxx.xxx/xx-xxxxxxx/"
1112 "xxxxxxx/Xxxxx-xxxx-xxx-xxxxxxxxxx-xxxxx.xxx\">https://xxxxxxxxxxxxxxxx.xxx/xx-xxx"
1113 "xxxx/xxxxxxx/Xxxxx-xxxx-xxx-<br>> xxxxxxxxxx-xxxxx.xxx</a> ; </div><div "
1114 "style=\"width: 71ch;\">> <br></div><div style=\"width: 71ch;\">> ...x'x "
1115 "xxxxx xx xxxxxx x'xxxxxx xéxxxxxxx, xx xxx xxxx xxxxxx<br>> x'xxxxxxxxxxx "
1116 "xxxxxx, xxxx https://xxxxxxxxxxxxxxxx.xxx/xxxxxxxx-xxxx<br>> xxx-xxxx-xxx-o/ "
1117 "xxxxx xxx https://xxxxxxxxxxxxxxxx.xxx/xxxxxxxx-xxxxx<br>> xx-xxxx-xxx-o/ ...</div>" HTML_SUFFIX
,
1118 "On Today, User wrote:\n"
1119 "> Xxxxx xx xxxxxxxxx xx xxxxxxx xx xxxxx xxxx xxxx xx xxx xxx xxxx xxx\n"
1120 "> xxxçx xôxé \"xxxxx xxxx xxxxxxx xxx\" xx xxxx xxxxé xxx xxx xxxéx xxx\n"
1121 "> x'x xéxxxxé x'xxxxxxxxx xx xxx \"Xxxx XXX Xxxxxx Xxx\". Xx xxxx\n"
1122 "> xxxxxxxx xxx xxxxxxxxxxxxxxxx.xx (xxxxxxx xxxxxxxxxx xx .xxx). Xxxx\n"
1123 "> êxxx xxx xxxxxxxxxxx xxxéxxxxxxxx, xxxx xxxxx xx XXX xx xéxxx à xx\n"
1124 "> xxx \"xxx xxxxxx xxxx xx xxxxxxx\" xx xxxx xx xxxxx xxxxxxxx xxxxxxxx\n"
1125 "> xx $ xx xxxx x'xxxxxx.\n"
1127 "> Xxxx xx xéxxxxxxx, xxxxxxxx xxxxxxx (!), xxxxxxx à xxx, xxxx ooo$ XXX\n"
1128 "> xxxxé: https://xxxxxxxxxxxxxxxx.xx/xxxxxxx/xxxxx-xxxx-xxxxxxxx-xxxxx-\n"
1129 "> xxxx-xxx-xxxxxxxx-xxx/ xx xx xxxx xéxéxxxxxxx x'xxxxxx xxxx xx xxxxxx\n"
1130 "> xx xxxxxxxxxxxx xx xxx (xxxxx Xxxxxx) xxxx xxxx x'xxxxxxx xx xxxxxx: \n"
1131 "> https://xxxxxxxxxxxxxxxx.xxx/xx-xxxxxxx/xxxxxxx/Xxxxxxxxxxxx-Xxxxx-Xx\n"
1132 "> xx-XXX-Xxxxxx-Xxx.xxx\n"
1134 "> Xxxx xxx xxx xxxxxxx xxxxxxxéxx x'xxxêxxxx à xxxxx, xxx xx xxxxé xx\n"
1135 "> oooxooo xxxxx xxxxx xxxx... xxxx x'xxx xxxxxxxxxxxx xxxxx xxx\n"
1136 "> xxxxxxxx xx \"xx xxxxx xxx xxx xxxxxxx xxxxxxx xxxxxxxxxxxxxx xxxx\n"
1137 "> xxxxx xxxxxx xx xx xxxx xx x'xxxxxx\". Xx xxxx-êxxx xxx xx xxxxxxxx xx\n"
1138 "> xxxx \"x'xxxêxx à xxxxx xx oooxooo xxxx xxx xéxxxxxxxx, xxxx\"...\n"
1140 "> Xxxxx xxxxxx'xx xxx x xxxx xxxxxxx xxxxx xx xxèx xxxxxxxxx\n"
1142 "> xxxxxxxxxxxxxxxx à xx xxx x'xx xx xêxx (éxxxxxxxxx xxxx-xx-xxxxxxxx): https://xxxxxxxxxxxxxxxx.xxx/xx-xxxxxxx/xxxxxxx/Xxxxx-xxxx-xxx-\n"
1143 "> xxxxxxxxxx-xxxxx.xxx ; \n"
1145 "> ...x'x xxxxx xx xxxxxx x'xxxxxx xéxxxxxxx, xx xxx xxxx xxxxxx\n"
1146 "> x'xxxxxxxxxxx xxxxxx, xxxx https://xxxxxxxxxxxxxxxx.xxx/xxxxxxxx-xxxx\n"
1147 "> xxx-xxxx-xxx-o/ xxxxx xxx https://xxxxxxxxxxxxxxxx.xxx/xxxxxxxx-xxxxx\n"
1148 "> xx-xxxx-xxx-o/ ..."))
1153 test_add_html_editor_bug_tests (void)
1155 test_utils_add_test ("/bug/726548", test_bug_726548
);
1156 test_utils_add_test ("/bug/750657", test_bug_750657
);
1157 test_utils_add_test ("/bug/760989", test_bug_760989
);
1158 test_utils_add_test ("/bug/767903", test_bug_767903
);
1159 test_utils_add_test ("/bug/769708", test_bug_769708
);
1160 test_utils_add_test ("/bug/769913", test_bug_769913
);
1161 test_utils_add_test ("/bug/769955", test_bug_769955
);
1162 test_utils_add_test ("/bug/770073", test_bug_770073
);
1163 test_utils_add_test ("/bug/770074", test_bug_770074
);
1164 test_utils_add_test ("/bug/771044", test_bug_771044
);
1165 test_utils_add_test ("/bug/771131", test_bug_771131
);
1166 test_utils_add_test ("/bug/771493", test_bug_771493
);
1167 test_utils_add_test ("/bug/772171", test_bug_772171
);
1168 test_utils_add_test ("/bug/772513", test_bug_772513
);
1169 test_utils_add_test ("/bug/772918", test_bug_772918
);
1170 test_utils_add_test ("/bug/773164", test_bug_773164
);
1171 test_utils_add_test ("/bug/775042", test_bug_775042
);
1172 test_utils_add_test ("/bug/775691", test_bug_775691
);
1173 test_utils_add_test ("/bug/779707", test_bug_779707
);
1174 test_utils_add_test ("/bug/780275/html", test_bug_780275_html
);
1175 test_utils_add_test ("/bug/780275/plain", test_bug_780275_plain
);
1176 test_utils_add_test ("/bug/781722", test_bug_781722
);
1177 test_utils_add_test ("/bug/781116", test_bug_781116
);
1178 test_utils_add_test ("/bug/780088", test_bug_780088
);
1179 test_utils_add_test ("/bug/788829", test_bug_788829
);