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
5b0b78b6
Commit
5b0b78b6
authored
Feb 18, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Add more tests for media events.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f9c43fc9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
1 deletion
+85
-1
filtergraph.c
dlls/quartz/tests/filtergraph.c
+85
-1
No files found.
dlls/quartz/tests/filtergraph.c
View file @
5b0b78b6
...
...
@@ -5156,12 +5156,12 @@ static void test_set_notify_flags(void)
IMediaEventEx
*
media_event
;
struct
testfilter
filter
;
LONG_PTR
param1
,
param2
;
LONG
code
,
flags
;
HANDLE
event
;
HWND
window
;
BSTR
status
;
HRESULT
hr
;
ULONG
ref
;
LONG
code
;
MSG
msg
;
window
=
CreateWindowA
(
"static"
,
NULL
,
WS_OVERLAPPEDWINDOW
,
...
...
@@ -5196,9 +5196,25 @@ static void test_set_notify_flags(void)
while
(
PeekMessageA
(
&
msg
,
window
,
WM_USER
,
WM_USER
,
PM_REMOVE
));
hr
=
IMediaEventEx_SetNotifyFlags
(
media_event
,
2
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaEventEx_GetNotifyFlags
(
media_event
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
flags
=
0xdeadbeef
;
hr
=
IMediaEventEx_GetNotifyFlags
(
media_event
,
&
flags
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
flags
,
"Got flags %#x
\n
"
,
flags
);
hr
=
IMediaEventEx_SetNotifyFlags
(
media_event
,
AM_MEDIAEVENT_NONOTIFY
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
flags
=
0xdeadbeef
;
hr
=
IMediaEventEx_GetNotifyFlags
(
media_event
,
&
flags
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
flags
==
AM_MEDIAEVENT_NONOTIFY
,
"Got flags %#x
\n
"
,
flags
);
todo_wine
ok
(
WaitForSingleObject
(
event
,
0
)
==
WAIT_TIMEOUT
,
"Event should not be signaled.
\n
"
);
hr
=
IMediaEventEx_GetEvent
(
media_event
,
&
code
,
&
param1
,
&
param2
,
50
);
...
...
@@ -5249,6 +5265,11 @@ static void test_set_notify_flags(void)
hr
=
IMediaEventEx_SetNotifyFlags
(
media_event
,
0
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
flags
=
0xdeadbeef
;
hr
=
IMediaEventEx_GetNotifyFlags
(
media_event
,
&
flags
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
flags
,
"Got flags %#x
\n
"
,
flags
);
hr
=
IMediaControl_Stop
(
media_control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_Run
(
media_control
);
...
...
@@ -5295,6 +5316,8 @@ static void check_events_(unsigned int line, IMediaEventEx *media_event,
++
ec_complete_count
;
if
(
code
==
EC_STATUS
)
++
ec_status_count
;
hr
=
IMediaEventEx_FreeEventParams
(
media_event
,
code
,
param1
,
param2
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
}
ok
(
hr
==
E_ABORT
,
"Got hr %#x.
\n
"
,
hr
);
todo_wine_if
(
todo
)
ok_
(
__FILE__
,
line
)(
ec_complete_count
==
expected_ec_complete_count
,
...
...
@@ -5336,9 +5359,51 @@ static void test_events(void)
hr
=
IMediaEventEx_GetEventHandle
(
media_event
,
(
OAEVENT
*
)
&
event
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
code
=
0xdeadbeef
;
param1
=
0xdeadbeef
;
param2
=
0xdeadbeef
;
hr
=
IMediaEventEx_GetEvent
(
media_event
,
&
code
,
&
param1
,
&
param2
,
0
);
ok
(
hr
==
E_ABORT
,
"Got hr %#x.
\n
"
,
hr
);
ok
(
!
code
,
"Got code %#x.
\n
"
,
code
);
todo_wine
ok
(
!
param1
,
"Got param1 %#Ix.
\n
"
,
param1
);
todo_wine
ok
(
!
param2
,
"Got param2 %#Ix.
\n
"
,
param2
);
/* EC_COMPLETE is ignored while in stopped or paused state. */
hr
=
IMediaEventSink_Notify
(
media_event_sink
,
EC_STATUS
,
(
LONG_PTR
)
status
,
(
LONG_PTR
)
status
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaEventSink_Notify
(
media_event_sink
,
EC_COMPLETE
,
S_OK
,
(
LONG_PTR
)
&
filter
.
IBaseFilter_iface
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaEventSink_Notify
(
media_event_sink
,
EC_STATUS
,
(
LONG_PTR
)
status
,
(
LONG_PTR
)
status
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
check_events
(
media_event
,
0
,
2
,
FALSE
);
hr
=
IMediaControl_Pause
(
media_control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaEventSink_Notify
(
media_event_sink
,
EC_STATUS
,
(
LONG_PTR
)
status
,
(
LONG_PTR
)
status
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaEventSink_Notify
(
media_event_sink
,
EC_COMPLETE
,
S_OK
,
(
LONG_PTR
)
&
filter
.
IBaseFilter_iface
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaEventSink_Notify
(
media_event_sink
,
EC_STATUS
,
(
LONG_PTR
)
status
,
(
LONG_PTR
)
status
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
check_events
(
media_event
,
0
,
2
,
FALSE
);
hr
=
IMediaControl_Run
(
media_control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
check_events
(
media_event
,
0
,
0
,
FALSE
);
/* Pausing and then running the graph clears pending EC_COMPLETE events.
* This remains true even with default handling canceled. */
hr
=
IMediaEventEx_CancelDefaultHandling
(
media_event
,
EC_COMPLETE
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaEventSink_Notify
(
media_event_sink
,
EC_STATUS
,
(
LONG_PTR
)
status
,
(
LONG_PTR
)
status
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaEventSink_Notify
(
media_event_sink
,
EC_COMPLETE
,
S_OK
,
...
...
@@ -5385,6 +5450,25 @@ static void test_events(void)
check_events
(
media_event
,
1
,
2
,
FALSE
);
hr
=
IMediaControl_Run
(
media_control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaEventSink_Notify
(
media_event_sink
,
EC_STATUS
,
(
LONG_PTR
)
status
,
(
LONG_PTR
)
status
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaEventSink_Notify
(
media_event_sink
,
EC_COMPLETE
,
S_OK
,
(
LONG_PTR
)
&
filter
.
IBaseFilter_iface
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaEventSink_Notify
(
media_event_sink
,
EC_STATUS
,
(
LONG_PTR
)
status
,
(
LONG_PTR
)
status
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_Pause
(
media_control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaControl_Run
(
media_control
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
check_events
(
media_event
,
0
,
2
,
TRUE
);
/* GetEvent() resets the event object if there are no events available. */
SetEvent
(
event
);
hr
=
IMediaEventEx_GetEvent
(
media_event
,
&
code
,
&
param1
,
&
param2
,
50
);
...
...
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