-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from hotwired/bridge-delegate-lifecycle
Fix `BridgeDelegate` lifecycle issues
- Loading branch information
Showing
7 changed files
with
74 additions
and
37 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
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
4 changes: 0 additions & 4 deletions
4
strada/src/main/kotlin/dev/hotwire/strada/BridgeDestination.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 |
---|---|---|
@@ -1,9 +1,5 @@ | ||
package dev.hotwire.strada | ||
|
||
import androidx.lifecycle.LifecycleOwner | ||
|
||
interface BridgeDestination { | ||
fun bridgeDestinationLocation(): String | ||
fun bridgeDestinationLifecycleOwner(): LifecycleOwner | ||
fun bridgeWebViewIsReady(): Boolean | ||
} |
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
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
21 changes: 21 additions & 0 deletions
21
strada/src/test/kotlin/dev/hotwire/strada/CoroutinesTestRule.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,21 @@ | ||
package dev.hotwire.strada | ||
|
||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.test.* | ||
import org.junit.rules.TestWatcher | ||
import org.junit.runner.Description | ||
|
||
class CoroutinesTestRule( | ||
private val testDispatcher: TestDispatcher = UnconfinedTestDispatcher(TestCoroutineScheduler()) | ||
) : TestWatcher() { | ||
|
||
override fun starting(description: Description) { | ||
super.starting(description) | ||
Dispatchers.setMain(testDispatcher) | ||
} | ||
|
||
override fun finished(description: Description) { | ||
super.finished(description) | ||
Dispatchers.resetMain() | ||
} | ||
} |