Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
00f74afe
Commit
00f74afe
authored
8 years ago
by
Jacek Caban
Committed by
Alexandre Julliard
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Rewrite navigation tests using new HTTP emulation framework.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2ad4e9f4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
107 additions
and
4 deletions
+107
-4
navigation.js
dlls/mshtml/tests/navigation.js
+103
-0
rsrc.rc
dlls/mshtml/tests/rsrc.rc
+2
-2
script.c
dlls/mshtml/tests/script.c
+2
-2
No files found.
dlls/mshtml/tests/navigation.js
0 → 100644
View file @
00f74afe
/*
* 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
nav_parent_test
()
{
external
.
trace
(
"Running _parent navigation tests..."
);
var
iframe
=
document
.
getElementById
(
"testframe"
);
var
subframe
=
iframe
.
contentWindow
.
document
.
createElement
(
"iframe"
);
subframe
.
onload
=
function
()
{
var
doc
=
subframe
.
contentWindow
.
document
;
doc
.
body
.
innerHTML
=
'<a href="http://winetest.org/blank2.html" id="aid" target="_parent">test</a>'
;
doc
.
getElementById
(
"aid"
).
click
();
}
iframe
.
onload
=
function
()
{
iframe
.
onload
=
null
;
var
href
=
iframe
.
contentWindow
.
location
.
href
;
ok
(
/.*blank2.html/
.
test
(
href
),
"Unexpected href "
+
href
);
next_test
();
}
iframe
.
contentWindow
.
document
.
body
.
appendChild
(
subframe
);
subframe
.
src
=
"blank.html"
;
}
function
window_navigate_test
()
{
external
.
trace
(
"Running window.navigate() tests..."
);
var
iframe
=
document
.
getElementById
(
"testframe"
);
iframe
.
onload
=
function
()
{
iframe
.
onload
=
null
;
var
href
=
iframe
.
contentWindow
.
location
.
href
;
ok
(
href
===
"about:blank"
,
"Unexpected href "
+
href
);
next_test
();
}
iframe
.
contentWindow
.
navigate
(
"about:blank"
);
}
function
window_open_self_test
()
{
external
.
trace
(
"Running window.open(_self) tests..."
);
var
iframe
=
document
.
getElementById
(
"testframe"
);
var
iframe_window
=
iframe
.
contentWindow
;
iframe
.
onload
=
function
()
{
iframe
.
onload
=
null
;
var
href
=
iframe
.
contentWindow
.
location
.
href
;
ok
(
/.*blank.html
\?
window_open_self/
.
test
(
href
),
"Unexpected href "
+
href
);
ok
(
iframe
.
contentWindow
===
iframe_window
,
"iframe.contentWindow !== iframe_window"
);
next_test
();
}
iframe_window
.
open
(
"blank.html?window_open_self"
,
"_self"
);
}
function
detached_src_test
()
{
var
iframe
=
document
.
createElement
(
"iframe"
);
var
onload_called
=
false
;
iframe
.
onload
=
function
()
{
onload_called
=
true
;
next_test
();
}
iframe
.
src
=
"blank.html"
;
document
.
body
.
appendChild
(
iframe
);
ok
(
onload_called
===
false
,
"called onload too early?"
);
}
function
init_test_iframe
()
{
var
iframe
=
document
.
createElement
(
"iframe"
);
iframe
.
onload
=
next_test
;
iframe
.
id
=
"testframe"
;
iframe
.
src
=
"about:blank"
;
document
.
body
.
appendChild
(
iframe
);
}
var
tests
=
[
init_test_iframe
,
nav_parent_test
,
window_navigate_test
,
window_open_self_test
,
detached_src_test
];
This diff is collapsed.
Click to expand it.
dlls/mshtml/tests/rsrc.rc
View file @
00f74afe
...
...
@@ -34,8 +34,8 @@ events.html HTML "events.html"
/* @makedep: externscr.js */
externscr.js HTML "externscr.js"
/* @makedep: nav
_test.html
*/
nav
_test.html HTML "nav_test.html
"
/* @makedep: nav
igation.js
*/
nav
igation.js HTML "navigation.js
"
/* @makedep: xhr.js */
xhr.js HTML "xhr.js"
...
...
This diff is collapsed.
Click to expand it.
dlls/mshtml/tests/script.c
View file @
00f74afe
...
...
@@ -3315,11 +3315,11 @@ static void run_js_tests(void)
return
;
}
run_js_script
(
"nav_test.html"
);
init_protocol_handler
();
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"
);
}
static
BOOL
init_registry
(
BOOL
init
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment