Commit ed11dbab authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added more range tests.

parent 0bc9f9a7
...@@ -33,8 +33,10 @@ ...@@ -33,8 +33,10 @@
static const char doc_blank[] = "<html></html>"; static const char doc_blank[] = "<html></html>";
static const char doc_str1[] = "<html><body>test</body></html>"; static const char doc_str1[] = "<html><body>test</body></html>";
static const char doc_str2[] = static const char range_test_str[] =
"<html><body>test \na<font size=\"2\">bc\t123<br /> it's\r\n \t</font>text<br /></body></html>"; "<html><body>test \na<font size=\"2\">bc\t123<br /> it's\r\n \t</font>text<br /></body></html>";
static const char range_test2_str[] =
"<html><body>abc<hr />123</body></html>";
static const char elem_test_str[] = static const char elem_test_str[] =
"<html><head><title>test</title><style>.body { margin-right: 0px; }</style>" "<html><head><title>test</title><style>.body { margin-right: 0px; }</style>"
"<body><a href=\"http://test\" name=\"x\">link</a><input />" "<body><a href=\"http://test\" name=\"x\">link</a><input />"
...@@ -940,6 +942,23 @@ static void test_txtrange(IHTMLDocument2 *doc) ...@@ -940,6 +942,23 @@ static void test_txtrange(IHTMLDocument2 *doc)
IHTMLTxtRange_Release(range); IHTMLTxtRange_Release(range);
} }
static void test_txtrange2(IHTMLDocument2 *doc)
{
IHTMLTxtRange *range;
range = test_create_body_range(doc);
test_range_text(range, "abc\r\n\r\n123");
test_range_move(range, characterW, 5, 5);
test_range_moveend(range, characterW, 1, 1);
test_range_text(range, "2");
test_range_move(range, characterW, -3, -3);
test_range_moveend(range, characterW, 3, 3);
test_range_text(range, "c\r\n\r\n1");
IHTMLTxtRange_Release(range);
}
static void test_compatmode(IHTMLDocument2 *doc) static void test_compatmode(IHTMLDocument2 *doc)
{ {
IHTMLDocument5 *doc5; IHTMLDocument5 *doc5;
...@@ -1441,7 +1460,8 @@ START_TEST(dom) ...@@ -1441,7 +1460,8 @@ START_TEST(dom)
CoInitialize(NULL); CoInitialize(NULL);
run_domtest(doc_str1, test_doc_elem); run_domtest(doc_str1, test_doc_elem);
run_domtest(doc_str2, test_txtrange); run_domtest(range_test_str, test_txtrange);
run_domtest(range_test2_str, test_txtrange2);
run_domtest(elem_test_str, test_elems); run_domtest(elem_test_str, test_elems);
run_domtest(doc_blank, test_defaults); run_domtest(doc_blank, test_defaults);
run_domtest(indent_test_str, test_indent); run_domtest(indent_test_str, test_indent);
......
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