mshtml: Added more range tests.

This commit is contained in:
Jacek Caban 2008-01-10 23:51:38 +01:00 committed by Alexandre Julliard
parent 0bc9f9a7d5
commit ed11dbab6c
1 changed files with 22 additions and 2 deletions

View File

@ -33,8 +33,10 @@
static const char doc_blank[] = "<html></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>";
static const char range_test2_str[] =
"<html><body>abc<hr />123</body></html>";
static const char elem_test_str[] =
"<html><head><title>test</title><style>.body { margin-right: 0px; }</style>"
"<body><a href=\"http://test\" name=\"x\">link</a><input />"
@ -940,6 +942,23 @@ static void test_txtrange(IHTMLDocument2 *doc)
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)
{
IHTMLDocument5 *doc5;
@ -1441,7 +1460,8 @@ START_TEST(dom)
CoInitialize(NULL);
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(doc_blank, test_defaults);
run_domtest(indent_test_str, test_indent);