Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
412a070e
Commit
412a070e
authored
10 years ago
by
Qian Hong
Committed by
Alexandre Julliard
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
atl100/tests: Added tests for AtlAxCreateControlEx.
parent
ec52a1f5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/atl100/tests/atl.c
+173
-18
173 additions, 18 deletions
dlls/atl100/tests/atl.c
with
173 additions
and
18 deletions
dlls/atl100/tests/atl.c
+
173
−
18
View file @
412a070e
...
@@ -44,6 +44,25 @@ static const GUID CATID_CatTest2 =
...
@@ -44,6 +44,25 @@ static const GUID CATID_CatTest2 =
{
0x178fc163
,
0x0000
,
0x0000
,{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x46
}};
{
0x178fc163
,
0x0000
,
0x0000
,{
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0x46
}};
#define CATID_CATTEST2_STR "178fc163-0000-0000-0000-000000000246"
#define CATID_CATTEST2_STR "178fc163-0000-0000-0000-000000000246"
static
const
WCHAR
emptyW
[]
=
{
'\0'
};
static
const
WCHAR
randomW
[]
=
{
'r'
,
'a'
,
'n'
,
'd'
,
'o'
,
'm'
,
'\0'
};
static
const
WCHAR
progid1W
[]
=
{
'S'
,
'h'
,
'e'
,
'l'
,
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'<'
,
'/'
,
'b'
,
'o'
,
'd'
,
'y'
,
'>'
,
'<'
,
'/'
,
'h'
,
't'
,
'm'
,
'l'
,
'>'
,
'\0'
};
static
const
WCHAR
mshtml3W
[]
=
{
'<'
,
'h'
,
't'
,
'm'
,
'l'
,
'>'
,
'<'
,
'b'
,
'o'
,
'd'
,
'y'
,
'>'
,
't'
,
'e'
,
's'
,
't'
,
'<'
,
'/'
,
'b'
,
'o'
,
'd'
,
'y'
,
'>'
,
'<'
,
'/'
,
'h'
,
't'
,
'm'
,
'l'
,
'>'
,
'\0'
};
static
const
WCHAR
fileW
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
'/'
,
'\0'
};
static
const
WCHAR
html_fileW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'.'
,
'h'
,
't'
,
'm'
,
'l'
,
'\0'
};
static
const
char
html_str
[]
=
"<html><body>test</body><html>"
;
static
BOOL
is_process_limited
(
void
)
static
BOOL
is_process_limited
(
void
)
{
{
static
BOOL
(
WINAPI
*
pOpenProcessToken
)(
HANDLE
,
DWORD
,
PHANDLE
)
=
NULL
;
static
BOOL
(
WINAPI
*
pOpenProcessToken
)(
HANDLE
,
DWORD
,
PHANDLE
)
=
NULL
;
...
@@ -601,24 +620,6 @@ static void test_ax_win(void)
...
@@ -601,24 +620,6 @@ static void test_ax_win(void)
WCHAR
file_uri1W
[
MAX_PATH
],
pathW
[
MAX_PATH
];
WCHAR
file_uri1W
[
MAX_PATH
],
pathW
[
MAX_PATH
];
WNDCLASSEXW
wcex
;
WNDCLASSEXW
wcex
;
static
HMODULE
hinstance
=
0
;
static
HMODULE
hinstance
=
0
;
static
const
WCHAR
emptyW
[]
=
{
'\0'
};
static
const
WCHAR
randomW
[]
=
{
'r'
,
'a'
,
'n'
,
'd'
,
'o'
,
'm'
,
'\0'
};
static
const
WCHAR
progid1W
[]
=
{
'S'
,
'h'
,
'e'
,
'l'
,
'l'
,
'.'
,
'E'
,
'x'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
,
'd'
,
'y'
,
'>'
,
'<'
,
'/'
,
'h'
,
't'
,
'm'
,
'l'
,
'>'
,
'\0'
};
static
const
WCHAR
mshtml3W
[]
=
{
'<'
,
'h'
,
't'
,
'm'
,
'l'
,
'>'
,
'<'
,
'b'
,
'o'
,
'd'
,
'y'
,
'>'
,
't'
,
'e'
,
's'
,
't'
,
'<'
,
'/'
,
'b'
,
'o'
,
'd'
,
'y'
,
'>'
,
'<'
,
'/'
,
'h'
,
't'
,
'm'
,
'l'
,
'>'
,
'\0'
};
static
const
WCHAR
fileW
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
,
'/'
,
'\0'
};
static
const
WCHAR
html_fileW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'.'
,
'h'
,
't'
,
'm'
,
'l'
,
'\0'
};
static
const
char
html_str
[]
=
"<html><body>test</body><html>"
;
static
const
WCHAR
cls_names
[][
16
]
=
static
const
WCHAR
cls_names
[][
16
]
=
{
{
{
'A'
,
't'
,
'l'
,
'A'
,
'x'
,
'W'
,
'i'
,
'n'
,
'1'
,
'0'
,
'0'
,
0
},
{
'A'
,
't'
,
'l'
,
'A'
,
'x'
,
'W'
,
'i'
,
'n'
,
'1'
,
'0'
,
'0'
,
0
},
...
@@ -851,6 +852,159 @@ static void test_AtlAxAttachControl(void)
...
@@ -851,6 +852,159 @@ static void test_AtlAxAttachControl(void)
IUnknown_Release
(
control
);
IUnknown_Release
(
control
);
}
}
static
void
test_AtlAxCreateControl
(
void
)
{
HWND
hwnd
;
IUnknown
*
control
,
*
container
;
HRESULT
hr
;
DWORD
ret
,
ret_size
;
HANDLE
hfile
;
WCHAR
file_uri1W
[
MAX_PATH
],
pathW
[
MAX_PATH
];
container
=
NULL
;
control
=
(
IUnknown
*
)
0xdeadbeef
;
hr
=
AtlAxCreateControlEx
(
NULL
,
NULL
,
NULL
,
&
container
,
&
control
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
container
!=
NULL
,
"returned %p
\n
"
,
container
);
ok
(
!
control
,
"returned %p
\n
"
,
control
);
container
=
NULL
;
control
=
(
IUnknown
*
)
0xdeadbeef
;
hwnd
=
create_container_window
();
ok
(
hwnd
!=
NULL
,
"create window failed!
\n
"
);
hr
=
AtlAxCreateControlEx
(
NULL
,
hwnd
,
NULL
,
&
container
,
&
control
,
&
IID_NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
container
!=
NULL
,
"returned %p!
\n
"
,
container
);
ok
(
!
control
,
"returned %p
\n
"
,
control
);
DestroyWindow
(
hwnd
);
container
=
NULL
;
control
=
(
IUnknown
*
)
0xdeadbeef
;
hwnd
=
create_container_window
();
ok
(
hwnd
!=
NULL
,
"create window failed!
\n
"
);
hr
=
AtlAxCreateControlEx
(
emptyW
,
hwnd
,
NULL
,
&
container
,
&
control
,
&
IID_NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
todo_wine
ok
(
container
!=
NULL
,
"returned %p!
\n
"
,
container
);
ok
(
!
control
,
"returned %p
\n
"
,
control
);
DestroyWindow
(
hwnd
);
container
=
(
IUnknown
*
)
0xdeadbeef
;
control
=
(
IUnknown
*
)
0xdeadbeef
;
hwnd
=
create_container_window
();
ok
(
hwnd
!=
NULL
,
"create window failed!
\n
"
);
hr
=
AtlAxCreateControlEx
(
randomW
,
hwnd
,
NULL
,
&
container
,
&
control
,
&
IID_NULL
,
NULL
);
ok
(
hr
==
CO_E_CLASSSTRING
,
"got 0x%08x
\n
"
,
hr
);
ok
(
!
container
,
"returned %p!
\n
"
,
container
);
ok
(
!
control
,
"returned %p
\n
"
,
control
);
DestroyWindow
(
hwnd
);
container
=
NULL
;
control
=
NULL
;
hwnd
=
create_container_window
();
ok
(
hwnd
!=
NULL
,
"create window failed!
\n
"
);
hr
=
AtlAxCreateControlEx
(
progid1W
,
hwnd
,
NULL
,
&
container
,
&
control
,
&
IID_NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
container
!=
NULL
,
"returned %p!
\n
"
,
container
);
ok
(
control
!=
NULL
,
"returned %p
\n
"
,
control
);
DestroyWindow
(
hwnd
);
container
=
NULL
;
control
=
NULL
;
hwnd
=
create_container_window
();
ok
(
hwnd
!=
NULL
,
"create window failed!
\n
"
);
hr
=
AtlAxCreateControlEx
(
clsid1W
,
hwnd
,
NULL
,
&
container
,
&
control
,
&
IID_NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
container
!=
NULL
,
"returned %p!
\n
"
,
container
);
ok
(
control
!=
NULL
,
"returned %p
\n
"
,
control
);
DestroyWindow
(
hwnd
);
container
=
NULL
;
control
=
NULL
;
hwnd
=
create_container_window
();
ok
(
hwnd
!=
NULL
,
"create window failed!
\n
"
);
hr
=
AtlAxCreateControlEx
(
url1W
,
hwnd
,
NULL
,
&
container
,
&
control
,
&
IID_NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
container
!=
NULL
,
"returned %p!
\n
"
,
container
);
ok
(
control
!=
NULL
,
"returned %p
\n
"
,
control
);
DestroyWindow
(
hwnd
);
container
=
NULL
;
control
=
NULL
;
hwnd
=
create_container_window
();
ok
(
hwnd
!=
NULL
,
"create window failed!
\n
"
);
hr
=
AtlAxCreateControlEx
(
mshtml1W
,
hwnd
,
NULL
,
&
container
,
&
control
,
&
IID_NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
container
!=
NULL
,
"returned %p!
\n
"
,
container
);
ok
(
control
!=
NULL
,
"returned %p
\n
"
,
control
);
DestroyWindow
(
hwnd
);
container
=
NULL
;
control
=
NULL
;
hwnd
=
create_container_window
();
ok
(
hwnd
!=
NULL
,
"create window failed!
\n
"
);
hr
=
AtlAxCreateControlEx
(
mshtml2W
,
hwnd
,
NULL
,
&
container
,
&
control
,
&
IID_NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
container
!=
NULL
,
"returned %p!
\n
"
,
container
);
ok
(
control
!=
NULL
,
"returned %p
\n
"
,
control
);
DestroyWindow
(
hwnd
);
container
=
(
IUnknown
*
)
0xdeadbeef
;
control
=
(
IUnknown
*
)
0xdeadbeef
;
hwnd
=
create_container_window
();
ok
(
hwnd
!=
NULL
,
"create window failed!
\n
"
);
hr
=
AtlAxCreateControlEx
(
mshtml3W
,
hwnd
,
NULL
,
&
container
,
&
control
,
&
IID_NULL
,
NULL
);
ok
(
hr
==
CO_E_CLASSSTRING
,
"got 0x%08x
\n
"
,
hr
);
ok
(
!
container
,
"returned %p!
\n
"
,
container
);
ok
(
!
control
,
"returned %p
\n
"
,
control
);
DestroyWindow
(
hwnd
);
ret
=
GetTempPathW
(
MAX_PATH
,
pathW
);
ok
(
ret
,
"GetTempPath failed!
\n
"
);
lstrcatW
(
pathW
,
html_fileW
);
hfile
=
CreateFileW
(
pathW
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_NEW
,
0
,
0
);
ok
(
hfile
!=
INVALID_HANDLE_VALUE
,
"failed to create file
\n
"
);
ret
=
WriteFile
(
hfile
,
html_str
,
sizeof
(
html_str
),
&
ret_size
,
NULL
);
ok
(
ret
,
"WriteFile failed
\n
"
);
CloseHandle
(
hfile
);
/* test C:// scheme */
container
=
NULL
;
control
=
NULL
;
hwnd
=
create_container_window
();
ok
(
hwnd
!=
NULL
,
"create window failed!
\n
"
);
hr
=
AtlAxCreateControlEx
(
pathW
,
hwnd
,
NULL
,
&
container
,
&
control
,
&
IID_NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
container
!=
NULL
,
"returned %p!
\n
"
,
container
);
ok
(
control
!=
NULL
,
"returned %p
\n
"
,
control
);
DestroyWindow
(
hwnd
);
/* test file:// scheme */
lstrcpyW
(
file_uri1W
,
fileW
);
lstrcatW
(
file_uri1W
,
pathW
);
container
=
NULL
;
control
=
NULL
;
hwnd
=
create_container_window
();
ok
(
hwnd
!=
NULL
,
"create window failed!
\n
"
);
hr
=
AtlAxCreateControlEx
(
file_uri1W
,
hwnd
,
NULL
,
&
container
,
&
control
,
&
IID_NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
container
!=
NULL
,
"returned %p!
\n
"
,
container
);
ok
(
control
!=
NULL
,
"returned %p
\n
"
,
control
);
DestroyWindow
(
hwnd
);
/* test file:// scheme on non-existent file. */
ret
=
DeleteFileW
(
pathW
);
ok
(
ret
,
"DeleteFile failed!
\n
"
);
container
=
NULL
;
control
=
NULL
;
hwnd
=
create_container_window
();
ok
(
hwnd
!=
NULL
,
"create window failed!
\n
"
);
hr
=
AtlAxCreateControlEx
(
file_uri1W
,
hwnd
,
NULL
,
&
container
,
&
control
,
&
IID_NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
container
!=
NULL
,
"returned %p!
\n
"
,
container
);
ok
(
control
!=
NULL
,
"returned %p
\n
"
,
control
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
atl
)
START_TEST
(
atl
)
{
{
if
(
!
register_class
())
if
(
!
register_class
())
...
@@ -865,6 +1019,7 @@ START_TEST(atl)
...
@@ -865,6 +1019,7 @@ START_TEST(atl)
test_source_iface
();
test_source_iface
();
test_ax_win
();
test_ax_win
();
test_AtlAxAttachControl
();
test_AtlAxAttachControl
();
test_AtlAxCreateControl
();
CoUninitialize
();
CoUninitialize
();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment