@@ -2251,6 +2251,33 @@ static int video_getWindowSurface(void *arg)
2251
2251
return TEST_COMPLETED ;
2252
2252
}
2253
2253
2254
+ /**
2255
+ * Tests SDL_SetWindowInputFocus
2256
+ */
2257
+ static int video_setWindowInputFocus (void * arg )
2258
+ {
2259
+ int result ;
2260
+ SDL_Window * window ;
2261
+
2262
+ SDLTest_AssertPass ("SDL_SetWindowInputFocus is not supported on dummy and SDL2 wayland driver" );
2263
+ if (SDL_strcmp (SDL_GetCurrentVideoDriver (), "dummy" ) == 0 || SDL_strcmp (SDL_GetCurrentVideoDriver (), "wayland" ) == 0 ) {
2264
+ return TEST_SKIPPED ;
2265
+ }
2266
+
2267
+ window = _createVideoSuiteTestWindow ("video_setWindowInputFocus" );
2268
+ if (!window ) {
2269
+ return TEST_ABORTED ;
2270
+ }
2271
+
2272
+ SDLTest_AssertPass ("About to call SDL_SetWindowInputFocus(window)" );
2273
+ result = SDL_SetWindowInputFocus (window );
2274
+ SDLTest_AssertCheck (result == 0 , "Result is %d, expected 0" , result );
2275
+
2276
+ _destroyVideoSuiteTestWindow (window );
2277
+
2278
+ return TEST_COMPLETED ;
2279
+ }
2280
+
2254
2281
/* ================= Test References ================== */
2255
2282
2256
2283
/* Video test cases */
@@ -2338,14 +2365,17 @@ static const SDLTest_TestCaseReference videoTest24 =
2338
2365
static const SDLTest_TestCaseReference videoTest25 = {
2339
2366
(SDLTest_TestCaseFp )video_getWindowSurface , "video_getWindowSurface" , "Checks window surface functionality" , TEST_ENABLED
2340
2367
};
2368
+ static const SDLTest_TestCaseReference videoTest26 = {
2369
+ (SDLTest_TestCaseFp )video_setWindowInputFocus , "video_setWindowInputFocus" , "Checks window input focus" , TEST_ENABLED
2370
+ };
2341
2371
2342
2372
/* Sequence of Video test cases */
2343
2373
static const SDLTest_TestCaseReference * videoTests [] = {
2344
2374
& videoTest1 , & videoTest2 , & videoTest3 , & videoTest4 , & videoTest5 , & videoTest6 ,
2345
2375
& videoTest7 , & videoTest8 , & videoTest9 , & videoTest10 , & videoTest11 , & videoTest12 ,
2346
2376
& videoTest13 , & videoTest14 , & videoTest15 , & videoTest16 , & videoTest17 ,
2347
2377
& videoTest18 , & videoTest19 , & videoTest20 , & videoTest21 , & videoTest22 ,
2348
- & videoTest23 , & videoTest24 , & videoTest25 , NULL
2378
+ & videoTest23 , & videoTest24 , & videoTest25 , & videoTest26 , NULL
2349
2379
};
2350
2380
2351
2381
/* Video test suite (global) */
0 commit comments