From: Akihiro Sagawa Subject: [4/4] winmm/tests: Add notify tests for MPEGVideo device. Message-Id: <20150310005007.DC01.375B48EC@gmail.com> Date: Tue, 10 Mar 2015 00:50:59 +0900 --- dlls/winmm/tests/mci.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index ab0c611..ba37793 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -1347,6 +1347,49 @@ 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); + test_notification(hwnd,"play",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("play mysound to 1000 notify", NULL, 0, hwnd); + ok(!err,"mci play returned %s\n", dbg_mcierr(err)); + + err = mciSendStringA("close mysound wait", NULL, 0, NULL); + ok(!err,"mci close wait returned %s\n", dbg_mcierr(err)); + test_notification(hwnd,"play (aborted by close)",MCI_NOTIFY_ABORTED); +} + START_TEST(mci) { char curdir[MAX_PATH], tmpdir[MAX_PATH]; @@ -1367,6 +1410,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. */