-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged PR 191: Release 200924
- Loading branch information
Showing
128 changed files
with
1,065 additions
and
994 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
...roidTest/java/com/microsoft/device/display/samples/companionpane/LayoutOrientationTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. | ||
* | ||
*/ | ||
|
||
package com.microsoft.device.display.samples.companionpane | ||
|
||
import androidx.test.espresso.Espresso.onView | ||
import androidx.test.espresso.assertion.ViewAssertions.matches | ||
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed | ||
import androidx.test.espresso.matcher.ViewMatchers.withId | ||
import androidx.test.filters.LargeTest | ||
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.rule.ActivityTestRule | ||
import androidx.test.uiautomator.UiDevice | ||
import org.junit.After | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4ClassRunner::class) | ||
@LargeTest | ||
class LayoutOrientationTest { | ||
|
||
private val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) | ||
|
||
@get:Rule | ||
val activityRule = ActivityTestRule<MainActivity>(MainActivity::class.java) | ||
|
||
@After | ||
fun resetOrientation() { | ||
device.setOrientationNatural() | ||
device.unfreezeRotation() | ||
} | ||
|
||
@Test | ||
fun shouldFindLayout_whenInSinglePortrait() { | ||
onView(withId(R.id.single_screen_container_id)).check(matches(isDisplayed())) | ||
onView(withId(R.id.single_screen_layout_port)).check(matches(isDisplayed())) | ||
} | ||
|
||
@Test | ||
fun shouldFindLayout_whenInSingleLandscape() { | ||
rotateDevice() | ||
|
||
onView(withId(R.id.single_screen_container_id)).check(matches(isDisplayed())) | ||
onView(withId(R.id.single_screen_layout_land)).check(matches(isDisplayed())) | ||
} | ||
|
||
@Test | ||
fun shouldFindLayouts_whenInDoublePortrait() { | ||
spanApplication() | ||
|
||
onView(withId(R.id.dual_screen_start_container_id)).check(matches(isDisplayed())) | ||
onView(withId(R.id.picture_dual_layout)).check(matches(isDisplayed())) | ||
|
||
onView(withId(R.id.dual_screen_end_container_id)).check(matches(isDisplayed())) | ||
onView(withId(R.id.tools_dual_layout_land)).check(matches(isDisplayed())) | ||
} | ||
|
||
@Test | ||
fun shouldFindLayouts_whenInDoubleLandscape() { | ||
spanApplication() | ||
rotateDevice() | ||
|
||
onView(withId(R.id.dual_screen_start_container_id)).check(matches(isDisplayed())) | ||
onView(withId(R.id.picture_dual_layout)).check(matches(isDisplayed())) | ||
|
||
onView(withId(R.id.dual_screen_end_container_id)).check(matches(isDisplayed())) | ||
onView(withId(R.id.tools_dual_layout_port)).check(matches(isDisplayed())) | ||
} | ||
|
||
@Test | ||
fun shouldFindLayouts_whenSpanningInDoubleLandscape() { | ||
rotateDevice() | ||
spanLandscapeApplication() | ||
|
||
onView(withId(R.id.dual_screen_start_container_id)).check(matches(isDisplayed())) | ||
onView(withId(R.id.picture_dual_layout)).check(matches(isDisplayed())) | ||
|
||
onView(withId(R.id.dual_screen_end_container_id)).check(matches(isDisplayed())) | ||
onView(withId(R.id.tools_dual_layout_port)).check(matches(isDisplayed())) | ||
} | ||
|
||
private fun spanApplication() { | ||
device.swipe(675, 1780, 1350, 900, 400) | ||
} | ||
|
||
private fun spanLandscapeApplication() { | ||
device.swipe(1780, 2100, 1350, 1500, 400) | ||
} | ||
|
||
private fun rotateDevice() { | ||
device.setOrientationLeft() | ||
} | ||
} |
27 changes: 0 additions & 27 deletions
27
...java/com/microsoft/device/display/samples/complementarycontext/ExampleInstrumentedTest.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 0 additions & 70 deletions
70
...e/src/main/java/com/microsoft/device/display/samples/complementarycontext/MainActivity.kt
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...ain/java/com/microsoft/device/display/samples/complementarycontext/adapters/Comparator.kt
This file was deleted.
Oops, something went wrong.
64 changes: 0 additions & 64 deletions
64
...n/java/com/microsoft/device/display/samples/complementarycontext/adapters/NotesAdapter.kt
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
.../java/com/microsoft/device/display/samples/complementarycontext/adapters/SlidesAdapter.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.