Module: wine Branch: master Commit: 429e0dde694fc4e81302e0d01efb5b32317f542f URL: http://source.winehq.org/git/wine.git/?a=commit;h=429e0dde694fc4e81302e0d01e...
Author: Jacek Caban jacek@codeweavers.com Date: Tue Jul 5 22:47:56 2016 +0200
mshtml: Added document.documentMode tests.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/mshtml/tests/documentmode.js | 37 +++++++++++++++++++++++++++++++++++++ dlls/mshtml/tests/rsrc.rc | 3 +++ dlls/mshtml/tests/script.c | 9 +++++++++ 3 files changed, 49 insertions(+)
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js new file mode 100644 index 0000000..89fe0a9 --- /dev/null +++ b/dlls/mshtml/tests/documentmode.js @@ -0,0 +1,37 @@ +/* + * Copyright 2016 Jacek Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +function test_doc_mode() { + var opt = parseInt(document.location.search.substring(1)); + + trace("Testing document mode " + opt); + + if(opt > document.documentMode) { + win_skip("Document mode not supported (expected " + opt + " got " + document.documentMode + ")"); + reportSuccess(); + return; + } + + ok(opt === document.documentMode, "documentMode = " + document.documentMode); + + next_test(); +} + +var tests = [ + test_doc_mode +]; diff --git a/dlls/mshtml/tests/rsrc.rc b/dlls/mshtml/tests/rsrc.rc index a9ab563..8b28dfa 100644 --- a/dlls/mshtml/tests/rsrc.rc +++ b/dlls/mshtml/tests/rsrc.rc @@ -40,6 +40,9 @@ navigation.js HTML "navigation.js" /* @makedep: xhr.js */ xhr.js HTML "xhr.js"
+/* @makedep: documentmode.js */ +documentmode.js HTML "documentmode.js" + /* @makedep: blank.html */ blank.html HTML "blank.html"
diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c index eadf737..eda3005 100644 --- a/dlls/mshtml/tests/script.c +++ b/dlls/mshtml/tests/script.c @@ -3320,6 +3320,15 @@ static void run_js_tests(void) run_script_as_http_with_mode("xhr.js", NULL, "11"); 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", "?5", 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"); }
static BOOL init_registry(BOOL init)