@@ -18,6 +18,9 @@ describe('MdRipple', () => {
1818 let originalBodyMargin : string ;
1919 let viewportRuler : ViewportRuler ;
2020
21+ const startingWindowWidth = window . innerWidth ;
22+ const startingWindowHeight = window . innerHeight ;
23+
2124 beforeEach ( ( ) => {
2225 TestBed . configureTestingModule ( {
2326 imports : [ MdRippleModule ] ,
@@ -57,6 +60,15 @@ describe('MdRipple', () => {
5760 } ) ;
5861
5962 it ( 'sizes ripple to cover element' , ( ) => {
63+ // In the iOS simulator (BrowserStack & SauceLabs), adding the content to the
64+ // body causes karma's iframe for the test to stretch to fit that content once we attempt to
65+ // scroll the page. Setting width / height / maxWidth / maxHeight on the iframe does not
66+ // successfully constrain its size. As such, skip assertions in environments where the
67+ // window size has changed since the start of the test.
68+ if ( window . innerWidth > startingWindowWidth || window . innerHeight > startingWindowHeight ) {
69+ return ;
70+ }
71+
6072 let elementRect = rippleTarget . getBoundingClientRect ( ) ;
6173
6274 // Dispatch a ripple at the following relative coordinates (X: 50| Y: 75)
@@ -192,9 +204,6 @@ describe('MdRipple', () => {
192204 } ) ;
193205
194206 describe ( 'when page is scrolled' , ( ) => {
195- const startingWindowWidth = window . innerWidth ;
196- const startingWindowHeight = window . innerHeight ;
197-
198207 let veryLargeElement : HTMLDivElement = document . createElement ( 'div' ) ;
199208 let pageScrollTop = 500 ;
200209 let pageScrollLeft = 500 ;
0 commit comments