mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[MSHTML_WINETEST]
* Sync with Wine 1.5.26. svn path=/trunk/; revision=59048
This commit is contained in:
parent
aac49827b9
commit
d0b02e62c0
18 changed files with 12563 additions and 2572 deletions
|
@ -1,7 +1,11 @@
|
|||
|
||||
add_definitions(-D__ROS_LONG64__)
|
||||
|
||||
add_idl_Headers(test_tlb_header test_tlb.idl)
|
||||
add_typelib(test_tlb.idl)
|
||||
|
||||
list(APPEND SOURCE
|
||||
activex.c
|
||||
dom.c
|
||||
events.c
|
||||
htmldoc.c
|
||||
|
@ -9,11 +13,29 @@ list(APPEND SOURCE
|
|||
misc.c
|
||||
protocol.c
|
||||
script.c
|
||||
testlist.c
|
||||
rsrc.rc)
|
||||
style.c
|
||||
testlist.c)
|
||||
|
||||
add_executable(mshtml_winetest ${SOURCE} rsrc.rc)
|
||||
|
||||
list(APPEND mshtml_winetest_rc_deps
|
||||
${CMAKE_CURRENT_BINARY_DIR}/test_tlb.tlb
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/exectest.html
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jstest.html
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/vbtest.html
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/events.html
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/externscr.js)
|
||||
|
||||
set_source_files_properties(rsrc.rc PROPERTIES OBJECT_DEPENDS "${mshtml_winetest_rc_deps}")
|
||||
|
||||
if(NOT MSVC)
|
||||
# FIXME: http://www.cmake.org/Bug/view.php?id=12998
|
||||
#allow_warnings(mshtml_winetest)
|
||||
set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-error")
|
||||
endif()
|
||||
|
||||
add_executable(mshtml_winetest ${SOURCE})
|
||||
target_link_libraries(mshtml_winetest wine uuid strmiids)
|
||||
set_module_type(mshtml_winetest win32cui)
|
||||
add_importlibs(mshtml_winetest wininet ole32 oleaut32 user32 gdi32 urlmon advapi32 msvcrt kernel32 ntdll)
|
||||
add_dependencies(mshtml_winetest test_tlb_header stdole2)
|
||||
add_cd_file(TARGET mshtml_winetest DESTINATION reactos/bin FOR all)
|
||||
|
|
2745
rostests/winetests/mshtml/activex.c
Normal file
2745
rostests/winetests/mshtml/activex.c
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
150
rostests/winetests/mshtml/events.html
Normal file
150
rostests/winetests/mshtml/events.html
Normal file
|
@ -0,0 +1,150 @@
|
|||
<html>
|
||||
<head>
|
||||
<script>
|
||||
var testevent_divid2_called = false, cnt=0;
|
||||
|
||||
function ok(b,m) {
|
||||
return external.ok(b, m);
|
||||
}
|
||||
|
||||
function ondataavailable_test() {
|
||||
var evobj, div, b = false;
|
||||
|
||||
div = document.getElementById("divid");
|
||||
|
||||
function ondataavailableHandler() {
|
||||
b = true;
|
||||
ok(window.event === evobj, "window.event != evobj");
|
||||
|
||||
ok(evobj.srcElement === div, "evobj.srcElement = " + evobj.srcElement);
|
||||
ok(evobj.fromElement === null, "evobj.srcElement = " + evobj.fromElement);
|
||||
ok(evobj.toElement === null, "evobj.srcElement = " + evobj.toElement);
|
||||
ok(evobj.type === "dataavailable", "evobj.type = " + evobj.type);
|
||||
}
|
||||
|
||||
function ondataavailableDocHandler() {
|
||||
b = true;
|
||||
ok(window.event === evobj, "window.event != evobj");
|
||||
|
||||
ok(evobj.srcElement === null, "evobj.srcElement = " + evobj.srcElement);
|
||||
ok(evobj.fromElement === null, "evobj.srcElement = " + evobj.fromElement);
|
||||
ok(evobj.toElement === null, "evobj.srcElement = " + evobj.toElement);
|
||||
ok(evobj.type === "dataavailable", "evobj.type = " + evobj.type);
|
||||
}
|
||||
|
||||
div.attachEvent("ondataavailable", ondataavailableHandler);
|
||||
|
||||
evobj = document.createEventObject();
|
||||
ok(evobj.srcElement === null, "evobj.srcElement = " + evobj.srcElement);
|
||||
ok(evobj.fromElement === null, "evobj.srcElement = " + evobj.fromElement);
|
||||
ok(evobj.toElement === null, "evobj.srcElement = " + evobj.toElement);
|
||||
ok(evobj.type === "", "evobj.type = " + evobj.type);
|
||||
|
||||
div.fireEvent("ondataavailable", evobj);
|
||||
ok(b, "ondataavailable handler not called?");
|
||||
|
||||
ok(evobj.srcElement === div, "evobj.srcElement = " + evobj.srcElement);
|
||||
ok(evobj.type === "dataavailable", "evobj.type = " + evobj.type);
|
||||
|
||||
div.detachEvent("ondataavailable", ondataavailableHandler);
|
||||
|
||||
b = false;
|
||||
div.fireEvent("ondataavailable", evobj);
|
||||
ok(!b, "ondataavailable handler called?");
|
||||
|
||||
ok(evobj.srcElement === div, "evobj.srcElement = " + evobj.srcElement);
|
||||
ok(evobj.type === "dataavailable", "evobj.type = " + evobj.type);
|
||||
|
||||
document.attachEvent("ondataavailable", ondataavailableDocHandler);
|
||||
|
||||
evobj = document.createEventObject();
|
||||
|
||||
document.fireEvent("ondataavailable", evobj);
|
||||
ok(b, "ondataavailable handler not called?");
|
||||
|
||||
ok(evobj.srcElement === null, "evobj.srcElement = " + evobj.srcElement);
|
||||
ok(evobj.type === "dataavailable", "evobj.type = " + evobj.type);
|
||||
}
|
||||
|
||||
function test_scriptfor() {
|
||||
var div = document.getElementById("divid2");
|
||||
ok("onclick" in div, "testevent not in div");
|
||||
ok(typeof(div.onclick) === "function", "typeof(div.onclick) = " + typeof(div.onclick));
|
||||
ok(testevent_divid2_called === false, "testevent_divid2_called = " + testevent_divid2_called);
|
||||
div.click();
|
||||
ok(testevent_divid2_called === true, "testevent_divid2_called = " + testevent_divid2_called);
|
||||
|
||||
ok(!("ontest" in div), "testevent in div");
|
||||
ok(typeof(div.ontest) === "undefined", "typeof(div.ontest) = " + typeof(div.ontest));
|
||||
}
|
||||
|
||||
function test_handler_this() {
|
||||
document.body.innerHTML = '<div id="d1"><div id="d2"></div></div>';
|
||||
|
||||
var div1 = document.getElementById("d1");
|
||||
var div2 = document.getElementById("d2");
|
||||
var calls = new Array();
|
||||
|
||||
function createHandler(name, node) {
|
||||
return function() {
|
||||
ok(this === node, "this !== node");
|
||||
calls.push(name);
|
||||
}
|
||||
}
|
||||
|
||||
function registerHandler(name, target) {
|
||||
var b = target.attachEvent("onclick", function() {
|
||||
ok(this === window, "this !== window");
|
||||
calls.push(name+"*");
|
||||
});
|
||||
ok(b, "attachEvent failed");
|
||||
}
|
||||
|
||||
registerHandler("div1", div1);
|
||||
registerHandler("div2", div2);
|
||||
registerHandler("body", document.body);
|
||||
div1.onclick = createHandler("div1", div1);
|
||||
div2.onclick = createHandler("div2", div2);
|
||||
document.body.onclick = createHandler("body", document.body);
|
||||
|
||||
div2.click();
|
||||
ok(calls == "div2,div2*,div1,div1*,body,body*", "calls = " + calls);
|
||||
}
|
||||
|
||||
function runTests(t) {
|
||||
try {
|
||||
ok(cnt == 1, "cnt=" + cnt + " exception during loading?");
|
||||
ok(t === window, "t !== window");
|
||||
|
||||
ok(typeof(window.onload) === "function", "typeof(window.onload) = " + typeof(window.onload));
|
||||
ok(document.body.onload === window.onload, "document.body.onload !== window.onload");
|
||||
|
||||
test_scriptfor();
|
||||
ondataavailable_test();
|
||||
test_handler_this();
|
||||
}catch(e) {
|
||||
ok(false, "Got an exception: " + e.message);
|
||||
}
|
||||
|
||||
external.reportSuccess();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="runTests(this)">
|
||||
<div id="divid"></div>
|
||||
<div id="divid2"></div>
|
||||
<script event="onclick" for="divid2">
|
||||
testevent_divid2_called = true;
|
||||
</script>
|
||||
<script event="ontest" for="divid2">
|
||||
ok(false, "unexpected ontest");
|
||||
</script>
|
||||
<script>
|
||||
(function() {
|
||||
var div = document.getElementById("divid2");
|
||||
ok(div.onclick === null, "div.onclick = null");
|
||||
cnt++;
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
139
rostests/winetests/mshtml/exectest.html
Normal file
139
rostests/winetests/mshtml/exectest.html
Normal file
|
@ -0,0 +1,139 @@
|
|||
<html>
|
||||
<body>
|
||||
Script execution test
|
||||
<div id="b1"></div>
|
||||
<div id="b2"></div>
|
||||
<div id="b3"></div>
|
||||
<script id="emptyscript"></script>
|
||||
<script id="put_text_script">2+2</script>
|
||||
<script>
|
||||
function ok(b, msg) {
|
||||
return external.ok(b, msg);
|
||||
}
|
||||
|
||||
var executed = false;
|
||||
var extern_cnt = 0;
|
||||
var exec_cnt;
|
||||
|
||||
function testWriteScript() {
|
||||
var len = document.getElementsByTagName('div').length;
|
||||
ok(len === 3, "init length = " + len);
|
||||
|
||||
document.write("<script>"
|
||||
+ "var len = document.getElementsByTagName('div').length;"
|
||||
+ "ok(len === 3, 'unexpected length ' + len);"
|
||||
+ "executed = true;"
|
||||
+ "<" + "/script>");
|
||||
|
||||
len = document.getElementsByTagName('script').length;
|
||||
ok(len === 4, "script col length = " + len);
|
||||
ok(executed, "written script not executed");
|
||||
}
|
||||
|
||||
function testPutSrc() {
|
||||
var elem = document.getElementById("emptyscript");
|
||||
|
||||
ok(extern_cnt === 0, "extern_cnt = " + extern_cnt + " expected 0");
|
||||
elem.src = "externscr.js";
|
||||
ok(extern_cnt === 0, "extern_cnt = " + extern_cnt + " expected 0");
|
||||
}
|
||||
|
||||
function testPutText() {
|
||||
var elem = document.getElementById("put_text_script");
|
||||
|
||||
exec_cnt = 0;
|
||||
elem.text = "exec_cnt++;";
|
||||
ok(exec_cnt === 1, "put_text_script exec_cnt " + exec_cnt);
|
||||
|
||||
exec_cnt = 0;
|
||||
elem.text = "exec_cnt++;";
|
||||
ok(exec_cnt === 1, "put_text_script exec_cnt " + exec_cnt);
|
||||
}
|
||||
|
||||
try {
|
||||
testWriteScript();
|
||||
testPutSrc();
|
||||
testPutText();
|
||||
}catch(e) {
|
||||
ok(false, "Got an exception");
|
||||
}
|
||||
|
||||
function testPutSrc2() {
|
||||
var elem, elem2;
|
||||
|
||||
elem = document.createElement("script");
|
||||
elem.src = "externscr.js";
|
||||
ok(extern_cnt === 1, "extern_cnt = " + extern_cnt + " expected 1");
|
||||
document.body.appendChild(elem);
|
||||
ok(extern_cnt === 2, "extern_cnt = " + extern_cnt + " expected 2");
|
||||
|
||||
elem = document.createElement("script");
|
||||
document.body.appendChild(elem);
|
||||
ok(extern_cnt === 2, "extern_cnt = " + extern_cnt + " expected 2");
|
||||
elem.src = "externscr.js";
|
||||
ok(extern_cnt === 3, "extern_cnt = " + extern_cnt + " expected 3");
|
||||
|
||||
elem2 = document.createElement("div");
|
||||
elem = document.createElement("script");
|
||||
elem.src = "externscr.js";
|
||||
ok(extern_cnt === 3, "extern_cnt = " + extern_cnt + " expected 3");
|
||||
elem2.appendChild(elem);
|
||||
document.body.appendChild(elem2);
|
||||
ok(extern_cnt === 4, "extern_cnt = " + extern_cnt + " expected 4");
|
||||
}
|
||||
|
||||
function testPutText2() {
|
||||
var elem;
|
||||
|
||||
elem = document.createElement("script");
|
||||
exec_cnt = 0;
|
||||
elem.text = "exec_cnt++;";
|
||||
ok(exec_cnt === 0, "script exec_cnt " + exec_cnt);
|
||||
|
||||
document.body.appendChild(elem);
|
||||
ok(exec_cnt === 1, "script exec_cnt " + exec_cnt);
|
||||
exec_cnt = 0;
|
||||
elem.text = "exec_cnt++;";
|
||||
ok(exec_cnt === 1, "script exec_cnt " + exec_cnt);
|
||||
|
||||
elem.src = "externscr.js";
|
||||
ok(extern_cnt === 5, "extern_cnt = " + extern_cnt + " expected 5");
|
||||
|
||||
exec_cnt = 0;
|
||||
ok(extern_cnt === 5, "> extern_cnt = " + extern_cnt + " expected 5");
|
||||
elem.text = "exec_cnt++;"; /* forces evaluation, but src will be executed */
|
||||
ok(exec_cnt === 0, "script exec_cnt " + exec_cnt);
|
||||
ok(extern_cnt === 6, "< extern_cnt = " + extern_cnt + " expected 6");
|
||||
|
||||
elem = document.createElement("script");
|
||||
exec_cnt = 0;
|
||||
elem.text = "exec_cnt++;";
|
||||
ok(exec_cnt === 0, "script exec_cnt " + exec_cnt);
|
||||
elem.src = "externscr.js";
|
||||
ok(extern_cnt === 6, "extern_cnt = " + extern_cnt + " expected 6");
|
||||
|
||||
document.body.appendChild(elem);
|
||||
ok(exec_cnt === 0, "script exec_cnt " + exec_cnt);
|
||||
ok(extern_cnt === 7, "extern_cnt = " + extern_cnt + " expected 7");
|
||||
}
|
||||
|
||||
document.body.onload = function() {
|
||||
ok(extern_cnt === 1, "extern_cnt = " + extern_cnt);
|
||||
try {
|
||||
testPutSrc2();
|
||||
testPutText2();
|
||||
}catch(e) {
|
||||
ok(false, "got an exception");
|
||||
}
|
||||
|
||||
external.reportSuccess();
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
ok(extern_cnt === 1, "extern_cnt = " + extern_cnt);
|
||||
</script>
|
||||
<div id="a1"></div>
|
||||
<div id="a2"></div>
|
||||
<div id="b3"></div>
|
||||
</body>
|
||||
</html>
|
1
rostests/winetests/mshtml/externscr.js
Normal file
1
rostests/winetests/mshtml/externscr.js
Normal file
|
@ -0,0 +1 @@
|
|||
extern_cnt++;
|
File diff suppressed because it is too large
Load diff
|
@ -107,11 +107,8 @@ static int str_eq_wa(LPCWSTR strw, const char *stra)
|
|||
{
|
||||
CHAR buf[512];
|
||||
|
||||
if(strw == NULL || stra == NULL){
|
||||
if((void*)strw == (void*)stra)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
if(!strw || !stra)
|
||||
return (void*)strw == (void*)stra;
|
||||
|
||||
WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
|
||||
return !lstrcmpA(stra, buf);
|
||||
|
@ -133,6 +130,13 @@ static void test_href(IHTMLLocation *loc, const struct location_test *test)
|
|||
ok(str_eq_wa(str, test->href),
|
||||
"%s: expected retrieved href to be L\"%s\", was: %s\n",
|
||||
test->name, test->href, wine_dbgstr_w(str));
|
||||
SysFreeString(str);
|
||||
|
||||
hres = IHTMLLocation_toString(loc, &str);
|
||||
ok(hres == S_OK, "%s: toString failed: 0x%08x\n", test->name, hres);
|
||||
ok(str_eq_wa(str, test->href), "%s: toString returned %s, expected %s\n",
|
||||
test->name, wine_dbgstr_w(str), test->href);
|
||||
SysFreeString(str);
|
||||
}
|
||||
|
||||
static void test_protocol(IHTMLLocation *loc, const struct location_test *test)
|
||||
|
@ -151,6 +155,7 @@ static void test_protocol(IHTMLLocation *loc, const struct location_test *test)
|
|||
ok(str_eq_wa(str, test->protocol),
|
||||
"%s: expected retrieved protocol to be L\"%s\", was: %s\n",
|
||||
test->name, test->protocol, wine_dbgstr_w(str));
|
||||
SysFreeString(str);
|
||||
}
|
||||
|
||||
static void test_host(IHTMLLocation *loc, const struct location_test *test)
|
||||
|
@ -169,9 +174,10 @@ static void test_host(IHTMLLocation *loc, const struct location_test *test)
|
|||
ok(str_eq_wa(str, test->host),
|
||||
"%s: expected retrieved host to be L\"%s\", was: %s\n",
|
||||
test->name, test->host, wine_dbgstr_w(str));
|
||||
SysFreeString(str);
|
||||
}
|
||||
|
||||
static void test_hostname(IHTMLLocation *loc, const struct location_test *test)
|
||||
static void test_hostname(IHTMLLocation *loc, IHTMLDocument2 *doc, const struct location_test *test)
|
||||
{
|
||||
HRESULT hres;
|
||||
BSTR str;
|
||||
|
@ -187,6 +193,15 @@ static void test_hostname(IHTMLLocation *loc, const struct location_test *test)
|
|||
ok(str_eq_wa(str, test->hostname),
|
||||
"%s: expected retrieved hostname to be L\"%s\", was: %s\n",
|
||||
test->name, test->hostname, wine_dbgstr_w(str));
|
||||
SysFreeString(str);
|
||||
|
||||
hres = IHTMLDocument2_get_domain(doc, &str);
|
||||
ok(hres == S_OK, "%s: get_domain failed: 0x%08x\n", test->name, hres);
|
||||
if(hres == S_OK)
|
||||
ok(str_eq_wa(str, test->hostname ? test->hostname : ""),
|
||||
"%s: expected retrieved domain to be L\"%s\", was: %s\n",
|
||||
test->name, test->hostname, wine_dbgstr_w(str));
|
||||
SysFreeString(str);
|
||||
}
|
||||
|
||||
static void test_port(IHTMLLocation *loc, const struct location_test *test)
|
||||
|
@ -205,6 +220,7 @@ static void test_port(IHTMLLocation *loc, const struct location_test *test)
|
|||
ok(str_eq_wa(str, test->port),
|
||||
"%s: expected retrieved port to be L\"%s\", was: %s\n",
|
||||
test->name, test->port, wine_dbgstr_w(str));
|
||||
SysFreeString(str);
|
||||
}
|
||||
|
||||
static void test_pathname(IHTMLLocation *loc, const struct location_test *test)
|
||||
|
@ -223,6 +239,7 @@ static void test_pathname(IHTMLLocation *loc, const struct location_test *test)
|
|||
ok(str_eq_wa(str, test->pathname),
|
||||
"%s: expected retrieved pathname to be L\"%s\", was: %s\n",
|
||||
test->name, test->pathname, wine_dbgstr_w(str));
|
||||
SysFreeString(str);
|
||||
}
|
||||
|
||||
static void test_search(IHTMLLocation *loc, const struct location_test *test)
|
||||
|
@ -241,6 +258,7 @@ static void test_search(IHTMLLocation *loc, const struct location_test *test)
|
|||
ok(str_eq_wa(str, test->search),
|
||||
"%s: expected retrieved search to be L\"%s\", was: %s\n",
|
||||
test->name, test->search, wine_dbgstr_w(str));
|
||||
SysFreeString(str);
|
||||
}
|
||||
|
||||
static void test_hash(IHTMLLocation *loc, const struct location_test *test)
|
||||
|
@ -259,6 +277,7 @@ static void test_hash(IHTMLLocation *loc, const struct location_test *test)
|
|||
ok(str_eq_wa(str, test->hash),
|
||||
"%s: expected retrieved hash to be L\"%s\", was: %s\n",
|
||||
test->name, test->hash, wine_dbgstr_w(str));
|
||||
SysFreeString(str);
|
||||
}
|
||||
|
||||
static void perform_test(const struct location_test* test)
|
||||
|
@ -339,7 +358,7 @@ static void perform_test(const struct location_test* test)
|
|||
test_href(location, test);
|
||||
test_protocol(location, test);
|
||||
test_host(location, test);
|
||||
test_hostname(location, test);
|
||||
test_hostname(location, doc, test);
|
||||
test_port(location, test);
|
||||
test_pathname(location, test);
|
||||
test_search(location, test);
|
||||
|
|
|
@ -31,7 +31,155 @@ function test_select_index() {
|
|||
ok(s[2] === null, "s[2] = " + s[2]);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
function test_createDocumentFragment() {
|
||||
var fragment = document.createDocumentFragment();
|
||||
|
||||
ok(typeof(fragment) === "object", "typeof(fragmend) = " + typeof(fragment));
|
||||
ok(fragment.nodeType === 11, "fragment.nodeType = " + fragment.nodeType);
|
||||
ok(fragment.nodeName === "#document-fragment", "fragment.nodeName = " + fragment.nodeName);
|
||||
|
||||
var cloned = fragment.cloneNode(true);
|
||||
ok(cloned.nodeType === 11, "cloned.nodeType = " + cloned.nodeType);
|
||||
ok(cloned.nodeName === "#document-fragment", "cloned.nodeName = " + cloned.nodeName);
|
||||
}
|
||||
|
||||
function test_document_name_as_index() {
|
||||
document.body.innerHTML = '<form name="formname"></form>';
|
||||
var e = document.getElementById("formname");
|
||||
ok(!!e, "e is null");
|
||||
|
||||
ok(document.formname === e, "document.formname != getElementById('formname')");
|
||||
ok("formname" in document, "formname' is not in document");
|
||||
|
||||
document.body.removeChild(e);
|
||||
|
||||
ok(document.formname === undefined, "document.formname is not undefined");
|
||||
ok(!("formname" in document), "formname' is in document");
|
||||
|
||||
document.body.innerHTML = '<form id="formid"></form>';
|
||||
var e = document.getElementById("formid");
|
||||
ok(!!e, "e is null");
|
||||
ok(!("formid" in document), "formid is in document");
|
||||
|
||||
document.body.innerHTML = '<form name="formname"></form>';
|
||||
ok("formname" in window, "formname' is not in window");
|
||||
ok(typeof(window.formname) === "object", "typeof(window.formname) = " + typeof(window.formname));
|
||||
window.formname = 1;
|
||||
ok(window.formname === 1, "window.formname = " + window.formname);
|
||||
formname = 2;
|
||||
ok(window.formname === 2, "window.formname = " + window.formname);
|
||||
|
||||
document.body.innerHTML = '<iframe id="iframeid"></iframe>';
|
||||
ok("iframeid" in window, "iframeid is not in window");
|
||||
e = document.getElementById("iframeid");
|
||||
ok(!!e, "e is null");
|
||||
ok(iframeid != e, "iframeid == e");
|
||||
ok(iframeid.frameElement === e, "frameid != e.contentWindow");
|
||||
}
|
||||
|
||||
function test_remove_style_attribute() {
|
||||
var s = document.body.style, b;
|
||||
|
||||
s.somevar = "test";
|
||||
b = s.removeAttribute("somevar", 1);
|
||||
ok(b, "removeAttribute returned " + b + " expected true");
|
||||
b = s.removeAttribute("somevar", 1);
|
||||
ok(b === false, "removeAttribute returned " + b + " expected false");
|
||||
}
|
||||
|
||||
function test_clone_node() {
|
||||
var elem, cloned;
|
||||
|
||||
elem = document.getElementById("divid");
|
||||
elem.style.filter = "alpha(opacity=50)";
|
||||
ok(elem.style.filter === "alpha(opacity=50)", "elem.style.filter = " + elem.style.filter);
|
||||
|
||||
cloned = elem.cloneNode(true);
|
||||
ok(cloned.style.filter === "alpha(opacity=50)", "cloned.style.filter = " + cloned.style.filter);
|
||||
}
|
||||
|
||||
function test_setAttribute() {
|
||||
var input;
|
||||
|
||||
document.body.innerHTML = '<input id="inputid"></input>';
|
||||
input = document.getElementById("inputid");
|
||||
ok(input.checked === false, "input.checked = " + input.checked);
|
||||
|
||||
input.setAttribute("checked", "test");
|
||||
ok(input.checked === true, "input.checked = " + input.checked);
|
||||
|
||||
input.setAttribute("checked", 0);
|
||||
ok(input.checked === false, "input.checked = " + input.checked);
|
||||
|
||||
input.setAttribute("checked", "");
|
||||
ok(input.checked === false, "input.checked = " + input.checked);
|
||||
}
|
||||
|
||||
function test_attribute_collection() {
|
||||
var div, attr;
|
||||
|
||||
document.body.innerHTML = '<div id="divid" class="test"></div>';
|
||||
div = document.getElementById("divid");
|
||||
|
||||
attr = div.attributes["dir"];
|
||||
ok(attr === div.attributes["dir"], "attr !== div.attributes['dir']");
|
||||
}
|
||||
|
||||
function test_getter_call() {
|
||||
document.body.innerHTML = '<div id="divid"></div>';
|
||||
|
||||
var e = document.getElementById("divid");
|
||||
|
||||
e.myfunc = function(x) { this.myfunc_called = x; };
|
||||
e.myfunc("test");
|
||||
ok(e.myfunc_called === "test", "e.myfunc_called = " + e.myfunc_called);
|
||||
|
||||
e.onmousedown = function(x) { this.onmousedown_called = x; };
|
||||
e.onmousedown("test");
|
||||
ok(e.onmousedown_called === "test", "e.onmousedown_called = " + e.onmousedown_called);
|
||||
}
|
||||
|
||||
function test_arg_conv() {
|
||||
/* this call would throw if the argument wasn't converted by JScript */
|
||||
window.clearInterval("");
|
||||
|
||||
navigator.javaEnabled();
|
||||
}
|
||||
|
||||
function test_override_functions() {
|
||||
function override_func() { return "test"; }
|
||||
|
||||
ok(typeof(window.showModalDialog) === "object", "typeof(window.showModalDialog) = " + typeof(window.showModalDialog));
|
||||
window.showModalDialog = override_func;
|
||||
ok(window.showModalDialog === override_func, "window.showModalDialog != override_func");
|
||||
ok(typeof(window.showModalDialog) === "function", "typeof(window.showModalDialog) = " + typeof(window.showModalDialog));
|
||||
|
||||
document.body.innerHTML = '<div id="divid"></div>';
|
||||
var div = document.getElementById("divid");
|
||||
ok(typeof(div.addBehavior) === "object", "typeof(div.addBehavior) = " + typeof(div.addBehavior));
|
||||
div.addBehavior = override_func;
|
||||
ok(div.addBehavior === override_func, "div.addBehavior != override_func");
|
||||
ok(typeof(div.addBehavior) === "function", "typeof(div.addBehavior) = " + typeof(div.addBehavior));
|
||||
|
||||
var tmp = div.addBehavior();
|
||||
ok(tmp === "test", "div.addBehavior() = " + tmp);
|
||||
}
|
||||
|
||||
function test_forin() {
|
||||
var cnt=0;
|
||||
|
||||
document.body.innerHTML = '<a id="aid"></a>';
|
||||
|
||||
for(var x in document.getElementById("aid")) {
|
||||
cnt++;
|
||||
}
|
||||
|
||||
ok(cnt > 100, "cnt = " + cnt);
|
||||
}
|
||||
|
||||
var globalVar = false;
|
||||
|
||||
function runTests() {
|
||||
obj = new Object();
|
||||
ok(obj === window.obj, "obj !== window.obj");
|
||||
|
||||
|
@ -40,6 +188,28 @@ function runTest() {
|
|||
test_removeAttribute(document.getElementById("divid"));
|
||||
test_removeAttribute(document.body);
|
||||
test_select_index();
|
||||
test_clone_node();
|
||||
test_createDocumentFragment();
|
||||
test_document_name_as_index();
|
||||
test_remove_style_attribute();
|
||||
test_getter_call();
|
||||
test_setAttribute();
|
||||
test_attribute_collection();
|
||||
test_arg_conv();
|
||||
test_override_functions();
|
||||
test_forin();
|
||||
|
||||
var r = window.execScript("globalVar = true;");
|
||||
ok(r === undefined, "execScript returned " + r);
|
||||
ok(globalVar === true, "globalVar = " + globalVar);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
try {
|
||||
runTests();
|
||||
}catch(e) {
|
||||
ok(false, "got exception");
|
||||
}
|
||||
|
||||
external.reportSuccess();
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#define COBJMACROS
|
||||
|
||||
#include <wine/test.h>
|
||||
#include <stdarg.h>
|
||||
//#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "ole2.h"
|
||||
#include "initguid.h"
|
||||
#include "optary.h"
|
||||
//#include "windef.h"
|
||||
//#include "winbase.h"
|
||||
//#include "ole2.h"
|
||||
//#include "initguid.h"
|
||||
#include <optary.h>
|
||||
|
||||
static void test_HTMLLoadOptions(void)
|
||||
{
|
||||
|
|
|
@ -19,16 +19,16 @@
|
|||
#define COBJMACROS
|
||||
|
||||
#include <wine/test.h>
|
||||
#include <stdarg.h>
|
||||
//#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "ole2.h"
|
||||
#include "urlmon.h"
|
||||
#include "shlwapi.h"
|
||||
//#include "windef.h"
|
||||
//#include "winbase.h"
|
||||
//#include "ole2.h"
|
||||
//#include "urlmon.h"
|
||||
#include <shlwapi.h>
|
||||
|
||||
#include "initguid.h"
|
||||
#include <initguid.h>
|
||||
|
||||
#define DEFINE_EXPECT(func) \
|
||||
static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
|
||||
|
@ -315,6 +315,8 @@ static void test_res_protocol(void)
|
|||
{'r','e','s',':','/','/','x','x','.','d','l','l','/','b','l','a','n','k','.','h','t','m',0};
|
||||
static const WCHAR wrong_url5[] =
|
||||
{'r','e','s',':','/','/','s','h','t','m','l','.','d','l','l','/','b','l','a','n','k','.','h','t','m',0};
|
||||
static const WCHAR wrong_url6[] =
|
||||
{'r','e','s',':','/','/','c',':','\\','d','i','r','\\','f','i','l','e','.','d','l','l','/','b','l','a','n','k','.','h','t','m',0};
|
||||
static const WCHAR mshtml_dllW[] = {'m','s','h','t','m','l','.','d','l','l',0};
|
||||
|
||||
hres = CoGetClassObject(&CLSID_ResProtocol, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&unk);
|
||||
|
@ -326,7 +328,7 @@ static void test_res_protocol(void)
|
|||
ok(hres == S_OK, "Could not get IInternetProtocolInfo interface: %08x\n", hres);
|
||||
if(SUCCEEDED(hres)) {
|
||||
WCHAR buf[128];
|
||||
DWORD size;
|
||||
DWORD size, expected_size;
|
||||
int i;
|
||||
|
||||
for(i = PARSE_CANONICALIZE; i <= PARSE_UNESCAPE; i++) {
|
||||
|
@ -342,12 +344,20 @@ static void test_res_protocol(void)
|
|||
sizeof(buf)/sizeof(buf[0]), &size, 0);
|
||||
ok(hres == S_OK, "ParseUrl failed: %08x\n", hres);
|
||||
res_sec_url_cmp(buf, size, mshtml_dllW);
|
||||
ok(size == lstrlenW(buf)+1, "size = %d\n", size);
|
||||
expected_size = size;
|
||||
|
||||
hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_SECURITY_URL, 0, buf,
|
||||
expected_size, &size, 0);
|
||||
ok(hres == S_OK, "ParseUrl failed: %08x\n", hres);
|
||||
res_sec_url_cmp(buf, size, mshtml_dllW);
|
||||
ok(size == expected_size, "size = %d\n", size);
|
||||
|
||||
size = 0;
|
||||
hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_SECURITY_URL, 0, buf,
|
||||
3, &size, 0);
|
||||
ok(hres == S_FALSE, "ParseUrl failed: %08x, expected S_FALSE\n", hres);
|
||||
ok(size, "size=0\n");
|
||||
ok(size == expected_size, "size = %d\n", size);
|
||||
|
||||
hres = IInternetProtocolInfo_ParseUrl(protocol_info, wrong_url1, PARSE_SECURITY_URL, 0, buf,
|
||||
sizeof(buf)/sizeof(buf[0]), &size, 0);
|
||||
|
@ -358,6 +368,10 @@ static void test_res_protocol(void)
|
|||
sizeof(buf)/sizeof(buf[0]), &size, 0);
|
||||
ok(hres == MK_E_SYNTAX, "ParseUrl failed: %08x, expected MK_E_SYNTAX\n", hres);
|
||||
|
||||
hres = IInternetProtocolInfo_ParseUrl(protocol_info, wrong_url6, PARSE_SECURITY_URL, 0, buf,
|
||||
sizeof(buf)/sizeof(buf[0]), &size, 0);
|
||||
ok(hres == MK_E_SYNTAX, "ParseUrl failed: %08x, expected MK_E_SYNTAX\n", hres);
|
||||
|
||||
size = 0xdeadbeef;
|
||||
buf[0] = '?';
|
||||
hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_DOMAIN, 0, buf,
|
||||
|
@ -379,7 +393,7 @@ static void test_res_protocol(void)
|
|||
|
||||
if (0)
|
||||
{
|
||||
/* Crashes on win9x */
|
||||
/* Crashes on windows */
|
||||
size = 0xdeadbeef;
|
||||
buf[0] = '?';
|
||||
hres = IInternetProtocolInfo_ParseUrl(protocol_info, NULL, PARSE_DOMAIN, 0, buf,
|
||||
|
@ -464,7 +478,6 @@ static void test_res_protocol(void)
|
|||
memset(buf, '?', sizeof(buf));
|
||||
hres = IInternetProtocolInfo_QueryInfo(protocol_info, NULL, QUERY_USES_NETWORK, 0,
|
||||
buf, sizeof(buf), &size, 0);
|
||||
ok(hres == S_OK, "QueryInfo(QUERY_USES_NETWORK) failed: %08x, expected E_FAIL\n", hres);
|
||||
ok(hres == S_OK, "QueryInfo(QUERY_USES_NETWORK) failed: %08x\n", hres);
|
||||
ok(size == sizeof(DWORD), "size=%d\n", size);
|
||||
ok(!*(DWORD*)buf, "buf=%d\n", *(DWORD*)buf);
|
||||
|
@ -656,14 +669,17 @@ static void test_about_protocol(void)
|
|||
ok(hres == S_OK, "ParseUrl failed: %08x\n", hres);
|
||||
ok(!lstrcmpW(about_blank_url, buf), "buf != blank_url\n");
|
||||
|
||||
size = 0xdeadbeef;
|
||||
hres = IInternetProtocolInfo_ParseUrl(protocol_info, about_blank_url, PARSE_SECURITY_URL, 0, buf,
|
||||
3, &size, 0);
|
||||
ok(hres == S_FALSE, "ParseUrl failed: %08x, expected S_FALSE\n", hres);
|
||||
ok(size == 12, "size = %d\n", size);
|
||||
|
||||
hres = IInternetProtocolInfo_ParseUrl(protocol_info, about_test_url, PARSE_SECURITY_URL, 0, buf,
|
||||
sizeof(buf)/sizeof(buf[0]), &size, 0);
|
||||
ok(hres == S_OK, "ParseUrl failed: %08x\n", hres);
|
||||
ok(!lstrcmpW(about_test_url, buf), "buf != test_url\n");
|
||||
ok(size == 11, "size = %d\n", size);
|
||||
|
||||
size = 0xdeadbeef;
|
||||
buf[0] = '?';
|
||||
|
@ -677,7 +693,7 @@ static void test_about_protocol(void)
|
|||
|
||||
if (0)
|
||||
{
|
||||
/* Crashes on win9x */
|
||||
/* Crashes on windows */
|
||||
size = 0xdeadbeef;
|
||||
buf[0] = '?';
|
||||
hres = IInternetProtocolInfo_ParseUrl(protocol_info, NULL, PARSE_DOMAIN, 0, buf,
|
||||
|
@ -738,6 +754,7 @@ static void test_about_protocol(void)
|
|||
case QUERY_IS_SECURE:
|
||||
case QUERY_IS_SAFE:
|
||||
case QUERY_USES_HISTORYFOLDER:
|
||||
case QUERY_IS_CACHED_AND_USABLE_OFFLINE:
|
||||
break;
|
||||
default:
|
||||
hres = IInternetProtocolInfo_QueryInfo(protocol_info, about_blank_url, i, 0,
|
||||
|
|
|
@ -16,5 +16,20 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/* @makedep: exectest.html */
|
||||
exectest.html HTML "exectest.html"
|
||||
|
||||
/* @makedep: jstest.html */
|
||||
jstest.html HTML "jstest.html"
|
||||
|
||||
/* @makedep: vbtest.html */
|
||||
vbtest.html HTML "vbtest.html"
|
||||
|
||||
/* @makedep: events.html */
|
||||
events.html HTML "events.html"
|
||||
|
||||
/* @makedep: externscr.js */
|
||||
externscr.js HTML "externscr.js"
|
||||
|
||||
/* @makedep: test_tlb.tlb */
|
||||
1 TYPELIB test_tlb.tlb
|
||||
|
|
File diff suppressed because it is too large
Load diff
2635
rostests/winetests/mshtml/style.c
Normal file
2635
rostests/winetests/mshtml/style.c
Normal file
File diff suppressed because it is too large
Load diff
55
rostests/winetests/mshtml/test_tlb.idl
Normal file
55
rostests/winetests/mshtml/test_tlb.idl
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright 2012 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
|
||||
*/
|
||||
|
||||
import "oaidl.idl";
|
||||
|
||||
[
|
||||
version(1.0),
|
||||
uuid(fb137422-de47-4630-848d-a20ccae34725)
|
||||
]
|
||||
library MSHTMLTest {
|
||||
importlib("stdole2.tlb");
|
||||
|
||||
[
|
||||
oleautomation,
|
||||
odl,
|
||||
uuid(e0d1ce9d-e916-4723-ace5-888c3537de78),
|
||||
dual
|
||||
]
|
||||
interface IActiveXTest : IDispatch {
|
||||
HRESULT nothinginteresting();
|
||||
}
|
||||
|
||||
[
|
||||
uuid(0d853edb-cb70-447e-9d8a-b9661c5da56f)
|
||||
]
|
||||
dispinterface DispActiveXTest {
|
||||
properties:
|
||||
methods:
|
||||
[id(1)] long testfunc();
|
||||
[id(2)] long testfunc2(long a, long b);
|
||||
}
|
||||
|
||||
[
|
||||
uuid(ba9d587b-1aad-4192-a29a-99bd5f7482c3)
|
||||
]
|
||||
coclass ActiveXTest {
|
||||
[default] interface IActiveXTest;
|
||||
[source, default] interface DispActiveXTest;
|
||||
}
|
||||
}
|
|
@ -1,11 +1,9 @@
|
|||
/* Automatically generated file; DO NOT EDIT!! */
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
#define STANDALONE
|
||||
#include "wine/test.h"
|
||||
|
||||
extern void func_activex(void);
|
||||
extern void func_dom(void);
|
||||
extern void func_events(void);
|
||||
extern void func_htmldoc(void);
|
||||
|
@ -13,15 +11,18 @@ extern void func_htmllocation(void);
|
|||
extern void func_misc(void);
|
||||
extern void func_protocol(void);
|
||||
extern void func_script(void);
|
||||
extern void func_style(void);
|
||||
|
||||
const struct test winetest_testlist[] =
|
||||
{
|
||||
{ "activex", func_activex },
|
||||
{ "dom", func_dom },
|
||||
{ "events", func_events },
|
||||
{ "htmldoc", func_htmldoc },
|
||||
{ "htmllocation", func_htmllocation },
|
||||
{ "htmldoc", func_htmldoc },
|
||||
{ "htmllocation", func_htmllocation },
|
||||
{ "misc", func_misc },
|
||||
{ "protocol", func_protocol },
|
||||
{ "script", func_script },
|
||||
{ "style", func_style },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
|
48
rostests/winetests/mshtml/vbtest.html
Normal file
48
rostests/winetests/mshtml/vbtest.html
Normal file
|
@ -0,0 +1,48 @@
|
|||
<html>
|
||||
<head>
|
||||
<script type="text/vbscript">
|
||||
<!--
|
||||
Dim counter
|
||||
|
||||
counter = 1
|
||||
|
||||
Sub ok(b,m)
|
||||
Call external.ok(b,m)
|
||||
End Sub
|
||||
-->
|
||||
</script>
|
||||
<script>
|
||||
' Verifies that we're in VBScript although there is no type specified
|
||||
If true then counter = counter+1
|
||||
function inccounter(x)
|
||||
counter = counter+x
|
||||
end function
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
// We're in javascript
|
||||
try {
|
||||
counter++;
|
||||
incCounter(2);
|
||||
}catch(e) {
|
||||
ok(false, "got an exception");
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
' And back to VBScript
|
||||
If true then counter = counter+1
|
||||
|
||||
Sub runTest()
|
||||
Call ok(counter = 6, "counter = " & counter)
|
||||
Call ok(isNull(document.onkeyup), "document.onkeyup is not null")
|
||||
Call ok(document.formname.tagName = "FORM", "document.form.tagName = " & document.formname.tagName)
|
||||
Call ok(formname.tagName = "FORM", "form.tagName = " & formname.tagName)
|
||||
Call external.reportSuccess()
|
||||
End Sub
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
// We're in javascript
|
||||
</script>
|
||||
<body onload="If true then runTest()">
|
||||
<form name="formname"></form>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue