Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mshtml/tests/dom.c | 7 ++++++- dlls/mshtml/tests/jstest.html | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index b00346759f..845983ccd6 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -6683,7 +6683,12 @@ static void test_xmlhttprequest(IHTMLWindow5 *window)
hres = IHTMLWindow5_get_XMLHttpRequest(window, &var); ok(hres == S_OK, "get_XMLHttpRequest failed: %08x\n", hres); - ok(V_VT(&var) == VT_DISPATCH, "expect VT_DISPATCH, got %s\n", debugstr_variant(&var)); + ok(V_VT(&var) == VT_DISPATCH || broken(V_VT(&var) == VT_EMPTY), "expect VT_DISPATCH, got %s\n", debugstr_variant(&var)); + + if (V_VT(&var) == VT_EMPTY) { + skip("Native XMLHTTP support is missing or disabled.\n"); + return; + }
factory = NULL; hres = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IHTMLXMLHttpRequestFactory, (void**)&factory); diff --git a/dlls/mshtml/tests/jstest.html b/dlls/mshtml/tests/jstest.html index cce805032c..8d399d0747 100644 --- a/dlls/mshtml/tests/jstest.html +++ b/dlls/mshtml/tests/jstest.html @@ -1,5 +1,8 @@ <html> <head> +<script src="winetest.js" type="text/javascript"></script> +</head> +<head> <script> function ok(b,m) { return external.ok(b, m); @@ -355,8 +358,12 @@ function test_text_node() { }
function test_xhr() { + if (typeof(XMLHttpRequest) != "object") { + win_skip("XMLHTTPRequest is not available or disabled"); + return; + } + ok("XMLHttpRequest" in window, "XMLHttpRequest not found in window object\n"); - ok(typeof(XMLHttpRequest) === "object", "typeof(XMLHttpRequest) = " + typeof(XMLHttpRequest));
var xhr = new XMLHttpRequest(); ok(typeof(xhr) === "object", "typeof(xhr) = " + typeof(xhr));
Hi Nikolay,
On 06.01.2018 15:48, Nikolay Sivov wrote:
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com
dlls/mshtml/tests/dom.c | 7 ++++++- dlls/mshtml/tests/jstest.html | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index b00346759f..845983ccd6 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -6683,7 +6683,12 @@ static void test_xmlhttprequest(IHTMLWindow5 *window)
hres = IHTMLWindow5_get_XMLHttpRequest(window, &var); ok(hres == S_OK, "get_XMLHttpRequest failed: %08x\n", hres);
- ok(V_VT(&var) == VT_DISPATCH, "expect VT_DISPATCH, got %s\n", debugstr_variant(&var));
- ok(V_VT(&var) == VT_DISPATCH || broken(V_VT(&var) == VT_EMPTY), "expect VT_DISPATCH, got %s\n", debugstr_variant(&var));
- if (V_VT(&var) == VT_EMPTY) {
skip("Native XMLHTTP support is missing or disabled.\n");
I think this should be win_skip (you mark that as broken() anyway).
return;
}
factory = NULL; hres = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IHTMLXMLHttpRequestFactory, (void**)&factory);
diff --git a/dlls/mshtml/tests/jstest.html b/dlls/mshtml/tests/jstest.html index cce805032c..8d399d0747 100644 --- a/dlls/mshtml/tests/jstest.html +++ b/dlls/mshtml/tests/jstest.html @@ -1,5 +1,8 @@
<html> <head> +<script src="winetest.js" type="text/javascript"></script> +</head> +<head>
This is the right thing to do, but please remove ok() from jstest.html to avoid conflicts.
<script> function ok(b,m) { return external.ok(b, m); @@ -355,8 +358,12 @@ function test_text_node() { } function test_xhr() { + if (typeof(XMLHttpRequest) != "object") { + win_skip("XMLHTTPRequest is not available or disabled"); + return; + } + ok("XMLHttpRequest" in window, "XMLHttpRequest not found in window object\n");
As far as I understand ok("XMLHttpRequest" in window) test works fine in this configuration. It would be nice to keep the test before skipping the rest.
Thanks, Jacek
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=35183
Your paranoid android.
=== build (build) === Patch failed to apply
2018-01-08 6:47 GMT-07:00 Jacek Caban jacek@codeweavers.com:
@@ -355,8 +358,12 @@ function test_text_node() { }
function test_xhr() {
- if (typeof(XMLHttpRequest) != "object") {
win_skip("XMLHTTPRequest is not available or disabled");
return;
- }
- ok("XMLHttpRequest" in window, "XMLHttpRequest not found in window
object\n");
As far as I understand ok("XMLHttpRequest" in window) test works fine in this configuration. It would be nice to keep the test before skipping the rest.
Internet Explorer 6, which was the browser that originally shipped with Windows XP, did not include XMLHttpRequest in the window object at all. If the intent is to support testing IE6 then skipping this test is correct.
-Alex
On 08.01.2018 17:33, Alex Henrie wrote:
2018-01-08 6:47 GMT-07:00 Jacek Caban jacek@codeweavers.com:
@@ -355,8 +358,12 @@ function test_text_node() { }
function test_xhr() {
- if (typeof(XMLHttpRequest) != "object") {
win_skip("XMLHTTPRequest is not available or disabled");
return;
- }
- ok("XMLHttpRequest" in window, "XMLHttpRequest not found in window
object\n");
As far as I understand ok("XMLHttpRequest" in window) test works fine in this configuration. It would be nice to keep the test before skipping the rest.
Internet Explorer 6, which was the browser that originally shipped with Windows XP, did not include XMLHttpRequest in the window object at all. If the intent is to support testing IE6 then skipping this test is correct.
I think the intent was to support IE7 with disabled XMLHttpRequest. I assumed that IE6 will be skipped for another reason, but looking closer I don't see it so yes, it may fail. Still, IE6 is not really an interesting test case those days.
Thanks, Jacek
On 1/11/2018 12:37 AM, Jacek Caban wrote:
On 08.01.2018 17:33, Alex Henrie wrote:
2018-01-08 6:47 GMT-07:00 Jacek Caban jacek@codeweavers.com:
@@ -355,8 +358,12 @@ function test_text_node() { }
function test_xhr() {
- if (typeof(XMLHttpRequest) != "object") {
win_skip("XMLHTTPRequest is not available or disabled");
return;
- }
- ok("XMLHttpRequest" in window, "XMLHttpRequest not found in window
object\n");
As far as I understand ok("XMLHttpRequest" in window) test works fine in this configuration. It would be nice to keep the test before skipping the rest.
Internet Explorer 6, which was the browser that originally shipped with Windows XP, did not include XMLHttpRequest in the window object at all. If the intent is to support testing IE6 then skipping this test is correct.
I think the intent was to support IE7 with disabled XMLHttpRequest. I assumed that IE6 will be skipped for another reason, but looking closer I don't see it so yes, it may fail. Still, IE6 is not really an interesting test case those days.
You can disable XMLHTTP in any version, I was testing IE11 for example.
Thanks, Jacek