winmm/tests: Add notify flag tests for MPEGVideo driver.

This commit is contained in:
Akihiro Sagawa 2015-03-18 00:04:57 +09:00 committed by Alexandre Julliard
parent 12d057c8e7
commit e252489a98

View file

@ -1347,6 +1347,54 @@ static void test_playWaveTypeMpegvideo(void)
ok(!err,"mci close returned %s\n", dbg_mcierr(err));
}
static void test_asyncWaveTypeMpegvideo(HWND hwnd)
{
MCIDEVICEID wDeviceID;
int err;
char buf[1024];
memset(buf, 0, sizeof(buf));
err = mciSendStringA("open tempfile.wav alias mysound notify type mpegvideo", buf, sizeof(buf), hwnd);
ok(err==ok_saved,"mci open tempfile.wav returned %s\n", dbg_mcierr(err));
if(err) {
skip("Cannot open tempfile.wav for playing (%s), skipping\n", dbg_mcierr(err));
return;
}
ok(!strcmp(buf,"1"), "mci open deviceId: %s, expected 1\n", buf);
wDeviceID = atoi(buf);
ok(wDeviceID,"mci open DeviceID: %d\n", wDeviceID);
test_notification(hwnd,"open alias notify",MCI_NOTIFY_SUCCESSFUL);
err = mciSendStringA("play mysound notify", NULL, 0, hwnd);
ok(!err,"mci play returned %s\n", dbg_mcierr(err));
Sleep(500); /* milliseconds */
err = mciSendStringA("pause mysound wait", NULL, 0, hwnd);
ok(!err,"mci pause wait returned %s\n", dbg_mcierr(err));
err = mciSendStringA("status mysound mode notify", buf, sizeof(buf), hwnd);
ok(!err,"mci status mode returned %s\n", dbg_mcierr(err));
if(!err) ok(!strcmp(buf,"paused"), "mci status mode: %s\n", buf);
todo_wine test_notification(hwnd,"play (superseded)",MCI_NOTIFY_SUPERSEDED);
test_notification(hwnd,"status",MCI_NOTIFY_SUCCESSFUL);
err = mciSendStringA("seek mysound to start wait", NULL, 0, NULL);
ok(!err,"mci seek to start wait returned %s\n", dbg_mcierr(err));
err = mciSendStringA("set mysound time format milliseconds", NULL, 0, NULL);
ok(!err,"mci time format milliseconds returned %s\n", dbg_mcierr(err));
err = mciSendStringA("play mysound to 1500 notify", NULL, 0, hwnd);
ok(!err,"mci play returned %s\n", dbg_mcierr(err));
Sleep(200);
todo_wine test_notification(hwnd,"play",0);
err = mciSendStringA("close mysound wait", NULL, 0, NULL);
ok(!err,"mci close wait returned %s\n", dbg_mcierr(err));
todo_wine test_notification(hwnd,"play (aborted by close)",MCI_NOTIFY_ABORTED);
}
START_TEST(mci)
{
char curdir[MAX_PATH], tmpdir[MAX_PATH];
@ -1367,6 +1415,7 @@ START_TEST(mci)
test_asyncWAVE(hwnd);
test_AutoOpenWAVE(hwnd);
test_playWaveTypeMpegvideo();
test_asyncWaveTypeMpegvideo(hwnd);
}else
skip("No output devices available, skipping all output tests\n");
/* Win9X hangs when exiting with something still open. */