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

Load assets from same folder as JSbundle (Android) #4527

Closed
wants to merge 17 commits into
base: master
from

Update resolveAssetSource-test.js

  • Loading branch information...
geof90 committed Dec 4, 2015
commit 83e628d8f97dc1a4694040aef757c504cc9db049
@@ -132,10 +132,10 @@ describe('resolveAssetSource', () => {
});
});
describe('bundle was loaded from file on Android', () => {
describe('bundle was loaded from assets on Android', () => {
beforeEach(() => {
NativeModules.SourceCode.scriptURL =
'file:///Path/To/Simulator/main.bundle';
'assets://Path/To/Simulator/main.bundle';
Platform.OS = 'android';
});
@@ -159,6 +159,34 @@ describe('resolveAssetSource', () => {
});
});
});
describe('bundle was loaded from file on Android', () => {
beforeEach(() => {
NativeModules.SourceCode.scriptURL =
'/sdcard/Path/To/Simulator/main.bundle';

This comment has been minimized.

@frantic

frantic Dec 13, 2015

Contributor

If loaded from the file, does RN Android report its scriptURL without file:// prefix? If so, we should fix that instead of adding complicated parsing and unnecessary if statements.

Platform.OS = 'android';
});
it('uses pre-packed 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/assets/AwesomeModule/Subdir/!@Logo#1_€.png',
scale: 1,
});
});
});
});
ProTip! Use n and p to navigate between commits in a pull request.