From e1ca5965b8341aa9f459a3e75d14523f443b63b1 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 8 Oct 2010 11:41:08 +0400 Subject: [PATCH] msxml3: Implement ::abort(). --- dlls/msxml3/httprequest.c | 9 +++++++-- dlls/msxml3/tests/domdoc.c | 19 +++++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c index 6ff0f96873a..e347096446b 100644 --- a/dlls/msxml3/httprequest.c +++ b/dlls/msxml3/httprequest.c @@ -731,9 +731,14 @@ static HRESULT WINAPI httprequest_abort(IXMLHTTPRequest *iface) { httprequest *This = impl_from_IXMLHTTPRequest( iface ); - FIXME("stub (%p)\n", This); + TRACE("(%p)\n", This); - return E_NOTIMPL; + BindStatusCallback_Detach(This->bsc); + This->bsc = NULL; + + httprequest_setreadystate(This, READYSTATE_UNINITIALIZED); + + return S_OK; } static HRESULT WINAPI httprequest_get_status(IXMLHTTPRequest *iface, LONG *status) diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 6035d2ba618..62c59b7edbf 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -3225,6 +3225,9 @@ if (0) ok(hr == S_OK, "got 0x%08x\n", hr); } + hr = IXMLHttpRequest_abort(pXMLHttpRequest); + ok(hr == S_OK, "got 0x%08x\n", hr); + /* send before open */ hr = IXMLHttpRequest_send(pXMLHttpRequest, dummy); ok(hr == E_FAIL || broken(hr == E_UNEXPECTED) /* win9x, win2k */, "got 0x%08x\n", hr); @@ -3266,7 +3269,7 @@ if (0) state = -1; hr = IXMLHttpRequest_get_readyState(pXMLHttpRequest, &state); ok(hr == S_OK, "got 0x%08x\n", hr); - ok(state == 0, "got %d, expected 0\n", state); + ok(state == READYSTATE_UNINITIALIZED, "got %d, expected READYSTATE_UNINITIALIZED\n", state); event = create_dispevent(); ref = IDispatch_AddRef(event); @@ -3297,7 +3300,19 @@ if (0) state = -1; hr = IXMLHttpRequest_get_readyState(pXMLHttpRequest, &state); ok(hr == S_OK, "got 0x%08x\n", hr); - ok(state == 1, "got %d, expected 1\n", state); + ok(state == READYSTATE_LOADING, "got %d, expected READYSTATE_LOADING\n", state); + + hr = IXMLHttpRequest_abort(pXMLHttpRequest); + ok(hr == S_OK, "got 0x%08x\n", hr); + + state = -1; + hr = IXMLHttpRequest_get_readyState(pXMLHttpRequest, &state); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(state == READYSTATE_UNINITIALIZED || broken(state == READYSTATE_LOADING) /* win98, win2k */, + "got %d, expected READYSTATE_UNINITIALIZED\n", state); + + hr = IXMLHttpRequest_open(pXMLHttpRequest, method, url, async, dummy, dummy); + ok(hr == S_OK, "got 0x%08x\n", hr); hr = IXMLHttpRequest_setRequestHeader(pXMLHttpRequest, _bstr_("header1"), _bstr_("value1")); ok(hr == S_OK, "got 0x%08x\n", hr);