mshtml: Added IHTMLInputElement_get_form method implementation. (try 3)

Jacek Caban jacek at codeweavers.com
Thu Aug 14 05:25:22 CDT 2014


On 07/29/14 15:34, Zhenbo Li wrote:
> +#define test_input_get_form(o, t)  _test_input_get_form(__LINE__, o, t)
> +static void _test_input_get_form(unsigned line, IUnknown *unk, const char *id)
> +{
> +    IHTMLInputElement *input;
> +    IHTMLFormElement *form;
> +    IHTMLElement *elem;
> +    BSTR bstr;
> +    HRESULT hres;
> +
> +    ok_(__FILE__,line) (unk != NULL, "unk is NULL!\n");
> +    hres = IUnknown_QueryInterface(unk, &IID_IHTMLInputElement, (void**)&input);
> +    ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLInputElement: %08x\n", hres);
> +    ok_(__FILE__,line) (input != NULL, "input == NULL\n");
> +    if(FAILED(hres) || input == NULL)
> +        return;
> +
> +    hres = IHTMLInputElement_get_form(input, &form);
> +    ok_(__FILE__, line) (hres == S_OK, "get_form failed: %08x\n", hres);
> +    ok_(__FILE__, line) (form != NULL, "form == NULL\n");
> +    if(FAILED(hres) || form == NULL){
> +        IHTMLInputElement_Release(input);
> +        return;
> +    }
> +
> +    hres = IHTMLFormElement_QueryInterface(form, &IID_IHTMLElement, (void **)&elem);
> +    ok_(__FILE__, line) (hres == S_OK, "QueryInterface(IID_IHTMLElement) failed: %08x\n", hres);
> +    ok_(__FILE__, line) (elem != NULL, "elem == NULL\n");
> +    if(FAILED(hres) || elem == NULL){
> +        IHTMLInputElement_Release(input);
> +        IHTMLFormElement_Release(form);
> +        return;
> +    }
> +    hres = IHTMLElement_get_id(elem, &bstr);
> +    ok_(__FILE__, line) (hres == S_OK, "get_id failed: %08x\n", hres);
> +    ok_(__FILE__, line) (!strcmp_wa(bstr, id), "Expect %s, got %s\n", id, wine_dbgstr_w(bstr));

Please use _test_elem_id instead.

Cheers,
Jacek



More information about the wine-devel mailing list