Commit bc8c1b56 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml/tests: Test parent window links after navigation.

parent bcf89639
......@@ -3234,6 +3234,48 @@ static void test_iframe_connections(IHTMLDocument2 *doc)
IHTMLDocument2_Release(iframes_doc);
}
static void test_window_refs(IHTMLDocument2 *doc)
{
IHTMLWindow2 *self, *parent, *child;
IHTMLFrameBase2 *iframe;
IHTMLDocument6 *doc6;
IHTMLElement2 *elem;
HRESULT hres;
BSTR bstr;
hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument6, (void**)&doc6);
ok(hres == S_OK, "Could not get IHTMLDocument6 iface: %08lx\n", hres);
bstr = SysAllocString(L"ifr");
hres = IHTMLDocument6_getElementById(doc6, bstr, &elem);
ok(hres == S_OK, "getElementById failed: %08lx\n", hres);
IHTMLDocument6_Release(doc6);
SysFreeString(bstr);
hres = IHTMLElement2_QueryInterface(elem, &IID_IHTMLFrameBase2, (void**)&iframe);
ok(hres == S_OK, "Could not get IHTMLFrameBase2 iface: %08lx\n", hres);
IHTMLElement2_Release(elem);
hres = IHTMLFrameBase2_get_contentWindow(iframe, &child);
ok(hres == S_OK, "get_contentWindow failed: %08lx\n", hres);
IHTMLFrameBase2_Release(iframe);
hres = IHTMLWindow2_get_self(window, &self);
ok(hres == S_OK, "get_self failed: %08lx\n", hres);
hres = IHTMLWindow2_get_parent(child, &parent);
ok(hres == S_OK, "get_parent failed: %08lx\n", hres);
ok(parent == self, "parent != self\n");
IHTMLWindow2_Release(parent);
IHTMLWindow2_Release(self);
navigate(doc, L"blank.html");
hres = IHTMLWindow2_get_parent(child, &parent);
ok(hres == S_OK, "get_parent failed: %08lx\n", hres);
ok(parent == child, "parent != child\n");
IHTMLWindow2_Release(parent);
IHTMLWindow2_Release(child);
}
static void test_doc_obj(IHTMLDocument2 *doc)
{
static DISPID propput_dispid = DISPID_PROPERTYPUT;
......@@ -6523,6 +6565,7 @@ START_TEST(events)
run_test_from_res(L"doc_with_prop_ie9.html", test_visibilitychange);
run_test_from_res(L"blank_ie10.html", test_visibilitychange);
run_test_from_res(L"iframe.html", test_unload_event);
run_test_from_res(L"iframe.html", test_window_refs);
run_test(empty_doc_ie9_str, test_create_event);
run_test(img_doc_ie9_str, test_imgload);
run_test(input_image_doc_ie9_str, test_inputload);
......
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