if options.mode == 'embedded':
native_library_dir = os.path.join('xwalk_core_library', 'libs')
native_library_temp_dir = 'temp'
+ Clean('temp', '0') # May be left over from aborted tests
shutil.copytree(native_library_dir, native_library_temp_dir)
for root, _, files in os.walk(native_library_dir):
if 'libxwalkcore.so' in files:
cmd = ['python', 'make_apk.py', '--name=Example',
'--package=org.xwalk.example', '--app-version=1.0.0',
'--description=a sample application',
- '--app-url=http://www.intel.com', self._mode]
+ '--app-url=http://www.intel.com',
+ '--project-dir=.', self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
manifest = 'Example/AndroidManifest.xml'
'--package=org.xwalk.example', '--app-version=1.0.0',
'--description=a sample application',
'--app-versionCode=3',
- '--app-url=http://www.intel.com', self._mode]
+ '--app-url=http://www.intel.com',
+ '--project-dir=.',
+ self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
manifest = 'Example/AndroidManifest.xml'
'--description=a sample application',
'--app-versionCodeBase=3',
arch,
- '--app-url=http://www.intel.com', self._mode]
+ '--app-url=http://www.intel.com',
+ '--project-dir=.',
+ self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
manifest = 'Example/AndroidManifest.xml'
'--description=a sample application',
'--app-versionCodeBase=30000000',
arch,
- '--app-url=http://www.intel.com', self._mode]
+ '--app-url=http://www.intel.com',
+ '--project-dir=.',
+ self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
manifest = 'Example/AndroidManifest.xml'
def testPermissions(self):
cmd = ['python', 'make_apk.py', '--name=Example', '--app-version=1.0.0',
'--package=org.xwalk.example', '--permissions=geolocation',
- '--app-url=http://www.intel.com', self._mode]
+ '--app-url=http://www.intel.com',
+ '--project-dir=.',
+ self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
manifest = 'Example/AndroidManifest.xml'
icon = os.path.join('test_data', 'manifest', 'icons', 'icon_96.png')
cmd = ['python', 'make_apk.py', '--name=Example', '--app-version=1.0.0',
'--package=org.xwalk.example', '--app-url=http://www.intel.com',
- '--icon=%s' % icon, self._mode]
+ '--icon=%s' % icon, '--project-dir=.', self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
manifest = 'Example/AndroidManifest.xml'
manifest_path = os.path.join('test_data', 'manifest', 'manifest_icon.json')
cmd = ['python', 'make_apk.py', '--name=Example', '--app-version=1.0.0',
'--package=org.xwalk.example', '--app-url=http://www.intel.com',
- '--manifest=%s' % manifest_path, self._mode]
+ '--manifest=%s' % manifest_path, '--project-dir=.', self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
manifest = 'Example/AndroidManifest.xml'
def testFullscreen(self):
cmd = ['python', 'make_apk.py', '--name=Example', '--app-version=1.0.0',
'--package=org.xwalk.example', '--app-url=http://www.intel.com',
- '-f', self._mode]
+ '-f', '--project-dir=.', self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
theme = 'Example/res/values-v14/theme.xml'
def testEnableRemoteDebugging(self):
cmd = ['python', 'make_apk.py', '--name=Example', '--app-version=1.0.0',
'--package=org.xwalk.example', '--app-url=http://www.intel.com',
- '--enable-remote-debugging', self._mode]
+ '--enable-remote-debugging', '--project-dir=.', self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
activity = 'Example/src/org/xwalk/example/ExampleActivity.java'
manifest_path = os.path.join('test_data', 'manifest', 'manifest.json')
cmd = ['python', 'make_apk.py', '--enable-remote-debugging',
'--package=org.xwalk.example',
- '--manifest=%s' % manifest_path, self._mode]
+ '--manifest=%s' % manifest_path,
+ '--project-dir=.',
+ self._mode]
RunCommand(cmd)
activity = 'Example/src/org/xwalk/example/ExampleActivity.java'
with open(activity, 'r') as content_file:
'--package=org.xwalk.example', '--app-url=http://www.intel.com',
'--keystore-path=%s' % keystore_path, '--keystore-alias=xwalk-test',
'--keystore-passcode=xwalk-test',
- '--keystore-alias-passcode=xwalk-test', self._mode]
+ '--keystore-alias-passcode=xwalk-test',
+ '--project-dir=.', self._mode]
RunCommand(cmd)
self.assertTrue(os.path.isdir('Example'))
self.checkApks('Example', '1.0.0', keystore_path)
Clean('Example', '1.0.0')
- keystore_path_with_space = os.path.join(
- 'test_data', 'keystore', 'test keystore')
+ keystore_path_with_space = os.path.join('test_data', 'keystore',
+ 'test keystore')
shutil.copy2(keystore_path, keystore_path_with_space)
keystore_path = os.path.join('test_data', 'keystore',
'xwalk-test.keystore')
'--keystore-path=%s' % keystore_path_with_space,
'--keystore-alias=xwalk test',
'--keystore-passcode=xwalk-test',
- '--keystore-alias-passcode=xwalk test', self._mode]
+ '--keystore-alias-passcode=xwalk test',
+ '--project-dir=.', self._mode]
RunCommand(cmd)
self.assertTrue(os.path.isdir('Example'))
self.checkApks('Example', '1.0.0', keystore_path_with_space)
def testManifest(self):
manifest_path = os.path.join('test_data', 'manifest', 'manifest.json')
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
- '--manifest=%s' % manifest_path, self._mode]
+ '--manifest=%s' % manifest_path, '--project-dir=.', self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
manifest = 'Example/AndroidManifest.xml'
manifest_path = os.path.join('test_data', 'manifest',
'manifest_app_launch_local_path.json')
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
- '--manifest=%s' % manifest_path, self._mode]
+ '--manifest=%s' % manifest_path, '--project-dir=.', self._mode]
out = RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
self.assertTrue(out.find('no app launch path') == -1)
'--manifest=%s' % manifest_path, self._mode]
out = RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
- self.assertIn('WARNING: app.launch.local_path is deprecated for Crosswalk',
- out)
+ self.assertIn('Warning: The following fields have been deprecated', out)
+ self.assertIn('app.launch.local_path', out)
Clean('Example', '1.0.0')
manifest_path = os.path.join('test_data', 'manifest', 'deprecated',
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
'--manifest=%s' % manifest_path, self._mode]
out = RunCommand(cmd)
- self.assertIn('WARNING: launch_path is deprecated for Crosswalk', out)
+ self.assertIn('Warning: The following fields have been deprecated', out)
+ self.assertIn('launch_path', out)
Clean('Example', '1.0.0')
manifest_path = os.path.join('test_data', 'manifest', 'deprecated',
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
'--manifest=%s' % manifest_path, self._mode]
out = RunCommand(cmd)
- self.assertIn('WARNING: permissions is deprecated for Crosswalk', out)
+ self.assertIn('Warning: The following fields have been deprecated', out)
+ self.assertIn('permissions', out)
Clean('Example', '1.0.0')
manifest_path = os.path.join('test_data', 'manifest',
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
'--manifest=%s' % manifest_path, self._mode]
out = RunCommand(cmd)
- self.assertIn('WARNING: icons defined as dictionary form is deprecated',
- out)
+ self.assertIn('Warning: The following fields have been deprecated', out)
+ self.assertIn('icons', out)
Clean('Example', '1.0.0')
manifest_path = os.path.join('test_data', 'manifest', 'deprecated',
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
'--manifest=%s' % manifest_path, self._mode]
out = RunCommand(cmd)
- self.assertIn('WARNING: description is deprecated for Crosswalk', out)
+ self.assertIn('Warning: The following fields have been deprecated', out)
+ self.assertIn('description', out)
Clean('Example', '1.0.0')
manifest_path = os.path.join('test_data', 'manifest', 'deprecated',
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
'--manifest=%s' % manifest_path, self._mode]
out = RunCommand(cmd)
- self.assertIn('WARNING: version is deprecated for Crosswalk', out)
+ self.assertIn('Warning: The following fields have been deprecated', out)
+ self.assertIn('version', out)
def testManifestWithError(self):
manifest_path = os.path.join('test_data', 'manifest',
extension_path = 'test_data/extensions/myextension'
cmd = ['python', 'make_apk.py', '--name=Example', '--app-version=1.0.0',
'--package=org.xwalk.example', '--app-url=http://www.intel.com',
- '--extensions=%s' % extension_path, self._mode]
+ '--extensions=%s' % extension_path, '--project-dir=.', self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
self.assertTrue(os.path.exists('Example'))
self.checkApks('Example', '1.0.0')
def testExtensionsWithNonExtension(self):
- # Test with a non-existed extension.
+ # Test with a non-existing extension.
extension_path = 'test_data/extensions/myextension'
cmd = ['python', 'make_apk.py', '--name=Example', '--app-version=1.0.0',
'--package=org.xwalk.example', '--app-url=http://www.intel.com',
'--extensions=%s1' % extension_path, self._mode, '--verbose']
out = RunCommand(cmd)
- error_msg = 'Error: can\'t find the extension directory'
- self.assertTrue(out.find(error_msg) != -1)
self.assertTrue(out.find('Exiting with error code: 9') != -1)
def testExtensionWithPermissions(self):
cmd = ['python', 'make_apk.py', '--name=Example', '--app-version=1.0.0',
'--package=org.xwalk.example', '--app-root=%s' % test_entry_root,
'--app-local-path=contactextension.html',
- '--extensions=%s' % extension_path, self._mode]
+ '--extensions=%s' % extension_path,
+ '--project-dir=.', self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
self.assertTrue(os.path.exists('Example'))
def testXPK(self):
xpk_file = os.path.join('test_data', 'xpk', 'example.xpk')
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
- '--xpk=%s' % xpk_file, self._mode]
+ '--xpk=%s' % xpk_file, '--project-dir=.', self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
self.assertTrue(os.path.exists('Example'))
def testXPKWithError(self):
xpk_file = os.path.join('test_data', 'xpk', 'error.xpk')
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
- '--xpk=%s' % xpk_file, self._mode]
+ '--xpk=%s' % xpk_file, '--project-dir=.', self._mode]
out = RunCommand(cmd)
error_msg = 'XPK doesn\'t contain manifest file'
self.assertTrue(out.find(error_msg) != -1)
def testOrientation(self):
cmd = ['python', 'make_apk.py', '--name=Example', '--app-version=1.0.0',
'--package=org.xwalk.example', '--app-url=http://www.intel.com',
- '--orientation=landscape', self._mode]
+ '--orientation=landscape', '--project-dir=.', self._mode]
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
manifest = 'Example/AndroidManifest.xml'
def testVerbose(self):
cmd = ['python', 'make_apk.py', '--name=Example', '--app-version=1.0.0',
'--package=org.xwalk.example', '--app-url=http://www.intel.com',
- '--verbose', self._mode]
+ '--verbose', '--project-dir=.', self._mode]
result = RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
self.assertTrue(result.find('aapt') != -1)
'--name=Example',
'--orientation=landscape',
'--package=org.xwalk.example',
- '--permissions=geolocation']
+ '--permissions=geolocation',
+ '--project-dir=.']
RunCommand(cmd)
self.addCleanup(Clean, 'Example', '1.0.0')
activity = 'Example/src/org/xwalk/example/ExampleActivity.java'
'--app-version=1.0.0',
'--name=Example',
'--package=org.xwalk.example',
- '--verbose']
+ '--verbose',
+ '--project-dir=.']
RunCommand(cmd)
manifest = 'Example/AndroidManifest.xml'
if not os.path.exists(manifest):
for img_type in img_types:
name = orientation + '_' + img_type + '_' + dimension
path_tmp = os.path.join(launch_screen_path, name)
- _file = open(path_tmp,'w+')
+ _file = open(path_tmp, 'w+')
_file.write(name)
_file.close()
# Run Test.
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
'--manifest=%s' % manifest_path, self._mode]
out = RunCommand(cmd)
- self.assertTrue(
- out.find('WARNING: launch_screen is deprecated for Crosswalk') != -1)
+ self.assertIn('Warning: The following fields have been deprecated', out)
+ self.assertTrue(out.find('launch_screen') != -1)
Clean('Example', '1.0.0')
manifest_path = os.path.join('test_data', 'launchScreen', 'manifest.json')
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
- '--manifest=%s' % manifest_path, self._mode]
+ '--manifest=%s' % manifest_path, '--project-dir=.', self._mode]
RunCommand(cmd)
# Check theme.xml.
theme_path = os.path.join('Example', 'res', 'values-v14', 'theme.xml')
'--name=%s' % name,
'--package=org.xwalk.example',
'--compressor',
- '--app-root=%s' % app_root]
+ '--app-root=%s' % app_root,
+ '--project-dir=.']
RunCommand(cmd)
CompareSizeForCompressor('all', css_file, 'css', name, fun)
CompareSizeForCompressor('all', js_file, 'js', name, fun)
'--name=%s' % name,
'--package=org.xwalk.example',
'--app-root=%s' % app_root,
- '--compressor']
+ '--compressor',
+ '--project-dir=.']
RunCommand(cmd)
CompareSizeForCompressor('all', css_file, 'css', name, fun)
CompareSizeForCompressor('all', js_file, 'js', name, fun)
'--name=%s' % name,
'--package=org.xwalk.example',
'--compressor=js',
- '--app-root=%s' % app_root]
+ '--app-root=%s' % app_root,
+ '--project-dir=.']
RunCommand(cmd)
CompareSizeForCompressor('js', js_file, 'js', name, fun)
'--name=%s' % name,
'--package=org.xwalk.example',
'--compressor=css',
- '--app-root=%s' % app_root]
+ '--app-root=%s' % app_root,
+ '--project-dir=.']
RunCommand(cmd)
CompareSizeForCompressor('css', css_file, 'css', name, fun)
cmd = ['python', 'customize.py',
'--name=%s' % name,
'--package=org.xwalk.example',
- '--app-root=%s' % app_root]
+ '--app-root=%s' % app_root,
+ '--project-dir=.']
RunCommand(cmd)
CompareSizeForCompressor(None, css_file, 'css', name, fun)
CompareSizeForCompressor(None, js_file, 'js', name, fun)
'--name=%s' % name,
'--package=org.xwalk.example',
'--app-root=%s' % app_root,
- '--compressor=other']
+ '--compressor=other',
+ '--project-dir=.']
RunCommand(cmd)
CompareSizeForCompressor(None, css_file, 'css', name, fun)
CompareSizeForCompressor(None, js_file, 'js', name, fun)
xml_path = 'Example/AndroidManifest.xml'
piece_content = 'android:label="%s"' % '你好'
cmd = ['python', 'make_apk.py', '--name=你好', '--app-version=1.0.0',
- '--package=org.xwalk.example', '--app-url=http://www.intel.com']
+ '--package=org.xwalk.example', '--app-url=http://www.intel.com',
+ '--project-dir=.']
RunCommand(cmd)
self.VerifyResultInXMLFile(xml_path, piece_content)
manifest_path = os.path.join('test_data', 'manifest', 'invalidchars',
'manifest_with_chinese_name.json')
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
- '--manifest=%s' % manifest_path]
+ '--manifest=%s' % manifest_path, '--project-dir=.']
RunCommand(cmd)
self.VerifyResultInXMLFile(xml_path, piece_content)
piece_content = '<string name="description">%s</string>' % '你好'
cmd = ['python', 'make_apk.py', '--name=hello', '--app-version=1.0.0',
'--package=org.xwalk.example', '--app-url=http://www.intel.com',
- '--description=你好']
+ '--description=你好', '--project-dir=.']
RunCommand(cmd)
self.VerifyResultInXMLFile(xml_path, piece_content)
manifest_path = os.path.join('test_data', 'manifest',
'manifest_description_dbcs.json')
cmd = ['python', 'make_apk.py', '--package=org.xwalk.example',
- '--manifest=%s' % manifest_path]
+ '--manifest=%s' % manifest_path, '--project-dir=.']
RunCommand(cmd)
piece_content = '"description">%s</string>' % '你好 a sample description'
self.VerifyResultInXMLFile(xml_path, piece_content)