Home | History | Annotate | Download | only in shadows
      1 package org.robolectric.shadows;
      2 
      3 import static org.assertj.core.api.Assertions.assertThat;
      4 
      5 import android.app.Activity;
      6 import android.view.WindowManagerGlobal;
      7 import org.junit.Test;
      8 import org.junit.runner.RunWith;
      9 import org.junit.runners.JUnit4;
     10 import org.robolectric.Robolectric;
     11 import org.robolectric.android.FailureListener;
     12 import org.robolectric.annotation.Config;
     13 
     14 @RunWith(JUnit4.class)
     15 public class ShadowWindowManagerGlobalUnitTest {
     16   @Test
     17   public void shouldReset() throws Exception {
     18     assertThat(FailureListener.runTests(DummyTest.class)).isEmpty();
     19   }
     20 
     21   @Config(sdk = 23)
     22   public static class DummyTest {
     23     @Test
     24     public void first() throws Exception {
     25       assertThat(WindowManagerGlobal.getInstance().getViewRootNames()).isEmpty();
     26       Robolectric.setupActivity(Activity.class);
     27     }
     28 
     29     @Test
     30     public void second() throws Exception {
     31       assertThat(WindowManagerGlobal.getInstance().getViewRootNames()).isEmpty();
     32       Robolectric.setupActivity(Activity.class);
     33     }
     34   }
     35 
     36 }
     37