Alistair Leslie-Hughes : mshtml: Add IHTMLBodyElement bgColor tests.

Alexandre Julliard julliard at winehq.org
Mon Sep 8 07:41:11 CDT 2008


Module: wine
Branch: master
Commit: e605d3e9bffbe3c4d57ee78465a8dd3d49e049e2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e605d3e9bffbe3c4d57ee78465a8dd3d49e049e2

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Fri Sep  5 22:47:28 2008 +1000

mshtml: Add IHTMLBodyElement bgColor tests.

---

 dlls/mshtml/tests/dom.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index b658a74..ce7391d 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -2036,6 +2036,36 @@ static void test_default_body(IHTMLBodyElement *body)
     ok(!l, "scrollWidth = %ld\n", l);
 }
 
+static void test_body_funs(IHTMLBodyElement *body)
+{
+    static WCHAR sRed[] = {'r','e','d',0};
+    static WCHAR sRedbg[] = {'#','f','f','0','0','0','0',0};
+    VARIANT vbg;
+    VARIANT vDefaultbg;
+    HRESULT hres;
+
+    hres = IHTMLBodyElement_get_bgColor(body, &vDefaultbg);
+    ok(hres == S_OK, "get_background failed: %08x\n", hres);
+    ok(V_VT(&vDefaultbg) == VT_BSTR, "bstr != NULL\n");
+
+    V_VT(&vbg) = VT_BSTR;
+    V_BSTR(&vbg) = SysAllocString(sRed);
+    hres = IHTMLBodyElement_put_bgColor(body, vbg);
+    ok(hres == S_OK, "get_background failed: %08x\n", hres);
+    VariantClear(&vbg);
+
+    hres = IHTMLBodyElement_get_bgColor(body, &vbg);
+    ok(hres == S_OK, "get_background failed: %08x\n", hres);
+    ok(V_VT(&vDefaultbg) == VT_BSTR, "V_VT(&vDefaultbg) != VT_BSTR\n");
+    ok(!lstrcmpW(V_BSTR(&vbg), sRedbg), "Unexpected type %s\n", dbgstr_w(V_BSTR(&vbg)));
+    VariantClear(&vbg);
+
+    /* Restore Originial */
+    hres = IHTMLBodyElement_put_bgColor(body, vDefaultbg);
+    ok(hres == S_OK, "get_background failed: %08x\n", hres);
+    VariantClear(&vDefaultbg);
+}
+
 static void test_window(IHTMLDocument2 *doc)
 {
     IHTMLWindow2 *window, *window2, *self;
@@ -2091,6 +2121,7 @@ static void test_defaults(IHTMLDocument2 *doc)
     hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLBodyElement, (void**)&body);
     ok(hres == S_OK, "Could not get IHTMBodyElement: %08x\n", hres);
     test_default_body(body);
+    test_body_funs(body);
     IHTMLBodyElement_Release(body);
 
     hres = IHTMLElement_get_style(elem, &style);




More information about the wine-cvs mailing list