Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix SDK version check for onPageFinished() call. It should be availab…
…le for all SDK versions instead. See https://developer.android.com/reference/android/webkit/WebViewClient#onPageFinished(android.webkit.WebView,%20java.lang.String) PiperOrigin-RevId: 410475180
- Loading branch information
1 parent
326991f
commit 55b2faf
Showing
21 changed files
with
256 additions
and
90 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
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
34 changes: 34 additions & 0 deletions
34
...tric/src/test/java/org/robolectric/android/controller/ActivityControllerRecreateTest.java
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,34 @@ | ||
package org.robolectric.android.controller; | ||
|
||
import android.app.Activity; | ||
import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
import java.util.concurrent.atomic.AtomicReference; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.robolectric.Robolectric; | ||
|
||
/** | ||
* This test captures an issue where {@link ActivityController#recreate()} would throw an {@link | ||
* UnsupportedOperationException} if an Activity from a previous test was recreated. | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ActivityControllerRecreateTest { | ||
private static final AtomicReference<ActivityController<Activity>> createdActivity = | ||
new AtomicReference<>(); | ||
|
||
@Before | ||
public void setUp() { | ||
createdActivity.compareAndSet(null, Robolectric.buildActivity(Activity.class).create()); | ||
} | ||
|
||
@Test | ||
public void failsTryingToRecreateActivityFromOtherTest1() { | ||
createdActivity.get().recreate(); | ||
} | ||
|
||
@Test | ||
public void failsTryingToRecreateActivityFromOtherTest2() { | ||
createdActivity.get().recreate(); | ||
} | ||
} |
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
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.