11/**
2- * Copyright 2020 Microsoft Corporation. All rights reserved .
2+ * Copyright (c) Microsoft Corporation.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
66 * You may obtain a copy of the License at
77 *
8- * http://www.apache.org/licenses/LICENSE-2.0
8+ * http://www.apache.org/licenses/LICENSE-2.0
99 *
1010 * Unless required by applicable law or agreed to in writing, software
1111 * distributed under the License is distributed on an "AS IS" BASIS,
1515 */
1616
1717import { androidTest as test , expect } from './androidTest' ;
18+ import { rafraf } from '../config/utils' ;
1819
1920test ( 'androidInput.swipe should start from the given point' , async ( { androidDevice } ) => {
2021 const context = await androidDevice . launchBrowser ( ) ;
@@ -24,7 +25,7 @@ test('androidInput.swipe should start from the given point', async ({ androidDev
2425 // pipeline, independent of the CDP connection used by setContent() above. Wait for
2526 // the new content to actually be composited and presented on the device screen,
2627 // otherwise the swipe can land on the previous (blank) frame and never scroll anything.
27- await page . evaluate ( ( ) => new Promise ( resolve => requestAnimationFrame ( ( ) => requestAnimationFrame ( resolve ) ) ) ) ;
28+ await rafraf ( page ) ;
2829 await androidDevice . input . swipe ( { x : 250 , y : 1500 } , [ { x : 250 , y : 500 } ] , 30 ) ;
2930 await expect . poll ( ( ) => page . evaluate ( ( ) => window . scrollY ) ) . toBeGreaterThan ( 0 ) ;
3031 await context . close ( ) ;
0 commit comments