-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
184 changed files
with
41,796 additions
and
21,641 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
81 changes: 81 additions & 0 deletions
81
benchmark/src/main/kotlin/io/getstream/video/android/benchmark/DogfoodingScenarios.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,81 @@ | ||
/* | ||
* Copyright (c) 2014-2023 Stream.io Inc. All rights reserved. | ||
* | ||
* Licensed under the Stream License; | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://github.com/GetStream/stream-video-android/blob/main/LICENSE | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.getstream.video.android.benchmark | ||
|
||
import androidx.benchmark.macro.MacrobenchmarkScope | ||
import androidx.test.uiautomator.By | ||
import androidx.test.uiautomator.UiDevice | ||
import androidx.test.uiautomator.Until | ||
|
||
internal fun MacrobenchmarkScope.dogfoodingScenarios() { | ||
// ------------- | ||
// Authenticate | ||
// ------------- | ||
device.authenticateAndNavigateToHome() | ||
|
||
// ------------- | ||
// JoinCall | ||
// ------------- | ||
device.navigateFromJoinCallToLobby() | ||
|
||
// ------------- | ||
// Lobby | ||
// ------------- | ||
device.navigateFromLobbyToCall() | ||
|
||
// ------------- | ||
// Call | ||
// ------------- | ||
device.testCall() | ||
} | ||
|
||
internal fun UiDevice.authenticateAndNavigateToHome() { | ||
wait(Until.hasObject(By.res("authenticate")), 5_000) | ||
|
||
// Click the Authenticate button and login. | ||
waitForObject(By.res("authenticate"))?.click() | ||
|
||
waitForIdle() | ||
} | ||
|
||
internal fun UiDevice.navigateFromJoinCallToLobby() { | ||
wait(Until.hasObject(By.res("start_new_call")), 5_000) | ||
|
||
// wait for the Join Call button and navigate to the lobby screen by clicking. | ||
waitForObject(By.res("start_new_call"))?.click() | ||
|
||
waitForIdle() | ||
} | ||
|
||
internal fun UiDevice.navigateFromLobbyToCall() { | ||
waitForObject(By.text(getPermissionText()), 5_000)?.click() | ||
waitForObject(By.text(getPermissionText()), 5_000)?.click() | ||
|
||
wait(Until.hasObject(By.res("call_lobby")), 15_000) | ||
wait(Until.hasObject(By.res("participant_video_renderer")), 15_000) | ||
|
||
// wait for the Start Call button and navigate to the call screen by clicking. | ||
waitForObject(By.res("start_call"), 15_000)?.click() | ||
|
||
waitForIdle() | ||
} | ||
|
||
internal fun UiDevice.testCall() { | ||
wait(Until.hasObject(By.res("call_content")), 5_000) | ||
wait(Until.hasObject(By.res("video_renderer")), 5_000) | ||
waitForIdle() | ||
} |
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
38 changes: 38 additions & 0 deletions
38
benchmark/src/main/kotlin/io/getstream/video/android/benchmark/Utils.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,38 @@ | ||
/* | ||
* Copyright (c) 2014-2023 Stream.io Inc. All rights reserved. | ||
* | ||
* Licensed under the Stream License; | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://github.com/GetStream/stream-video-android/blob/main/LICENSE | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package io.getstream.video.android.benchmark | ||
|
||
import android.os.Build | ||
import androidx.test.uiautomator.BySelector | ||
import androidx.test.uiautomator.UiDevice | ||
import androidx.test.uiautomator.UiObject2 | ||
import androidx.test.uiautomator.Until | ||
|
||
internal fun UiDevice.waitForObject(selector: BySelector, timeout: Long = 5_000): UiObject2? { | ||
if (wait(Until.hasObject(selector), timeout)) { | ||
return findObject(selector) | ||
} | ||
return null | ||
} | ||
|
||
internal fun getPermissionText(): String { | ||
return when { | ||
Build.VERSION.SDK_INT <= 28 -> "ALLOW" | ||
Build.VERSION.SDK_INT == 29 -> "Allow only while using the app" | ||
else -> "While using the app" | ||
} | ||
} |
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
Oops, something went wrong.