2020import static junit .framework .Assert .assertEquals ;
2121import static junit .framework .Assert .assertNotNull ;
2222import static junit .framework .Assert .assertTrue ;
23- import static org .mockito .ArgumentMatchers .any ;
24- import static org .mockito .Mockito .doCallRealMethod ;
25- import static org .mockito .Mockito .never ;
26- import static org .mockito .Mockito .spy ;
27- import static org .mockito .Mockito .times ;
28- import static org .mockito .Mockito .verify ;
2923import static org .robolectric .Shadows .shadowOf ;
3024
3125public class IterableInAppHTMLNotificationTest extends BaseTest {
@@ -146,7 +140,8 @@ public void testResizeValidation_HandlesGracefully() {
146140 public void testApplyWindowGravity_Center () {
147141 Rect padding = new Rect (0 , -1 , 0 , -1 ); // Center padding
148142 IterableInAppFragmentHTMLNotification notification = IterableInAppFragmentHTMLNotification .createInstance (
149- "<html><body>Test</body></html>" , false , uri -> {}, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
143+ "<html><body>Test</body></html>" , false , uri -> {
144+ }, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
150145
151146 // Verify gravity calculation for center padding
152147 assertEquals (Gravity .CENTER_VERTICAL , notification .getVerticalLocation (padding ));
@@ -156,7 +151,8 @@ public void testApplyWindowGravity_Center() {
156151 public void testApplyWindowGravity_Top () {
157152 Rect padding = new Rect (0 , 0 , 0 , -1 ); // Top padding
158153 IterableInAppFragmentHTMLNotification notification = IterableInAppFragmentHTMLNotification .createInstance (
159- "<html><body>Test</body></html>" , false , uri -> {}, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
154+ "<html><body>Test</body></html>" , false , uri -> {
155+ }, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
160156
161157 assertEquals (Gravity .TOP , notification .getVerticalLocation (padding ));
162158 }
@@ -165,7 +161,8 @@ public void testApplyWindowGravity_Top() {
165161 public void testApplyWindowGravity_Bottom () {
166162 Rect padding = new Rect (0 , -1 , 0 , 0 ); // Bottom padding
167163 IterableInAppFragmentHTMLNotification notification = IterableInAppFragmentHTMLNotification .createInstance (
168- "<html><body>Test</body></html>" , false , uri -> {}, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
164+ "<html><body>Test</body></html>" , false , uri -> {
165+ }, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
169166
170167 assertEquals (Gravity .BOTTOM , notification .getVerticalLocation (padding ));
171168 }
@@ -174,8 +171,9 @@ public void testApplyWindowGravity_Bottom() {
174171 public void testApplyWindowGravity_HandlesNullWindow () {
175172 Rect padding = new Rect (0 , 0 , 0 , -1 );
176173 IterableInAppFragmentHTMLNotification notification = IterableInAppFragmentHTMLNotification .createInstance (
177- "<html><body>Test</body></html>" , false , uri -> {}, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
178-
174+ "<html><body>Test</body></html>" , false , uri -> {
175+ }, IterableInAppLocation .IN_APP , "msg1" , 0.0 , padding , false , new IterableInAppMessage .InAppBgColor (null , 0.0f ));
176+
179177 // Test that getVerticalLocation works correctly
180178 assertEquals (Gravity .TOP , notification .getVerticalLocation (padding ));
181179 // applyWindowGravity is private but is called in onStart/onCreateDialog/onCreateView
@@ -235,7 +233,7 @@ public void testLayoutStructure_FullScreenNoRelativeLayoutWrapper() {
235233 assertTrue ("Root view should have children" , rootView .getChildCount () > 0 );
236234 ViewGroup child = (ViewGroup ) rootView .getChildAt (0 );
237235 // WebView is not a ViewGroup, so we check it's not a RelativeLayout
238- assertTrue ("First child should be WebView (not RelativeLayout) for full screen in-apps" ,
236+ assertTrue ("First child should be WebView (not RelativeLayout) for full screen in-apps" ,
239237 !(child instanceof RelativeLayout ));
240238 }
241239
@@ -300,7 +298,7 @@ public void testOrientationChange_PortraitToLandscape() throws Exception {
300298 // The test passes if no exceptions are thrown and the resize was triggered
301299 // We verify indirectly by ensuring the notification still exists and is in a valid state
302300 assertNotNull ("Notification should still exist after orientation change" , notification );
303-
301+
304302 // The resize should have been triggered (1500ms delay + 200ms debounce)
305303 // If runResizeScript wasn't called, we would have seen validation errors or exceptions
306304 // The fact that we get here without exceptions means the orientation change handling worked
@@ -326,23 +324,23 @@ public void testRoundToNearest90Degrees_StandardOrientations() {
326324 public void testRoundToNearest90Degrees_BoundaryValues () {
327325 // Values that round down to 0 (0-44)
328326 assertEquals (0 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (44 ));
329-
327+
330328 // Values that round up to 90 (45-134)
331329 assertEquals (90 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (45 ));
332330 assertEquals (90 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (89 ));
333331 assertEquals (90 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (90 ));
334332 assertEquals (90 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (134 ));
335-
333+
336334 // Values that round up to 180 (135-224)
337335 assertEquals (180 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (135 ));
338336 assertEquals (180 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (180 ));
339337 assertEquals (180 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (224 ));
340-
338+
341339 // Values that round up to 270 (225-314)
342340 assertEquals (270 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (225 ));
343341 assertEquals (270 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (270 ));
344342 assertEquals (270 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (314 ));
345-
343+
346344 // Values that round up to 360 (315-359)
347345 assertEquals (360 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (315 ));
348346 assertEquals (360 , IterableInAppFragmentHTMLNotification .roundToNearest90Degrees (359 ));
0 commit comments