mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 12:15:37 +08:00
Support the scriptURLs observed on Android for asset source resolver
Reviewed By: frantic Differential Revision: D3005791 fb-gh-sync-id: 99acb350c8c80ebe22687294a0069891686885fc shipit-source-id: 99acb350c8c80ebe22687294a0069891686885fc
This commit is contained in:
committed by
Facebook Github Bot 8
parent
ae11449516
commit
87245b2d40
@@ -160,7 +160,7 @@ describe('resolveAssetSource', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('bundle was loaded from file on Android', () => {
|
||||
beforeEach(() => {
|
||||
NativeModules.SourceCode.scriptURL =
|
||||
@@ -189,6 +189,34 @@ describe('resolveAssetSource', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('bundle was loaded from raw file on Android', () => {
|
||||
beforeEach(() => {
|
||||
NativeModules.SourceCode.scriptURL =
|
||||
'/sdcard/Path/To/Simulator/main.bundle';
|
||||
Platform.OS = 'android';
|
||||
});
|
||||
|
||||
it('uses sideloaded image', () => {
|
||||
expectResolvesAsset({
|
||||
__packager_asset: true,
|
||||
fileSystemLocation: '/root/app/module/a',
|
||||
httpServerLocation: '/assets/AwesomeModule/Subdir',
|
||||
width: 100,
|
||||
height: 200,
|
||||
scales: [1],
|
||||
hash: '5b6f00f',
|
||||
name: '!@Logo#1_€',
|
||||
type: 'png',
|
||||
}, {
|
||||
__packager_asset: true,
|
||||
width: 100,
|
||||
height: 200,
|
||||
uri: 'file:///sdcard/Path/To/Simulator/drawable-mdpi/awesomemodule_subdir_logo1_.png',
|
||||
scale: 1,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('resolveAssetSource.pickScale', () => {
|
||||
|
||||
Reference in New Issue
Block a user