def test_build(self):
     comm.setUp()
     app_name = "remotedebugging"
     cmd_create = "bin/create " + app_name + " com.example." + app_name + " " + app_name
     comm.create(cmd_create, app_name, self)
     cmd_build = "./cordova/build --debug"
     comm.build(cmd_build, app_name, self)
示例#2
0
 def test_build_normal(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
示例#3
0
 def test_build_normal(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
 def test_update_name(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     jsonfile = open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r")
     jsons = jsonfile.read()
     jsonfile.close()
     jsonDict = json.loads(jsons)
     jsonDict["name"] = "org.example.test"
     json.dump(jsonDict, open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "w"))
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     root = ElementTree.parse(comm.ConstPath + "/../tools/org.xwalk.test/prj/android/AndroidManifest.xml").getroot()
     application_attributes = root.find('application').attrib
     for x in application_attributes.keys():
         if x.find("label") != -1:
             application_xml = application_attributes[x]
             break
     activity_attributes = root.find('application').find('activity').attrib
     for y in activity_attributes.keys():
         if y.find("label") != -1:
             activity_xml = activity_attributes[y]
             break
     comm.clear("org.xwalk.test")
     self.assertEquals(application_xml, "org.example.test")
     self.assertEquals(activity_xml, "org.example.test")
示例#5
0
 def test_build(self):
     comm.setUp()
     app_name = "gallery"
     pkg_name = " com.example." + app_name.lower()
     sample_src_pref = "/tmp/crosswalk-demos/Gallery"
     comm.create(app_name, pkg_name, comm.MODE, sample_src_pref, None, self)
     comm.build(app_name, False, self)
 def test_build(self):
     comm.setUp()
     app_name = "remotedebugging"
     cmd_create = "bin/create " + app_name + " com.example." + app_name + " " + app_name
     comm.create(cmd_create, app_name, self)
     cmd_build = "./cordova/build --debug"
     comm.build(cmd_build, app_name, self)
 def test_build_release_sdk(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     buildcmd = comm.PackTools + "crosswalk-app build release --ios-sdk iphoneos"
     comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
示例#8
0
 def test_build_debug_path_webp(self):
     comm.setUp()
     comm.create(self)
     jsonfile = open(
         comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r")
     jsons = jsonfile.read()
     jsonfile.close()
     jsonDict = json.loads(jsons)
     jsonDict["xwalk_android_webp"] = "80 80 100"
     json.dump(
         jsonDict,
         open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json",
              "w"))
     if os.path.exists("pkg"):
         shutil.rmtree("pkg")
     os.mkdir("pkg")
     os.chdir('pkg')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build " + comm.XwalkPath + "org.xwalk.test"
     comm.build(self, buildcmd)
     comm.run(self)
     os.chdir('../')
     shutil.rmtree("pkg")
     comm.clear("org.xwalk.test")
     if comm.SHELL_FLAG == "False":
         os.system('adb start-server')
 def test_update_name(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     jsonfile = open(
         comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r")
     jsons = jsonfile.read()
     jsonfile.close()
     jsonDict = json.loads(jsons)
     jsonDict["name"] = "org.example.test"
     json.dump(
         jsonDict,
         open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json",
              "w"))
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     root = ElementTree.parse(
         comm.ConstPath +
         "/../tools/org.xwalk.test/prj/android/AndroidManifest.xml"
     ).getroot()
     application_attributes = root.find('application').attrib
     for x in application_attributes.keys():
         if x.find("label") != -1:
             application_xml = application_attributes[x]
             break
     activity_attributes = root.find('application').find('activity').attrib
     for y in activity_attributes.keys():
         if y.find("label") != -1:
             activity_xml = activity_attributes[y]
             break
     comm.clear("org.xwalk.test")
     self.assertEquals(application_xml, "org.example.test")
     self.assertEquals(activity_xml, "org.example.test")
 def test_build_release_provison(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     buildcmd = comm.PackTools + 'crosswalk-app build release --ios-provison "ios"'
     comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
示例#11
0
 def test_build_release(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     buildcmd = comm.PackTools + "crosswalk-app build release"
     comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
 def test_build(self):
     comm.setUp()
     app_name = "gallery"
     pkg_name = " com.example." + app_name.lower()
     sample_src_pref = "/tmp/crosswalk-demos/Gallery"
     comm.create(app_name, pkg_name, comm.MODE, sample_src_pref, None, self)
     comm.build(app_name, False, self)
 def test_build(self):
     comm.setUp()
     app_name = "spacedodge"
     pkg_name = " com.example." + app_name.lower()
     sample_src_pref = "/tmp/crosswalk-demos/space-dodge-game/base"
     comm.create(app_name, pkg_name, comm.MODE, sample_src_pref, None, self)
     comm.build(app_name, False, self)
 def test_build_release_sign(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     buildcmd = comm.PackTools + 'crosswalk-app build release --ios-sign "iPhone Developer: M VINCENT DAUBRY (J9TS3TJRYX)"'
     comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
 def test_build_release_sign(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     buildcmd = comm.PackTools + 'crosswalk-app build release --ios-sign "iPhone Developer: M VINCENT DAUBRY (J9TS3TJRYX)"'
     comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
 def test_multiple_apk_true(self):
     comm.setUp()
     app_name = "testMultipleApk"
     pkg_name = " com.example." + app_name.lower()
     content = "<a href='http://www.intel.com'>Intel</a>\n</body>"
     key = "</body>"
     replace_index_list = [key, content]
     comm.create(
         app_name,
         pkg_name,
         comm.MODE,
         None,
         replace_index_list,
         self, None, "true")
     comm.build(app_name, False, self)
     apk_name_arch = "armv7"
     if comm.ARCH == "x86":
         apk_name_arch = "x86"
     apk_path = os.path.join(os.getcwd(), "android-%s-debug.apk" % apk_name_arch)
     if not os.path.exists(apk_path):
         apk_path = os.path.join(os.getcwd(), "%s-%s-debug.apk" % (app_name, apk_name_arch))
     print apk_path
     self.assertTrue(os.path.exists(apk_path))
     comm.do_copy(apk_path, os.path.join(comm.testapp_path, "%s.apk" % app_name))
     comm.app_install(app_name, pkg_name, self)
     comm.app_launch(app_name, pkg_name, self)
     comm.app_uninstall(pkg_name, self)
     comm.app_stop(pkg_name, self)
 def test_build_release_provison(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     buildcmd = comm.PackTools + 'crosswalk-app build release --ios-provison "ios"'
     comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
 def test_build(self):
     comm.setUp()
     app_name = "privateNotes"
     pkg_name = " com.example." + app_name
     sample_src_pref = "/tmp/crosswalk-demos/sample-my-private-notes/www"
     extra_plugin = "https://github.com/01org/AppSecurityApi"
     comm.create(app_name, pkg_name, comm.MODE, sample_src_pref, None, self, extra_plugin)
     comm.build(app_name, False, self)
示例#19
0
 def test_build_release(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     buildcmd = comm.PackTools + "crosswalk-app build release"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
示例#20
0
 def test_build_release(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build release"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
     os.system('adb start-server')
示例#21
0
 def test_build_normal(self):
     comm.setUp()
     comm.create(self)
     os.chdir(comm.TEST_PROJECT_COMM)
     buildcmd = "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.cleanTempData(comm.TEST_PROJECT_COMM)
     comm.delete()
示例#22
0
 def test_build(self):
     comm.setUp()
     app_name = "privateNotes"
     pkg_name = " com.example." + app_name
     sample_src_pref = "/tmp/crosswalk-demos/sample-my-private-notes/www"
     extra_plugin = "https://github.com/01org/AppSecurityApi"
     comm.create(app_name, pkg_name, comm.MODE, sample_src_pref, None, self,
                 extra_plugin)
     comm.build(app_name, 0, self)
示例#23
0
 def test_build_release(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build release"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
     os.system('adb start-server')
示例#24
0
 def test_build_normal(self):
     comm.setUp()
     comm.create(self)
     os.chdir(comm.TEST_PROJECT_COMM)
     buildcmd = "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.cleanTempData(comm.TEST_PROJECT_COMM)
     comm.delete()
 def test_build(self):
     comm.setUp()
     app_name = "helloworld"
     pkg_name = " com.example." + app_name.lower()
     content = "<a href='http://www.intel.com'>Intel</a>\n</body>"
     key = "</body>"
     replace_index_list = [key, content]
     comm.create(app_name, pkg_name, comm.MODE, None, replace_index_list, self)
     comm.build(app_name, 0, self)
 def test_create_with_platform_android(self):
     comm.setUp()
     os.chdir(comm.TEMP_DATA_PATH)
     cmd = "crosswalk-app create " + comm.TEST_PROJECT_COMM + " --platforms=android"
     packstatus = commands.getstatusoutput(cmd)
     os.chdir(comm.TEST_PROJECT_COMM)
     buildcmd = "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.cleanTempData(comm.TEST_PROJECT_COMM)
     self.assertEquals(packstatus[0], 0)
 def test_create_with_platform_android(self):
     comm.setUp()
     os.chdir(comm.XwalkPath)
     cmd = comm.PackTools + "crosswalk-app create org.xwalk.test --platforms=android"
     packstatus = commands.getstatusoutput(cmd)
     os.chdir('org.xwalk.test')
     buildcmd = comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
     self.assertEquals(packstatus[0], 0)
 def test_create_with_platform_android(self):
     comm.setUp()
     os.chdir(comm.XwalkPath)
     cmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app create org.xwalk.test --platforms=android"
     packstatus = os.system(cmd)
     os.chdir('org.xwalk.test')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
     self.assertEquals(packstatus, 0)
 def test_build_normal(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
     if comm.SHELL_FLAG == "False":
         os.system('adb start-server')
 def test_build(self):
     comm.setUp()
     app_name = "remotedebugging"
     if comm.MODE == "shared":
         cmd_create = "bin/create " + app_name + " com.example." + app_name + " " + app_name + " --xwalk-shared-library"
     else:
         cmd_create = "bin/create " + app_name + " com.example." + app_name + " " + app_name
     comm.create(cmd_create, app_name, self)
     cmd_build = "./cordova/build --debug"
     comm.build(cmd_build, app_name, self)
示例#31
0
 def test_build(self):
     comm.setUp()
     app_name = "helloworld"
     pkg_name = " com.example." + app_name.lower()
     content = "<a href='http://www.intel.com'>Intel</a>\n</body>"
     key = "</body>"
     replace_index_list = [key, content]
     comm.create(app_name, pkg_name, comm.MODE, None, replace_index_list,
                 self)
     comm.build(app_name, False, self)
 def test_create_with_platform_android(self):
     comm.setUp()
     os.chdir(comm.XwalkPath)
     cmd = comm.PackTools + "crosswalk-app create org.xwalk.test --platforms=android"
     packstatus = commands.getstatusoutput(cmd)
     os.chdir('org.xwalk.test')
     buildcmd = comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
     self.assertEquals(packstatus[0], 0)
示例#33
0
 def test_create_with_platform_android(self):
     comm.setUp()
     os.chdir(comm.XwalkPath)
     cmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app create org.xwalk.test" + comm.MODE + " --platforms=android"
     packstatus = os.system(cmd)
     self.assertEquals(packstatus, 0)
     os.chdir('org.xwalk.test')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
 def test_build(self):
     comm.setUp()
     app_name = "gallery"
     cmd_create = "bin/create " + app_name + " com.example." + app_name + " " + app_name
     comm.create(cmd_create, app_name, self)
     comm.do_remove(
         glob.glob(os.path.join(comm.pack_tool, app_name, "assets", "www")))
     comm.do_copy(os.path.join(comm.sample_src_pref, "Gallery"),
                  os.path.join(comm.pack_tool, app_name, "assets", "www"))
     cmd_build = "./cordova/build"
     comm.build(cmd_build, app_name, self)
示例#35
0
 def test_build_path_release(self):
     comm.setUp()
     comm.create(self)
     if os.path.exists("pkg"):
         shutil.rmtree("pkg")
     os.mkdir("pkg")
     os.chdir('pkg')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build release " + comm.XwalkPath + "org.xwalk.test"
     comm.build(self, buildcmd)
     os.chdir('../')
     shutil.rmtree("pkg")
     comm.clear("org.xwalk.test")
 def test_build_path_normal(self):
     comm.setUp()
     comm.create(self)
     if os.path.exists("pkg"):
         shutil.rmtree("pkg")
     os.mkdir("pkg")
     os.chdir('pkg')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build " + comm.XwalkPath + "org.xwalk.test"
     comm.build(self, buildcmd)
     os.chdir('../')
     shutil.rmtree("pkg")
     comm.clear("org.xwalk.test")
示例#37
0
 def test_update_name(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     jsonfile = open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r")
     jsons = jsonfile.read()
     jsonfile.close()
     jsonDict = json.loads(jsons)
     jsonDict["name"] = "org.exa mple.test"
     json.dump(jsonDict, open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "w"))
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
 def test_build(self):
     comm.setUp()
     app_name = "helloworld"
     cmd_create = "bin/create " + app_name + " com.example." + app_name + " " + app_name
     comm.create(cmd_create, app_name, self)
     if not comm.replace_key(
             os.path.join(comm.pack_tool, app_name, "assets", "www",
                          "index.html"),
             "<a href='http://www.intel.com'>Intel</a>\n</body>",
             "</body>"):
         return False
     cmd_build = "./cordova/build"
     comm.build(cmd_build, app_name, self)
 def test_build(self):
     comm.setUp()
     app_name = "gallery"
     if comm.MODE == "shared":
         cmd_create = "bin/create " + app_name + " com.example." + app_name + " " + app_name + " --xwalk-shared-library"
     else:
         cmd_create = "bin/create " + app_name + " com.example." + app_name + " " + app_name
     comm.create(cmd_create, app_name, self)
     comm.do_remove(glob.glob(os.path.join(comm.pack_tool, app_name, "assets", "www")))
     comm.do_copy(os.path.join(comm.sample_src_pref, "Gallery"), 
             os.path.join(comm.pack_tool, app_name, "assets", "www"))
     cmd_build = "./cordova/build"
     comm.build(cmd_build, app_name, self)
 def test_create_with_platform_android(self):
     comm.setUp()
     os.chdir(comm.XwalkPath)
     cmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app create org.xwalk.test" + comm.MODE + " --platforms=android"
     packstatus = os.system(cmd)
     self.assertEquals(packstatus, 0)
     os.chdir('org.xwalk.test')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
     if comm.SHELL_FLAG == "False":
         os.system('adb start-server')
 def test_create_offline(self):
     comm.setUp()
     os.chdir(comm.XwalkPath)
     comm.clear("org.xwalk.test")
     cmd = comm.HOST_PREFIX + comm.PackTools + \
         "crosswalk-app create org.xwalk.test" + comm.MODE + " --android-crosswalk=" + \
         comm.crosswalkzip
     (return_create_code, create_output) = comm.getstatusoutput(cmd)
     os.chdir('org.xwalk.test')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
     self.assertNotIn("Looking for", create_output)
示例#42
0
 def test_build_path_normal(self):
     comm.setUp()
     comm.create(self)
     if os.path.exists("pkg"):
         shutil.rmtree("pkg")
     os.mkdir("pkg")
     os.chdir('pkg')
     buildcmd = "crosswalk-app build " + comm.TEMP_DATA_PATH + comm.TEST_PROJECT_COMM
     comm.build(self, buildcmd)
     comm.run(self)
     os.chdir('../')
     shutil.rmtree("pkg")
     comm.cleanTempData(comm.TEST_PROJECT_COMM)
     comm.delete()
示例#43
0
 def test_mode_lite(self):
     comm.setUp()
     app_name = "modeLite"
     pkg_name = " com.example." + app_name.lower()
     comm.create(app_name, pkg_name, comm.MODE, None, None, self, None, None)
     project_root = os.path.join(comm.tool_path, app_name)
     comm.replace_key(os.path.join(project_root, 'config.xml'),
             '<preference name="xwalkMode" value="lite"',
             '<preference name="xwalkMode" value="embedded"')
     comm.build(app_name, 0, self, True)
     comm.app_install(app_name, pkg_name, self)
     comm.app_launch(app_name, pkg_name, self)
     comm.app_stop(pkg_name, self)
     comm.app_uninstall(pkg_name, self)
 def test_create_offline(self):
     comm.setUp()
     os.chdir(comm.XwalkPath)
     comm.clear("org.xwalk.test")
     cmd = comm.HOST_PREFIX + comm.PackTools + \
         "crosswalk-app create org.xwalk.test" + comm.MODE + " --android-crosswalk=" + \
         comm.crosswalkzip
     (return_create_code, create_output) = comm.getstatusoutput(cmd)
     os.chdir('org.xwalk.test')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
     self.assertNotIn("Looking for", create_output)
 def test_build_release_webp(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     jsonfile = open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r")
     jsons = jsonfile.read()
     jsonfile.close()
     jsonDict = json.loads(jsons)
     jsonDict["xwalk_android_webp"] = "80 80 100"
     json.dump(jsonDict, open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "w"))
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build release"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
 def test_build_path_release(self):
     comm.setUp()
     comm.create(self)
     if os.path.exists("pkg"):
         shutil.rmtree("pkg")
     os.mkdir("pkg")
     os.chdir('pkg')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build release " + comm.XwalkPath + "org.xwalk.test"
     comm.build(self, buildcmd)
     comm.run(self)
     os.chdir('../')
     shutil.rmtree("pkg")
     comm.clear("org.xwalk.test")
     os.system('adb start-server')
示例#47
0
 def test_build_path_normal(self):
     comm.setUp()
     comm.create(self)
     if os.path.exists("pkg"):
         shutil.rmtree("pkg")
     os.mkdir("pkg")
     os.chdir('pkg')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build " + comm.XwalkPath + "org.xwalk.test"
     comm.build(self, buildcmd)
     comm.run(self)
     os.chdir('../')
     shutil.rmtree("pkg")
     comm.clear("org.xwalk.test")
     os.system('adb start-server')
 def test_build_path_normal(self):
     comm.setUp()
     comm.create(self)
     if os.path.exists("pkg"):
         shutil.rmtree("pkg")
     os.mkdir("pkg")
     os.chdir('pkg')
     buildcmd = "crosswalk-app build " + comm.TEMP_DATA_PATH + comm.TEST_PROJECT_COMM
     comm.build(self, buildcmd)
     comm.run(self)
     os.chdir('../')
     shutil.rmtree("pkg")
     comm.cleanTempData(comm.TEST_PROJECT_COMM)
     comm.delete()
示例#49
0
 def test_mode_lite(self):
     comm.setUp()
     app_name = "modeLite"
     pkg_name = " com.example." + app_name.lower()
     comm.create(app_name, pkg_name, comm.MODE, None, None, self, None,
                 None)
     project_root = os.path.join(comm.tool_path, app_name)
     comm.replace_key(os.path.join(project_root, 'config.xml'),
                      '<preference name="xwalkMode" value="lite"',
                      '<preference name="xwalkMode" value="embedded"')
     comm.build(app_name, 0, self, True)
     comm.app_install(app_name, pkg_name, self)
     comm.app_launch(app_name, pkg_name, self)
     comm.app_stop(pkg_name, self)
     comm.app_uninstall(pkg_name, self)
示例#50
0
 def test_activity_name_normal(self):
     comm.setUp()
     comm.create(self)
     root = ElementTree.parse(comm.ConstPath + "/../tools/org.xwalk.test/prj/android/AndroidManifest.xml").getroot()
     activity_attributes = root.find('application').find('activity').attrib
     for y in activity_attributes.keys():
         if y.find("name") != -1:
             activity_name_xml = activity_attributes[y]
             break
     os.chdir('org.xwalk.test')
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
     self.assertEquals(activity_name_xml, "org.xwalk.test.TestActivity")
 def test_webp_jpeg_size_valid(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     jsonfile = open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r")
     jsons = jsonfile.read()
     jsonfile.close()
     jsonDict = json.loads(jsons)
     jsonDict["xwalk_android_webp"] = "80"
     json.dump(jsonDict, open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "w"))
     os.rename("app/icon.png", "app/icon.jpeg")
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
 def test_multiple_apk_true(self):
     comm.setUp()
     app_name = "testMultipleApk"
     pkg_name = " com.example." + app_name.lower()
     content = "<a href='http://www.intel.com'>Intel</a>\n</body>"
     key = "</body>"
     replace_index_list = [key, content]
     comm.create(app_name, pkg_name, comm.MODE, None, replace_index_list,
                 self, None, "true")
     comm.build(app_name, 0, self, True)
     comm.checkFileSize(
         os.path.join(comm.testapp_path, "%s.apk" % app_name), 10, 15, self)
     comm.app_install(app_name, pkg_name, self)
     comm.app_launch(app_name, pkg_name, self)
     comm.app_stop(pkg_name, self)
     comm.app_uninstall(pkg_name, self)
 def test_update_name(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     jsonfile = open(
         comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r")
     jsons = jsonfile.read()
     jsonfile.close()
     jsonDict = json.loads(jsons)
     jsonDict["name"] = "org.exa mple.test"
     json.dump(
         jsonDict,
         open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json",
              "w"))
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
 def test_build_release_webp(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     jsonfile = open(
         comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r")
     jsons = jsonfile.read()
     jsonfile.close()
     jsonDict = json.loads(jsons)
     jsonDict["xwalk_android_webp"] = "80 80 100"
     json.dump(
         jsonDict,
         open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json",
              "w"))
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build release"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
 def test_webp_jpeg_size_valid(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     jsonfile = open(
         comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r")
     jsons = jsonfile.read()
     jsonfile.close()
     jsonDict = json.loads(jsons)
     jsonDict["xwalk_android_webp"] = "80"
     json.dump(
         jsonDict,
         open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json",
              "w"))
     os.rename("app/icon.png", "app/icon.jpeg")
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     comm.build(self, buildcmd)
     comm.run(self)
     comm.clear("org.xwalk.test")
示例#56
0
 def test_versionCode_normal(self):
     comm.setUp()
     comm.create(self)
     os.chdir('org.xwalk.test')
     with open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json") as json_file:
         data = json.load(json_file)
     buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build"
     appVersion = comm.build(self, buildcmd)
     comm.clear("org.xwalk.test")
     self.assertEquals(data['xwalk_app_version'].strip(os.linesep), appVersion)