| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package androidx.window.extensions; |
| 18 |
|
| 19 |
import static com.google.common.truth.Truth.assertThat; |
| 20 |
|
| 21 |
import android.platform.test.annotations.Presubmit; |
| 22 |
|
| 23 |
import androidx.test.ext.junit.runners.AndroidJUnit4; |
| 24 |
import androidx.test.filters.SmallTest; |
| 25 |
import androidx.window.extensions.embedding.SplitAttributes; |
| 26 |
|
| 27 |
import org.junit.Before; |
| 28 |
import org.junit.Test; |
| 29 |
import org.junit.runner.RunWith; |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
@Presubmit |
| 38 |
@SmallTest |
| 39 |
@RunWith(AndroidJUnit4.class) |
| 40 |
public class WindowExtensionsTest { |
| 41 |
private WindowExtensions mExtensions; |
| 42 |
|
| 43 |
@Before |
| 44 |
public void setUp() { |
| 45 |
mExtensions = WindowExtensionsProvider.getWindowExtensions(); |
| 46 |
} |
| 47 |
|
| 48 |
@Test |
| 49 |
public void testGetWindowLayoutComponent() { |
| 50 |
assertThat(mExtensions.getWindowLayoutComponent()).isNotNull(); |
| 51 |
} |
| 52 |
|
| 53 |
@Test |
| 54 |
public void testGetActivityEmbeddingComponent() { |
| 55 |
assertThat(mExtensions.getActivityEmbeddingComponent()).isNotNull(); |
| 56 |
} |
| 57 |
|
| 58 |
@Test |
| 59 |
public void testSplitAttributes_default() { |
| 60 |
|
| 61 |
final SplitAttributes splitAttributes = new SplitAttributes.Builder().build(); |
| 62 |
assertThat(splitAttributes.getLayoutDirection()) |
| 63 |
.isEqualTo(SplitAttributes.LayoutDirection.LOCALE); |
| 64 |
assertThat(splitAttributes.getSplitType()) |
| 65 |
.isEqualTo(new SplitAttributes.SplitType.RatioSplitType(0.5f)); |
| 66 |
assertThat(splitAttributes.getAnimationBackgroundColor()).isEqualTo(0); |
| 67 |
} |
| 68 |
} |