Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2046d69b
Commit
2046d69b
authored
Jul 19, 2013
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml/tests: Added more res protocol tests.
parent
edf4e618
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
1 deletion
+46
-1
protocol.c
dlls/mshtml/tests/protocol.c
+38
-1
rsrc.rc
dlls/mshtml/tests/rsrc.rc
+8
-0
No files found.
dlls/mshtml/tests/protocol.c
View file @
2046d69b
...
...
@@ -27,6 +27,7 @@
#include "ole2.h"
#include "urlmon.h"
#include "shlwapi.h"
#include "wininet.h"
#include "initguid.h"
...
...
@@ -73,6 +74,9 @@ static const WCHAR about_test_url[] = {'a','b','o','u','t',':','t','e','s','t',0
static
const
WCHAR
about_res_url
[]
=
{
'r'
,
'e'
,
's'
,
':'
,
'b'
,
'l'
,
'a'
,
'n'
,
'k'
,
0
};
static
const
WCHAR
javascript_test_url
[]
=
{
'j'
,
'a'
,
'v'
,
'a'
,
's'
,
'c'
,
'r'
,
'i'
,
'p'
,
't'
,
':'
,
't'
,
'e'
,
's'
,
't'
,
'('
,
')'
,
0
};
static
WCHAR
res_url_base
[
INTERNET_MAX_URL_LENGTH
]
=
{
'r'
,
'e'
,
's'
,
':'
,
'/'
,
'/'
};
static
unsigned
res_url_base_len
;
static
const
char
*
debugstr_guid
(
REFIID
riid
)
{
static
char
buf
[
50
];
...
...
@@ -248,7 +252,7 @@ static void test_protocol_fail(IInternetProtocol *protocol, LPCWSTR url, HRESULT
CHECK_CALLED
(
ReportResult
);
}
static
void
protocol_start
(
IInternetProtocol
*
protocol
,
LPCWSTR
url
)
static
void
protocol_start
(
IInternetProtocol
*
protocol
,
const
WCHAR
*
url
)
{
HRESULT
hres
;
...
...
@@ -268,6 +272,33 @@ static void protocol_start(IInternetProtocol *protocol, LPCWSTR url)
CHECK_CALLED
(
ReportResult
);
}
static
void
test_res_url
(
const
char
*
url_suffix
)
{
WCHAR
url
[
INTERNET_MAX_URL_LENGTH
];
IInternetProtocol
*
protocol
;
ULONG
size
,
ref
;
BYTE
buf
[
100
];
HRESULT
hres
;
memcpy
(
url
,
res_url_base
,
res_url_base_len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
url_suffix
,
-
1
,
url
+
res_url_base_len
,
sizeof
(
url
)
-
res_url_base_len
);
hres
=
CoCreateInstance
(
&
CLSID_ResProtocol
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IInternetProtocol
,
(
void
**
)
&
protocol
);
ok
(
hres
==
S_OK
,
"Could not create ResProtocol instance: %08x
\n
"
,
hres
);
protocol_start
(
protocol
,
url
);
hres
=
IInternetProtocol_Read
(
protocol
,
buf
,
sizeof
(
buf
),
&
size
);
ok
(
hres
==
S_OK
,
"Read failed: %08x
\n
"
,
hres
);
hres
=
IInternetProtocol_Terminate
(
protocol
,
0
);
ok
(
hres
==
S_OK
,
"Terminate failed: %08x
\n
"
,
hres
);
ref
=
IInternetProtocol_Release
(
protocol
);
ok
(
!
ref
,
"ref=%u
\n
"
,
ref
);
}
static
void
res_sec_url_cmp
(
LPCWSTR
url
,
DWORD
size
,
LPCWSTR
file
)
{
WCHAR
buf
[
MAX_PATH
];
...
...
@@ -578,6 +609,10 @@ static void test_res_protocol(void)
}
IUnknown_Release
(
unk
);
test_res_url
(
"/jstest.html"
);
test_res_url
(
"/Test/res.html"
);
test_res_url
(
"/test/dir/dir2/res.html"
);
}
static
void
do_test_about_protocol
(
IClassFactory
*
factory
,
DWORD
bf
)
...
...
@@ -908,6 +943,8 @@ static void test_javascript_protocol(void)
START_TEST
(
protocol
)
{
res_url_base_len
=
6
+
GetModuleFileNameW
(
NULL
,
res_url_base
+
6
/* strlen("res://") */
,
sizeof
(
res_url_base
)
-
6
);
OleInitialize
(
NULL
);
test_res_protocol
();
...
...
dlls/mshtml/tests/rsrc.rc
View file @
2046d69b
...
...
@@ -33,3 +33,11 @@ externscr.js HTML "externscr.js"
/* @makedep: test_tlb.tlb */
1 TYPELIB test_tlb.tlb
/* For res: protocol test: */
/* @makedep: jstest.html */
res.html test "jstest.html"
/* @makedep: jstest.html */
dir/dir2/res.html test "jstest.html"
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