This commit is contained in:
Dhananjay Nakrani 2015-09-25 11:34:40 -07:00
Родитель 3c0a60e251
Коммит e54774645b
3 изменённых файлов: 27 добавлений и 2 удалений

Просмотреть файл

@ -23,6 +23,8 @@ class Default(object):
pass
elif engine == "ie":
pass
elif engine == "servo":
pass
else:
self.omit_ = True

Просмотреть файл

@ -54,7 +54,8 @@ if options.mode_rules is None:
"chrome,default:v8",
"chrome,turbofan:v8-turbofan",
"webkit,default:jsc",
"native,default:clang"
"native,default:clang",
"servo,default:servo"
]
#TODO:remove

Просмотреть файл

@ -2,6 +2,7 @@ import runners
import time
import os
import sys
import json
sys.path.insert(1, '../driver')
import utils
@ -45,7 +46,7 @@ class BrowserExecutor(object):
os.unlink("results")
def waitForResults(self):
timeout = int(utils.config.get('main', 'timeout')) * 60
timeout = utils.config.Timeout * 60
while not os.path.exists("results") and timeout > 0:
time.sleep(10)
timeout -= 10
@ -86,6 +87,25 @@ class FirefoxExecutor(BrowserExecutor):
# kill browser
runner.kill(process)
class ServoExecutor(BrowserExecutor):
def execute(self, page, env, args):
runner = runners.getRunner(self.engineInfo["platform"], {})
# kill all possible running instances.
runner.killall("servo")
# reset the result
self.resetResults()
# start browser
process = runner.start(self.engineInfo["binary"], args, env)
# wait for results
self.waitForResults()
# kill browser
runner.kill(process)
#class NativeExecutor(Executor):
#
@ -97,4 +117,6 @@ def getExecutor(engineInfo):
return ShellExecutor(engineInfo)
if engineInfo["engine_type"] == "firefox" and not engineInfo["shell"]:
return FirefoxExecutor(engineInfo)
if engineInfo["engine_type"] == "servo":
return ServoExecutor(engineInfo)