mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 04:46:08 +00:00
Add standard session picture in picture (#156)
* Add session picture in picture controls * Simplify PiP to standard Android controls * Remove PiP testing document
This commit is contained in:
1 parent
2224c96498
commit
59c74e586d
14 files changed
+368
-11
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Test
|
||||
|
||||
class PipPolicyTest {
|
||||
@Test fun automaticEntryNeverOpensStartingFailedOrSuspendedSessions() {
|
||||
for (phase in SessionPhase.entries) {
|
||||
assertEquals(phase == SessionPhase.READY,
|
||||
PipPolicy.eligible(true, true, phase, phase == SessionPhase.SUSPENDED, true))
|
||||
}
|
||||
assertFalse(PipPolicy.eligible(true, false, SessionPhase.READY, false, true))
|
||||
assertFalse(PipPolicy.eligible(false, true, SessionPhase.READY, false, true))
|
||||
}
|
||||
|
||||
@Test fun manualEntryAllowsAVisibleSuspendedPicture() {
|
||||
assertTrue(PipPolicy.eligible(true, true, SessionPhase.SUSPENDED, true, false))
|
||||
assertFalse(PipPolicy.eligible(true, false, SessionPhase.SUSPENDED, true, false))
|
||||
}
|
||||
|
||||
@Test fun aspectRatiosStayWithinAndroidLimitsWithoutChangingNormalContent() {
|
||||
assertEquals(1920 to 1080, PipPolicy.aspect(1920, 1080))
|
||||
assertEquals(239 to 100, PipPolicy.aspect(5760, 1080))
|
||||
assertEquals(100 to 239, PipPolicy.aspect(1080, 5760))
|
||||
assertEquals(16 to 9, PipPolicy.aspect(0, 0))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user