1616 */
1717
1818const utils = require ( './utils' ) ;
19- const { FFOX , HEADLESS } = testOptions ;
19+ const { CHROMIUM , FFOX , MAC , HEADLESS } = testOptions ;
2020
2121describe ( 'BrowserContext({viewport})' , function ( ) {
2222 it ( 'should get the proper default viewport size' , async ( { page, server} ) => {
@@ -27,6 +27,21 @@ describe('BrowserContext({viewport})', function() {
2727 await page . setViewportSize ( { width : 123 , height : 456 } ) ;
2828 await utils . verifyViewport ( page , 123 , 456 ) ;
2929 } ) ;
30+ // TODO: enable in Chromium after http://crrev.com/c/2321409 is landed and rolled.
31+ it . fail ( CHROMIUM && HEADLESS && MAC ) ( 'should return correct outerWidth and outerHeight' , async ( { page} ) => {
32+ const size = await page . evaluate ( ( ) => {
33+ return {
34+ innerWidth : window . innerWidth ,
35+ innerHeight : window . innerHeight ,
36+ outerWidth : window . outerWidth ,
37+ outerHeight : window . outerHeight ,
38+ } ;
39+ } ) ;
40+ expect ( size . innerWidth ) . toBe ( 1280 ) ;
41+ expect ( size . innerHeight ) . toBe ( 720 ) ;
42+ expect ( size . outerWidth >= size . innerWidth ) . toBeTruthy ( ) ;
43+ expect ( size . outerHeight >= size . innerHeight ) . toBeTruthy ( ) ;
44+ } ) ;
3045 it ( 'should emulate device width' , async ( { page, server} ) => {
3146 expect ( page . viewportSize ( ) ) . toEqual ( { width : 1280 , height : 720 } ) ;
3247 await page . setViewportSize ( { width : 200 , height : 200 } ) ;
0 commit comments