Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[react-native] Upgrade to 0.62.2 (#8310)
# Why Let's have latest React Native in the upcoming SDK! # How See the story at https://www.notion.so/expo/React-Native-Upgrade-Diary-947bc0b506a942189fd47ff6e53bf95b. # Test Plan Expo Client runs, versioned SDK38 also runs (after a couple of post-version fixes outlined in the aforementioned doc). `expo-cli` can't handle `client_log` events, but that's something we may want to figure out after merging this PR, I guess.
- Loading branch information
Showing
2,692 changed files
with
46,594 additions
and
30,459 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
96 changes: 96 additions & 0 deletions
96
android/ReactAndroid/src/androidTest/java/com/facebook/react/bridge/ArgumentsTest.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,96 @@ | ||
/* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
package com.facebook.react.bridge; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.os.Parcel; | ||
import android.os.Parcelable; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.test.platform.app.InstrumentationRegistry; | ||
import androidx.test.runner.AndroidJUnit4; | ||
|
||
import com.facebook.soloader.SoLoader; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static com.facebook.react.bridge.Arguments.fromBundle; | ||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNotNull; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
public class ArgumentsTest { | ||
|
||
@Before | ||
public void setUp() { | ||
Context context = InstrumentationRegistry.getInstrumentation().getTargetContext(); | ||
SoLoader.init(context, false); | ||
} | ||
|
||
@Test | ||
public void testFromBundle() { | ||
verifyBundle(createBundle()); | ||
} | ||
|
||
/** | ||
* When passing a bundle via {@link Intent} extras, it gets parceled and unparceled. | ||
* Any array of bundles will return as an array of {@link Parcelable} instead. This test | ||
* verifies that {@link Arguments#fromArray} handles this situation correctly. | ||
*/ | ||
@Test | ||
public void testFromMarshaledBundle() { | ||
verifyBundle(marshalAndUnmarshalBundle(createBundle())); | ||
} | ||
|
||
private void verifyBundle(@NonNull Bundle bundle) { | ||
WritableMap map = fromBundle(bundle); | ||
assertNotNull(map); | ||
|
||
assertEquals(ReadableType.Array, map.getType("children")); | ||
ReadableArray children = map.getArray("children"); | ||
assertNotNull(children); | ||
assertEquals(1, children.size()); | ||
|
||
assertEquals(ReadableType.Map, children.getType(0)); | ||
ReadableMap child = children.getMap(0); | ||
assertNotNull(child); | ||
assertEquals("exampleChild", child.getString("exampleChildKey")); | ||
} | ||
|
||
@NonNull | ||
private Bundle marshalAndUnmarshalBundle(@NonNull Bundle bundle) { | ||
Parcel parcel = null; | ||
try { | ||
parcel = Parcel.obtain(); | ||
bundle.writeToParcel(parcel, 0); | ||
|
||
byte[] bytes = parcel.marshall(); | ||
parcel.unmarshall(bytes, 0, bytes.length); | ||
parcel.setDataPosition(0); | ||
return Bundle.CREATOR.createFromParcel(parcel); | ||
} finally { | ||
if (parcel != null) { | ||
parcel.recycle(); | ||
} | ||
} | ||
} | ||
|
||
@NonNull | ||
private Bundle createBundle() { | ||
Bundle bundle = new Bundle(); | ||
Bundle[] children = new Bundle[1]; | ||
children[0] = new Bundle(); | ||
children[0].putString("exampleChildKey", "exampleChild"); | ||
bundle.putSerializable("children", children); | ||
return bundle; | ||
} | ||
} |
7 changes: 4 additions & 3 deletions
7
...ctAndroid/src/androidTest/java/com/facebook/react/testing/AbstractScrollViewTestCase.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
7 changes: 4 additions & 3 deletions
7
android/ReactAndroid/src/androidTest/java/com/facebook/react/testing/AssertModule.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
9 changes: 5 additions & 4 deletions
9
.../ReactAndroid/src/androidTest/java/com/facebook/react/testing/FabricUIManagerFactory.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
7 changes: 4 additions & 3 deletions
7
...d/ReactAndroid/src/androidTest/java/com/facebook/react/testing/FakeAsyncLocalStorage.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
7 changes: 4 additions & 3 deletions
7
...oid/ReactAndroid/src/androidTest/java/com/facebook/react/testing/FakeWebSocketModule.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
7 changes: 4 additions & 3 deletions
7
...ctAndroid/src/androidTest/java/com/facebook/react/testing/InstanceSpecForTestPackage.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
Oops, something went wrong.