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

mshtml: Implement SuperNavigate undocumented flag 2.

Seems to be doing a replace and skipping updating travel log/history. Signed-off-by: 's avatarGabriel Ivăncescu <gabrielopcode@gmail.com>
parent 5a7d75cd
......@@ -2816,6 +2816,7 @@ static HRESULT WINAPI HTMLPrivateWindow_SuperNavigate(IHTMLPrivateWindow *iface,
BSTR arg4, VARIANT *post_data_var, VARIANT *headers_var, ULONG flags)
{
HTMLWindow *This = impl_from_IHTMLPrivateWindow(iface);
DWORD binding_flags = BINDING_NAVIGATED|BINDING_NOFRAG;
HTMLOuterWindow *window = This->outer_window;
OLECHAR *translated_url = NULL;
DWORD post_data_size = 0;
......@@ -2827,6 +2828,9 @@ static HRESULT WINAPI HTMLPrivateWindow_SuperNavigate(IHTMLPrivateWindow *iface,
TRACE("(%p)->(%s %s %s %s %s %s %lx)\n", This, debugstr_w(url), debugstr_w(arg2), debugstr_w(arg3), debugstr_w(arg4),
debugstr_variant(post_data_var), debugstr_variant(headers_var), flags);
if(flags & ~2)
FIXME("unimplemented flags %lx\n", flags & ~2);
if(!window || !window->browser)
return E_UNEXPECTED;
......@@ -2855,7 +2859,10 @@ static HRESULT WINAPI HTMLPrivateWindow_SuperNavigate(IHTMLPrivateWindow *iface,
headers = V_BSTR(headers_var);
}
hres = super_navigate(window, uri, BINDING_NAVIGATED|BINDING_NOFRAG, headers, post_data, post_data_size);
if(flags & 2)
binding_flags |= BINDING_REPLACE;
hres = super_navigate(window, uri, binding_flags, headers, post_data, post_data_size);
IUri_Release(uri);
if(post_data)
SafeArrayUnaccessData(V_ARRAY(post_data_var));
......
......@@ -226,6 +226,7 @@ static BOOL support_wbapp, allow_new_window, no_travellog;
static BOOL report_mime;
static BOOL testing_submit;
static BOOL resetting_document;
static BOOL is_error_url;
static BOOL is_mhtml;
static int stream_read, protocol_read;
static IStream *history_stream;
......@@ -1202,6 +1203,7 @@ static HRESULT WINAPI PropertyNotifySink_OnChanged(IPropertyNotifySink *iface, D
case 3000031:
case 3000032:
case 3000033:
case 3000034:
/* TODO */
return S_OK;
}
......@@ -3698,7 +3700,8 @@ static HRESULT WINAPI DocObjectService_FireBeforeNavigate2(IDocObjectService *i
if(!testing_submit) {
ok(!pPostData, "pPostData = %p\n", pPostData);
ok(!cbPostData, "cbPostData = %ld\n", cbPostData);
ok(!lpszHeaders || !lstrcmpW(lpszHeaders, L"Referer: http://test.winehq.org/tests/winehq_snapshot/\r\n"),
ok(!lpszHeaders || !lstrcmpW(lpszHeaders, L"Referer: http://test.winehq.org/tests/winehq_snapshot/\r\n") ||
!lstrcmpW(lpszHeaders, L"Referer: http://test.winehq.org/tests/hello.html\r\n"),
"lpszHeaders = %s\n", wine_dbgstr_w(lpszHeaders));
}else {
ok(cbPostData == 9, "cbPostData = %ld\n", cbPostData);
......@@ -3800,7 +3803,7 @@ static HRESULT WINAPI DocObjectService_IsErrorUrl(
BOOL *pfIsError)
{
CHECK_EXPECT2(IsErrorUrl);
*pfIsError = FALSE;
*pfIsError = is_error_url;
return S_OK;
}
......@@ -6485,6 +6488,204 @@ static void test_reload(IHTMLDocument2 *doc)
test_download(DWL_VERBDONE|DWL_HTTP|DWL_ONREADY_LOADING|DWL_REFRESH|DWL_EX_GETHOSTINFO);
}
static void test_super_navigate(IHTMLDocument2 *doc)
{
IHTMLElementCollection *elem_col;
IHTMLPrivateWindow *priv_window;
IHTMLDocument2 *doc2;
IHTMLDocument3 *doc3;
IHTMLWindow2 *window;
HRESULT hres;
VARIANT var;
BSTR str;
trace("SuperNavigate...\n");
hres = IHTMLDocument2_get_parentWindow(doc, &window);
ok(hres == S_OK, "get_parentWindow failed: %08lx\n", hres);
hres = IHTMLWindow2_QueryInterface(window, &IID_IHTMLPrivateWindow, (void**)&priv_window);
ok(hres == S_OK, "QueryInterface(IID_IHTMLPrivateWindow) failed: %08lx\n", hres);
prev_url = nav_url;
nav_serv_url = nav_url = L"http://test.winehq.org/tests/hello.html";
readystate_set_loading = TRUE;
SET_EXPECT(TranslateUrl);
SET_EXPECT(FireBeforeNavigate2);
SET_EXPECT(Exec_ShellDocView_67);
SET_EXPECT(Invoke_AMBIENT_SILENT);
SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
SET_EXPECT(Exec_ShellDocView_63);
SET_EXPECT(Exec_ShellDocView_84);
str = SysAllocString(L"http://test.winehq.org/tests/hello.html");
V_VT(&var) = VT_EMPTY;
hres = IHTMLPrivateWindow_SuperNavigate(priv_window, str, NULL, NULL, NULL, &var, &var, 1);
ok(hres == S_OK, "SuperNavigate failed: %08lx\n", hres);
SysFreeString(str);
CHECK_CALLED(TranslateUrl);
todo_wine CHECK_CALLED(FireBeforeNavigate2);
CLEAR_CALLED(Exec_ShellDocView_67); /* Not called by IE11 */
CHECK_CALLED(Invoke_AMBIENT_SILENT);
CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
CHECK_CALLED(Exec_ShellDocView_63);
CHECK_CALLED_BROKEN(Exec_ShellDocView_84);
test_download(DWL_VERBDONE | DWL_ONREADY_LOADING | DWL_EXPECT_HISTUPDATE | DWL_EX_GETHOSTINFO);
hres = IHTMLPrivateWindow_GetAddressBarUrl(priv_window, &str);
ok(hres == S_OK, "GetAddressBarUrl failed: %08lx\n", hres);
ok(!wcscmp(str, L"http://test.winehq.org/tests/hello.html"), "unexpected address bar url: %s\n", wine_dbgstr_w(str));
SysFreeString(str);
prev_url = nav_url;
nav_serv_url = nav_url = L"about:blank";
readystate_set_loading = TRUE;
SET_EXPECT(TranslateUrl);
SET_EXPECT(Exec_ShellDocView_67);
SET_EXPECT(Invoke_AMBIENT_SILENT);
SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
SET_EXPECT(Exec_ShellDocView_63);
SET_EXPECT(Exec_ShellDocView_84);
str = SysAllocString(L"about:blank");
V_VT(&var) = VT_EMPTY;
hres = IHTMLPrivateWindow_SuperNavigate(priv_window, str, NULL, NULL, NULL, &var, &var, 4);
ok(hres == S_OK, "SuperNavigate failed: %08lx\n", hres);
SysFreeString(str);
CHECK_CALLED(TranslateUrl);
CLEAR_CALLED(Exec_ShellDocView_67); /* Not called by IE11 */
CHECK_CALLED(Invoke_AMBIENT_SILENT);
CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
CHECK_CALLED(Exec_ShellDocView_63);
CHECK_CALLED_BROKEN(Exec_ShellDocView_84);
test_download(DWL_VERBDONE | DWL_ONREADY_LOADING | DWL_EXPECT_HISTUPDATE | DWL_EX_GETHOSTINFO);
hres = IHTMLPrivateWindow_GetAddressBarUrl(priv_window, &str);
ok(hres == S_OK, "GetAddressBarUrl failed: %08lx\n", hres);
ok(!wcscmp(str, L"about:blank"), "unexpected address bar url: %s\n", wine_dbgstr_w(str));
SysFreeString(str);
prev_url = nav_url;
nav_serv_url = nav_url = L"http://test.winehq.org/tests/hello.html";
readystate_set_loading = TRUE;
SET_EXPECT(TranslateUrl);
SET_EXPECT(FireBeforeNavigate2);
SET_EXPECT(Exec_ShellDocView_67);
SET_EXPECT(Invoke_AMBIENT_SILENT);
SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
SET_EXPECT(Exec_ShellDocView_63);
SET_EXPECT(Exec_ShellDocView_84);
str = SysAllocString(L"http://test.winehq.org/tests/hello.html");
hres = IHTMLPrivateWindow_SuperNavigate(priv_window, str, NULL, NULL, NULL, &var, &var, 2 | 1);
ok(hres == S_OK, "SuperNavigate failed: %08lx\n", hres);
SysFreeString(str);
CHECK_CALLED(TranslateUrl);
todo_wine CHECK_CALLED(FireBeforeNavigate2);
CLEAR_CALLED(Exec_ShellDocView_67); /* Not called by IE11 */
CHECK_CALLED(Invoke_AMBIENT_SILENT);
CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
CHECK_CALLED(Exec_ShellDocView_63);
CHECK_CALLED_BROKEN(Exec_ShellDocView_84);
test_download(DWL_VERBDONE | DWL_ONREADY_LOADING | DWL_EX_GETHOSTINFO);
hres = IHTMLPrivateWindow_GetAddressBarUrl(priv_window, &str);
ok(hres == S_OK, "GetAddressBarUrl failed: %08lx\n", hres);
ok(!wcscmp(str, L"http://test.winehq.org/tests/hello.html"), "unexpected address bar url: %s\n", wine_dbgstr_w(str));
SysFreeString(str);
hres = IHTMLWindow2_get_document(window, &doc2);
ok(hres == S_OK, "get_document failed: %08lx\n", hres);
hres = IHTMLDocument2_QueryInterface(doc2, &IID_IHTMLDocument3, (void**)&doc3);
ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument3) failed: %08lx\n", hres);
IHTMLDocument2_Release(doc2);
str = SysAllocString(L"H1");
hres = IHTMLDocument3_getElementsByTagName(doc3, str, &elem_col);
ok(hres == S_OK, "getElementsByTagName failed: %08lx\n", hres);
ok(elem_col != NULL, "elem_col = NULL\n");
IHTMLElementCollection_Release(elem_col);
IHTMLDocument3_Release(doc3);
SysFreeString(str);
prev_url = nav_url;
nav_serv_url = nav_url = L"about:blank";
readystate_set_loading = TRUE;
SET_EXPECT(TranslateUrl);
SET_EXPECT(Exec_ShellDocView_67);
SET_EXPECT(Invoke_AMBIENT_SILENT);
SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
SET_EXPECT(Exec_ShellDocView_63);
SET_EXPECT(Exec_ShellDocView_84);
str = SysAllocString(L"about:blank");
V_VT(&var) = VT_EMPTY;
hres = IHTMLPrivateWindow_SuperNavigate(priv_window, str, NULL, NULL, NULL, &var, &var, 2 | 4);
ok(hres == S_OK, "SuperNavigate failed: %08lx\n", hres);
SysFreeString(str);
CHECK_CALLED(TranslateUrl);
CLEAR_CALLED(Exec_ShellDocView_67); /* Not called by IE11 */
CHECK_CALLED(Invoke_AMBIENT_SILENT);
CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
CHECK_CALLED(Exec_ShellDocView_63);
CHECK_CALLED_BROKEN(Exec_ShellDocView_84);
test_download(DWL_VERBDONE | DWL_ONREADY_LOADING | DWL_EX_GETHOSTINFO);
hres = IHTMLPrivateWindow_GetAddressBarUrl(priv_window, &str);
ok(hres == S_OK, "GetAddressBarUrl failed: %08lx\n", hres);
ok(!wcscmp(str, L"about:blank"), "unexpected address bar url: %s\n", wine_dbgstr_w(str));
SysFreeString(str);
prev_url = nav_url;
nav_serv_url = nav_url = L"http://test.winehq.org/tests/hello.html";
is_error_url = TRUE;
readystate_set_loading = TRUE;
SET_EXPECT(TranslateUrl);
SET_EXPECT(Exec_ShellDocView_67);
SET_EXPECT(Invoke_AMBIENT_SILENT);
SET_EXPECT(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
SET_EXPECT(Exec_ShellDocView_63);
SET_EXPECT(Exec_ShellDocView_84);
str = SysAllocString(L"http://test.winehq.org/tests/hello.html");
V_VT(&var) = VT_EMPTY;
hres = IHTMLPrivateWindow_SuperNavigate(priv_window, str, NULL, NULL, NULL, &var, &var, 2);
ok(hres == S_OK, "SuperNavigate failed: %08lx\n", hres);
SysFreeString(str);
CHECK_CALLED(TranslateUrl);
CLEAR_CALLED(Exec_ShellDocView_67); /* Not called by IE11 */
CHECK_CALLED(Invoke_AMBIENT_SILENT);
CHECK_CALLED(Invoke_AMBIENT_OFFLINEIFNOTCONNECTED);
CHECK_CALLED(Exec_ShellDocView_63);
CHECK_CALLED_BROKEN(Exec_ShellDocView_84);
test_download(DWL_VERBDONE | DWL_ONREADY_LOADING | DWL_EX_GETHOSTINFO);
hres = IHTMLPrivateWindow_GetAddressBarUrl(priv_window, &str);
ok(hres == S_OK, "GetAddressBarUrl failed: %08lx\n", hres);
ok(!wcscmp(str, L"http://test.winehq.org/tests/hello.html"), "unexpected address bar url: %s\n", wine_dbgstr_w(str));
SysFreeString(str);
is_error_url = FALSE;
IHTMLPrivateWindow_Release(priv_window);
IHTMLWindow2_Release(window);
}
static void test_open_window(IHTMLDocument2 *doc, BOOL do_block)
{
IHTMLWindow2 *window, *new_window;
......@@ -8318,6 +8519,7 @@ static void test_HTMLDocument_http(BOOL with_wbapp)
if(!support_wbapp) /* FIXME */
test_open_window(doc, FALSE);
if(support_wbapp) {
test_super_navigate(doc);
test_put_href(doc, FALSE, NULL, L"http://test.winehq.org/tests/file.winetest", FALSE, FALSE, DWL_EXTERNAL);
test_window_close(doc);
}
......
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