Commit 6fd383e8 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLWindow6::postMessage semi-stub implementation.

parent feed9d47
......@@ -2134,8 +2134,16 @@ static HRESULT WINAPI HTMLWindow6_get_maxConnectionsPerServer(IHTMLWindow6 *ifac
static HRESULT WINAPI HTMLWindow6_postMessage(IHTMLWindow6 *iface, BSTR msg, VARIANT targetOrigin)
{
HTMLWindow *This = impl_from_IHTMLWindow6(iface);
FIXME("(%p)->(%s %s)\n", This, debugstr_w(msg), debugstr_variant(&targetOrigin));
return E_NOTIMPL;
FIXME("(%p)->(%s %s) semi-stub\n", This, debugstr_w(msg), debugstr_variant(&targetOrigin));
if(!This->inner_window->doc) {
FIXME("No document\n");
return E_FAIL;
}
fire_event(This->inner_window->doc, EVENTID_MESSAGE, TRUE, &This->inner_window->doc->node, NULL, NULL);
return S_OK;
}
static HRESULT WINAPI HTMLWindow6_toStaticHTML(IHTMLWindow6 *iface, BSTR bstrHTML, BSTR *pbstrStaticHTML)
......
......@@ -362,6 +362,15 @@ function test_xhr() {
ok(typeof(xhr) === "object", "typeof(xhr) = " + typeof(xhr));
}
function test_sendMessage() {
var onmessage_called = false;
window.onmessage = function() {
onmessage_called = true;
}
window.postMessage("test", "*");
ok(onmessage_called, "onmessage not called");
}
var globalVar = false;
function runTests() {
......@@ -388,6 +397,7 @@ function runTests() {
test_language_attribute();
test_text_node();
test_xhr();
test_sendMessage();
var r = window.execScript("globalVar = true;");
ok(r === undefined, "execScript returned " + r);
......
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