Initial version of the webkit runner
This commit is contained in:
Родитель
8ac4fd7a17
Коммит
5b4b425ef7
|
@ -37,6 +37,8 @@ class DownloadTools(object):
|
|||
return MozillaRevisionFinder(repo)
|
||||
if "chromium" in repo:
|
||||
return ChromeRevisionFinder(repo)
|
||||
if "webkit" in repo:
|
||||
return WebKitRevisionFinder(repo)
|
||||
raise Exception("Unknown repo")
|
||||
|
||||
@classmethod
|
||||
|
@ -85,6 +87,14 @@ class ChromeRevisionFinder(RevisionFinder):
|
|||
|
||||
return [self._url_base() + chromium_rev + "/"]
|
||||
|
||||
class WebKitRevisionFinder(RevisionFinder):
|
||||
|
||||
def latest(self):
|
||||
response = urllib2.urlopen("http://nightly.webkit.org/")
|
||||
cset = re.findall('WebKit r([0-9]*)<', response.read())[0]
|
||||
|
||||
return ["http://builds.nightly.webkit.org/files/trunk/mac/WebKit-SVN-r" + cset + ".dmg"]
|
||||
|
||||
class MozillaRevisionFinder(RevisionFinder):
|
||||
|
||||
def __init__(self, repo):
|
||||
|
@ -330,6 +340,30 @@ class GoogleAPISDownloader(Downloader):
|
|||
|
||||
return info
|
||||
|
||||
class BuildsWebkitDownloader(Downloader):
|
||||
|
||||
def __init__(self, url):
|
||||
self.file = url.split("/")[-1]
|
||||
self.url = "/".join(url.split("/")[0:-1])
|
||||
if not url.endswith("/"):
|
||||
url += "/"
|
||||
self.folder = "./"
|
||||
|
||||
def getfilename(self):
|
||||
return self.file
|
||||
|
||||
def retrieveInfo(self):
|
||||
print self.file
|
||||
cset = re.findall('-r([a-z0-9]*)\.dmg', self.file)[0]
|
||||
|
||||
info = {}
|
||||
info["revision"] = cset
|
||||
info["engine_type"] = "webkit"
|
||||
info["shell"] = False
|
||||
info["binary"] = os.path.abspath(self.folder + self.file)
|
||||
|
||||
return info
|
||||
|
||||
if __name__ == "__main__":
|
||||
from optparse import OptionParser
|
||||
parser = OptionParser(usage="usage: %prog [options]")
|
||||
|
|
|
@ -113,6 +113,34 @@ class ChromeExecutor(BrowserExecutor):
|
|||
# kill browser
|
||||
runner.kill(process)
|
||||
|
||||
class WebKitExecutor(BrowserExecutor):
|
||||
|
||||
def execute(self, page, env, args):
|
||||
runner = runners.getRunner(self.engineInfo["platform"], {
|
||||
"osx_mount_point": "/Volumes/WebKit",
|
||||
"osx_binary": "/Volumes/WebKit/WebKit.app/Contents/MacOS/WebKit"
|
||||
#"android_processname": "org.mozilla.fennec",
|
||||
#"linux_processname": "firefox"
|
||||
})
|
||||
|
||||
# kill all possible running instances.
|
||||
runner.killAllInstances()
|
||||
|
||||
# if needed install the executable
|
||||
binary = runner.install(self.engineInfo["binary"])
|
||||
|
||||
# reset the result
|
||||
self.resetResults()
|
||||
|
||||
# start browser
|
||||
process = runner.start("open", ["-F", "-a", binary] + args, env)
|
||||
|
||||
# wait for results
|
||||
self.waitForResults()
|
||||
|
||||
# kill browser
|
||||
runner.kill(process)
|
||||
|
||||
class ServoExecutor(BrowserExecutor):
|
||||
def execute(self, page, env, args):
|
||||
runner = runners.getRunner(self.engineInfo["platform"], {})
|
||||
|
@ -145,6 +173,8 @@ def getExecutor(engineInfo):
|
|||
return FirefoxExecutor(engineInfo)
|
||||
if engineInfo["engine_type"] == "chrome" and not engineInfo["shell"]:
|
||||
return ChromeExecutor(engineInfo)
|
||||
if engineInfo["engine_type"] == "webkit" and not engineInfo["shell"]:
|
||||
return WebKitExecutor(engineInfo)
|
||||
if engineInfo["engine_type"] == "servo":
|
||||
return ServoExecutor(engineInfo)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче