-
Notifications
You must be signed in to change notification settings - Fork 834
CATROID-1660 Migrate to targetSdkVersion 36 #5236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
harissabil
wants to merge
11
commits into
Catrobat:develop
Choose a base branch
from
harissabil:CATROID-1660
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
749b21e
CATROID-1660 Increase compileSdk and targetSdkVersion to 36
harissabil bb5b6f9
CATROID-1660 Migrate back handling to the system back APIs
harissabil fbca1d7
CATROID-1660 Add tests for the migrated back handling
harissabil 4c1854d
CATROID-1660 Add monochrome layers to the launcher icons
harissabil 8f9385b
CATROID-1660 Opt out Android 16 large screen resizability changes
harissabil fcec7c8
Run the emulated tests on Android 16
harissabil 824b384
Fix missing newline at end of file
harissabil 10c0da5
CATROID-1660 Handle cancellation and failures in the project sync wor…
harissabil 70b7667
CATROID-1660 Add tests for the project sync workers
harissabil 80fb6f3
Refactor network response handling to use awaitSuccessfulResponse uti…
harissabil d6ef93b
Merge branch 'refs/heads/develop' into CATROID-1660
harissabil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
138 changes: 138 additions & 0 deletions
138
...androidTest/java/org/catrobat/catroid/uiespresso/ui/activity/SoundRecorderActivityTest.kt
This file contains hidden or 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,138 @@ | ||
| /* | ||
| * Catroid: An on-device visual programming system for Android devices | ||
| * Copyright (C) 2010-2026 The Catrobat Team | ||
| * (<http://developer.catrobat.org/credits>) | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Affero General Public License as | ||
| * published by the Free Software Foundation, either version 3 of the | ||
| * License, or (at your option) any later version. | ||
| * | ||
| * An additional term exception under section 7 of the GNU Affero | ||
| * General Public License, version 3, is available at | ||
| * http://developer.catrobat.org/license_additional_term | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Affero General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Affero General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| package org.catrobat.catroid.uiespresso.ui.activity | ||
|
|
||
| import android.Manifest | ||
| import android.app.Activity | ||
| import android.content.Intent | ||
| import androidx.test.espresso.Espresso.onView | ||
| import androidx.test.espresso.Espresso.pressBackUnconditionally | ||
| import androidx.test.espresso.action.ViewActions.click | ||
| import androidx.test.espresso.assertion.ViewAssertions.matches | ||
| import androidx.test.espresso.matcher.ViewMatchers.isDisplayed | ||
| import androidx.test.espresso.matcher.ViewMatchers.withContentDescription | ||
| import androidx.test.espresso.matcher.ViewMatchers.withId | ||
| import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
| import androidx.test.platform.app.InstrumentationRegistry | ||
| import androidx.test.rule.GrantPermissionRule | ||
| import org.catrobat.catroid.R | ||
| import org.catrobat.catroid.soundrecorder.SoundRecorderActivity | ||
| import org.catrobat.catroid.testsuites.annotations.Cat.AppUi | ||
| import org.catrobat.catroid.testsuites.annotations.Level.Smoke | ||
| import org.catrobat.catroid.uiespresso.util.rules.BaseActivityTestRule | ||
| import org.junit.Assert.assertEquals | ||
| import org.junit.Assert.assertNotNull | ||
| import org.junit.Assert.assertTrue | ||
| import org.junit.Before | ||
| import org.junit.Rule | ||
| import org.junit.Test | ||
| import org.junit.experimental.categories.Category | ||
| import org.junit.runner.RunWith | ||
|
|
||
| @RunWith(AndroidJUnit4::class) | ||
| class SoundRecorderActivityTest { | ||
|
|
||
| @get:Rule | ||
| var baseActivityTestRule = BaseActivityTestRule( | ||
| SoundRecorderActivity::class.java, false, false | ||
| ) | ||
|
|
||
| @get:Rule | ||
| var runtimePermissionRule: GrantPermissionRule = | ||
| GrantPermissionRule.grant(Manifest.permission.RECORD_AUDIO) | ||
|
|
||
| @Before | ||
| fun setUp() { | ||
| baseActivityTestRule.launchActivity(null) | ||
| } | ||
|
|
||
| @Category(AppUi::class, Smoke::class) | ||
| @Test | ||
| fun recordButtonStartsRecordingTest() { | ||
| onView(withId(R.id.soundrecorder_record_button)) | ||
| .perform(click()) | ||
|
|
||
| onView(withId(R.id.soundrecorder_chronometer_time_recorded)) | ||
| .check(matches(isDisplayed())) | ||
| } | ||
|
|
||
| @Category(AppUi::class, Smoke::class) | ||
| @Test | ||
| fun recordThenStopReturnsRecordingTest() { | ||
| onView(withId(R.id.soundrecorder_record_button)) | ||
| .perform(click()) | ||
| onView(withId(R.id.soundrecorder_record_button)) | ||
| .perform(click()) | ||
|
|
||
| assertTrue(baseActivityTestRule.activity.isFinishing) | ||
| assertRecordingReturned() | ||
| } | ||
|
|
||
| @Category(AppUi::class, Smoke::class) | ||
| @Test | ||
| fun backWhileIdleFinishesWithoutRecordingTest() { | ||
| val activity = baseActivityTestRule.activity | ||
|
|
||
| pressBackUnconditionally() | ||
| InstrumentationRegistry.getInstrumentation().waitForIdleSync() | ||
|
|
||
| assertTrue(activity.isFinishing) | ||
| assertEquals(Activity.RESULT_CANCELED, baseActivityTestRule.activityResult.resultCode) | ||
| } | ||
|
|
||
| @Category(AppUi::class, Smoke::class) | ||
| @Test | ||
| fun backWhileRecordingReturnsRecordingTest() { | ||
| val activity = baseActivityTestRule.activity | ||
|
|
||
| onView(withId(R.id.soundrecorder_record_button)) | ||
| .perform(click()) | ||
|
|
||
| pressBackUnconditionally() | ||
| InstrumentationRegistry.getInstrumentation().waitForIdleSync() | ||
|
|
||
| assertTrue(activity.isFinishing) | ||
| assertRecordingReturned() | ||
| } | ||
|
|
||
| @Category(AppUi::class, Smoke::class) | ||
| @Test | ||
| fun upButtonWhileRecordingReturnsRecordingTest() { | ||
| onView(withId(R.id.soundrecorder_record_button)) | ||
| .perform(click()) | ||
|
|
||
| onView(withContentDescription(R.string.abc_action_bar_up_description)) | ||
| .perform(click()) | ||
|
|
||
| assertTrue(baseActivityTestRule.activity.isFinishing) | ||
| assertRecordingReturned() | ||
| } | ||
|
|
||
| private fun assertRecordingReturned() { | ||
| assertEquals(Activity.RESULT_OK, baseActivityTestRule.activityResult.resultCode) | ||
| val resultIntent = baseActivityTestRule.activityResult.resultData | ||
| assertEquals(Intent.ACTION_PICK, resultIntent.action) | ||
| assertNotNull(resultIntent.data) | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.