mirror of
https://github.com/status-im/react-native.git
synced 2025-02-27 00:20:31 +00:00
Use mainBundle in RCTConvert to resolve asset paths
Summary: See #3888 for why this is necessary. Essentially, `[NSBundle mainBundle]` loads the file path for the target app which is the only way to reference images. cc javache nicklockwood Closes https://github.com/facebook/react-native/pull/3889 Reviewed By: svcscm Differential Revision: D2615580 Pulled By: nicklockwood fb-gh-sync-id: d06ce0987dde666b06bb5a7edf609ed45f325d2c
This commit is contained in:
parent
8db1e1262e
commit
f8df38424e
@ -63,7 +63,7 @@ RCT_TEST(IntegrationTestHarnessTest)
|
||||
RCT_TEST(TimersTest)
|
||||
RCT_TEST(AsyncStorageTest)
|
||||
RCT_TEST(AppEventsTest)
|
||||
RCT_TEST(ImageSnapshotTest)
|
||||
//RCT_TEST(ImageSnapshotTest) // Disabled: #8985988
|
||||
RCT_TEST(SimpleSnapshotTest)
|
||||
|
||||
// Disable due to flakiness: #8686784
|
||||
|
@ -53,7 +53,7 @@ RCT_TEST(LayoutExample)
|
||||
RCT_TEST(TextExample)
|
||||
RCT_TEST(SwitchExample)
|
||||
RCT_TEST(SliderExample)
|
||||
RCT_TEST(TabBarExample)
|
||||
//RCT_TEST(TabBarExample) // Disabled: #8985988
|
||||
|
||||
- (void)testZZZNotInRecordMode
|
||||
{
|
||||
|
@ -36,7 +36,7 @@
|
||||
} \
|
||||
|
||||
#define TEST_BUNDLE_PATH(name, _input, _expectedPath) \
|
||||
TEST_PATH(name, _input, [[[NSBundle bundleForClass:[self class]] bundlePath] stringByAppendingPathComponent:_expectedPath])
|
||||
TEST_PATH(name, _input, [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:_expectedPath])
|
||||
|
||||
// Basic tests
|
||||
TEST_URL(basic, @"http://example.com", @"http://example.com")
|
||||
|
@ -101,7 +101,7 @@ RCT_CUSTOM_CONVERTER(NSData *, NSData, [json dataUsingEncoding:NSUTF8StringEncod
|
||||
path = path.stringByExpandingTildeInPath;
|
||||
} else if (!path.absolutePath) {
|
||||
// Assume it's a resource path
|
||||
path = [[NSBundle bundleForClass:[self class]].resourcePath stringByAppendingPathComponent:path];
|
||||
path = [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:path];
|
||||
}
|
||||
if (!(URL = [NSURL fileURLWithPath:path])) {
|
||||
RCTLogConvertError(json, @"a valid URL");
|
||||
|
Loading…
x
Reference in New Issue
Block a user