Module: wine Branch: master Commit: e252489a982ad6c7cd2058283bae0e128db3dc5a URL: http://source.winehq.org/git/wine.git/?a=commit;h=e252489a982ad6c7cd2058283b...
Author: Akihiro Sagawa sagawa.aki@gmail.com Date: Wed Mar 18 00:04:57 2015 +0900
winmm/tests: Add notify flag tests for MPEGVideo driver.
---
dlls/winmm/tests/mci.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+)
diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index ab0c611..423fceb 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -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. */