Jacek Caban : mshtml: Added IHTMLDocument2::[get|put]_title tests.
Alexandre Julliard
julliard at winehq.org
Thu Jul 24 06:57:04 CDT 2008
Module: wine
Branch: master
Commit: e629e049dbb22d114a863db1484f8e8dfc23d2f5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e629e049dbb22d114a863db1484f8e8dfc23d2f5
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Jul 23 13:17:21 2008 +0200
mshtml: Added IHTMLDocument2::[get|put]_title tests.
---
dlls/mshtml/tests/dom.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 2c25870..abaff25 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -1361,6 +1361,30 @@ static void _test_node_remove_child(unsigned line, IUnknown *unk, IHTMLDOMNode *
IHTMLDOMNode_Release(new_node);
}
+#define test_doc_title(d,t) _test_doc_title(__LINE__,d,t)
+static void _test_doc_title(unsigned line, IHTMLDocument2 *doc, const char *extitle)
+{
+ BSTR title = NULL;
+ HRESULT hres;
+
+ hres = IHTMLDocument2_get_title(doc, &title);
+ ok_(__FILE__,line) (hres == S_OK, "get_title failed: %08x\n", hres);
+ ok_(__FILE__,line) (!strcmp_wa(title, extitle), "unexpected title %s\n", dbgstr_w(title));
+ SysFreeString(title);
+}
+
+#define test_doc_set_title(d,t) _test_doc_set_title(__LINE__,d,t)
+static void _test_doc_set_title(unsigned line, IHTMLDocument2 *doc, const char *title)
+{
+ BSTR tmp;
+ HRESULT hres;
+
+ tmp = a2bstr(title);
+ hres = IHTMLDocument2_put_title(doc, tmp);
+ ok_(__FILE__,line) (hres == S_OK, "get_title failed: %08x\n", hres);
+ SysFreeString(tmp);
+}
+
static void test_elem_col_item(IHTMLElementCollection *col, LPCWSTR n,
const elem_type_t *elem_types, long len)
{
@@ -1978,6 +2002,7 @@ static void test_defaults(IHTMLDocument2 *doc)
IHTMLStyleSheetsCollection_Release(stylesheetcol);
test_default_selection(doc);
+ test_doc_title(doc, "");
}
static void test_stylesheet(IDispatch *disp)
@@ -2332,6 +2357,10 @@ static void test_elems(IHTMLDocument2 *doc)
test_stylesheets(doc);
test_create_option_elem(doc);
+
+ test_doc_title(doc, "test");
+ test_doc_set_title(doc, "test title");
+ test_doc_title(doc, "test title");
}
static void test_create_elems(IHTMLDocument2 *doc)
More information about the wine-cvs
mailing list