Jacek Caban : mshtml: Include URL pathname and query in test traces.

Alexandre Julliard julliard at winehq.org
Mon Jul 1 15:15:16 CDT 2019


Module: wine
Branch: master
Commit: 3ea7ef409821ebbc015e33e3dcd420e1822d295f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=3ea7ef409821ebbc015e33e3dcd420e1822d295f

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Jul  1 15:30:49 2019 +0200

mshtml: Include URL pathname and query in test traces.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/tests/script.c    | 22 +++++++++++-----------
 dlls/mshtml/tests/winetest.js | 15 ++++++++++++---
 2 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c
index b2a9746..3704d39 100644
--- a/dlls/mshtml/tests/script.c
+++ b/dlls/mshtml/tests/script.c
@@ -3405,7 +3405,7 @@ static void run_from_path(const char *path, const char *opt)
 
     strcat(buf, path);
     if(opt)
-        strcat(buf, opt);
+        sprintf(buf + strlen(buf), "?%s", opt);
     url = a2bstr(buf);
     hres = CreateURLMoniker(NULL, url, &mon);
     SysFreeString(url);
@@ -3437,7 +3437,7 @@ static void run_script_as_http_with_mode(const char *script, const char *opt, co
             document_mode ? "\">" : "",
             script);
 
-    run_from_path("/index.html", opt);
+    run_from_path("/index.html", opt ? opt : script);
 }
 
 static void init_protocol_handler(void)
@@ -3481,15 +3481,15 @@ static void run_js_tests(void)
     run_script_as_http_with_mode("navigation.js", NULL, NULL);
     run_script_as_http_with_mode("navigation.js", NULL, "11");
 
-    run_script_as_http_with_mode("documentmode.js", "?0", NULL);
-    run_script_as_http_with_mode("documentmode.js", "?5", "5");
-    run_script_as_http_with_mode("documentmode.js", "?5", "6");
-    run_script_as_http_with_mode("documentmode.js", "?7", "7");
-    run_script_as_http_with_mode("documentmode.js", "?8", "8");
-    run_script_as_http_with_mode("documentmode.js", "?9", "9");
-    run_script_as_http_with_mode("documentmode.js", "?10", "10");
-    run_script_as_http_with_mode("documentmode.js", "?11", "11");
-    run_script_as_http_with_mode("documentmode.js", "?11", "edge");
+    run_script_as_http_with_mode("documentmode.js", "0", NULL);
+    run_script_as_http_with_mode("documentmode.js", "5", "5");
+    run_script_as_http_with_mode("documentmode.js", "5", "6");
+    run_script_as_http_with_mode("documentmode.js", "7", "7");
+    run_script_as_http_with_mode("documentmode.js", "8", "8");
+    run_script_as_http_with_mode("documentmode.js", "9", "9");
+    run_script_as_http_with_mode("documentmode.js", "10", "10");
+    run_script_as_http_with_mode("documentmode.js", "11", "11");
+    run_script_as_http_with_mode("documentmode.js", "11", "edge");
 
     run_script_as_http_with_mode("asyncscriptload.js", NULL, "9");
 }
diff --git a/dlls/mshtml/tests/winetest.js b/dlls/mshtml/tests/winetest.js
index 0d4e6e4..2af1b33 100644
--- a/dlls/mshtml/tests/winetest.js
+++ b/dlls/mshtml/tests/winetest.js
@@ -42,11 +42,11 @@ function run_tests() {
 }
 
 function ok(b,m) {
-    return external.ok(b, m);
+    return external.ok(b, format_message(m));
 }
 
 function trace(m) {
-    external.trace(m);
+    external.trace(format_message(m));
 }
 
 function win_skip(m) {
@@ -59,10 +59,19 @@ function reportSuccess() {
 
 var todo_wine = {
     ok: function(b,m) {
-        return external.todo_wine_ok(b,m);
+        return external.todo_wine_ok(b, format_message(m));
     }
 };
 
 function todo_wine_if(expr) {
     return expr ? todo_wine : { ok: ok };
 }
+
+var file_prefix = document.location.pathname;
+if(document.location.search)
+    file_prefix += document.location.search;
+file_prefix += ": ";
+
+function format_message(msg) {
+    return file_prefix + msg;
+}




More information about the wine-cvs mailing list