Remove -w flag now that WebRender is always used

Also remove the obsolete `--cpu` and `--gpu` renderer flags,
which also are no longer used.

Update tests and wptrunner to not pass these flags.
wptrunner changes have been upstreamed in:
  - w3c/wptrunner#224
  - w3c/wptrunner#226
This commit is contained in:
Aneesh Agrawal 2017-01-15 23:56:21 -05:00
parent 363f590019
commit b94b58f7ae
20 changed files with 69 additions and 105 deletions

View file

@ -573,8 +573,6 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
let (app_name, args) = args.split_first().unwrap(); let (app_name, args) = args.split_first().unwrap();
let mut opts = Options::new(); let mut opts = Options::new();
opts.optflag("c", "cpu", "CPU painting");
opts.optflag("g", "gpu", "GPU painting");
opts.optopt("o", "output", "Output file", "output.png"); opts.optopt("o", "output", "Output file", "output.png");
opts.optopt("s", "size", "Size of tiles", "512"); opts.optopt("s", "size", "Size of tiles", "512");
opts.optopt("", "device-pixel-ratio", "Device pixels per px", ""); opts.optopt("", "device-pixel-ratio", "Device pixels per px", "");
@ -620,7 +618,6 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
opts.optmulti("", "pref", opts.optmulti("", "pref",
"A preference to set to enable", "dom.mozbrowser.enabled"); "A preference to set to enable", "dom.mozbrowser.enabled");
opts.optflag("b", "no-native-titlebar", "Do not use native titlebar"); opts.optflag("b", "no-native-titlebar", "Do not use native titlebar");
opts.optflag("w", "webrender", "Use webrender backend");
opts.optopt("G", "graphics", "Select graphics backend (gl or es2)", "gl"); opts.optopt("G", "graphics", "Select graphics backend (gl or es2)", "gl");
opts.optopt("", "config-dir", opts.optopt("", "config-dir",
"config directory following xdg spec on linux platform", ""); "config directory following xdg spec on linux platform", "");

View file

@ -210,9 +210,6 @@ def main():
parser.add_argument("-d", "--debug", parser.add_argument("-d", "--debug",
action='store_true', action='store_true',
help="Use debug build instead of release build") help="Use debug build instead of release build")
parser.add_argument("-w", "--webrender",
action='store_true',
help="Use webrender backend")
parser.add_argument("-l", "--max_layout_threads", parser.add_argument("-l", "--max_layout_threads",
help="Specify the maximum number of threads for layout, for example \"-l 5\"") help="Specify the maximum number of threads for layout, for example \"-l 5\"")
parser.add_argument("-o", "--output", parser.add_argument("-o", "--output",
@ -233,8 +230,6 @@ def main():
benchmark = args.benchmark benchmark = args.benchmark
if args.debug: if args.debug:
build_target = "debug" build_target = "debug"
if args.webrender:
renderer = "-w"
if args.max_layout_threads: if args.max_layout_threads:
max_layout_threads = int(args.max_layout_threads) max_layout_threads = int(args.max_layout_threads)
if args.output: if args.output:

View file

@ -85,9 +85,6 @@ def main():
parser.add_argument("-b", "--benchmark", parser.add_argument("-b", "--benchmark",
default=benchmark, default=benchmark,
help="Gets the benchmark, for example \"-b http://www.example.com\"") help="Gets the benchmark, for example \"-b http://www.example.com\"")
parser.add_argument("-w", "--webrender",
action='store_true',
help="Use webrender backend")
parser.add_argument("-l", "--layout_threads", parser.add_argument("-l", "--layout_threads",
help="Specify the number of threads for layout, for example \"-l 5\"") help="Specify the number of threads for layout, for example \"-l 5\"")
parser.add_argument("-o", "--output", parser.add_argument("-o", "--output",
@ -99,8 +96,6 @@ def main():
args = parser.parse_args() args = parser.parse_args()
if args.benchmark: if args.benchmark:
benchmark = args.benchmark benchmark = args.benchmark
if args.webrender:
renderer = "-w"
if args.layout_threads: if args.layout_threads:
layout_threads = int(args.layout_threads) layout_threads = int(args.layout_threads)
if args.output: if args.output:

View file

@ -10,17 +10,20 @@ from ..executors.executorservo import ServoTestharnessExecutor, ServoRefTestExec
here = os.path.join(os.path.split(__file__)[0]) here = os.path.join(os.path.split(__file__)[0])
__wptrunner__ = {"product": "servo", __wptrunner__ = {
"check_args": "check_args", "product": "servo",
"browser": "ServoBrowser", "check_args": "check_args",
"executor": {"testharness": "ServoTestharnessExecutor", "browser": "ServoBrowser",
"reftest": "ServoRefTestExecutor", "executor": {
"wdspec": "ServoWdspecExecutor"}, "testharness": "ServoTestharnessExecutor",
"browser_kwargs": "browser_kwargs", "reftest": "ServoRefTestExecutor",
"executor_kwargs": "executor_kwargs", "wdspec": "ServoWdspecExecutor",
"env_options": "env_options", },
"run_info_extras": "run_info_extras", "browser_kwargs": "browser_kwargs",
"update_properties": "update_properties"} "executor_kwargs": "executor_kwargs",
"env_options": "env_options",
"update_properties": "update_properties",
}
def check_args(**kwargs): def check_args(**kwargs):
@ -28,11 +31,12 @@ def check_args(**kwargs):
def browser_kwargs(**kwargs): def browser_kwargs(**kwargs):
return {"binary": kwargs["binary"], return {
"debug_info": kwargs["debug_info"], "binary": kwargs["binary"],
"binary_args": kwargs["binary_args"], "debug_info": kwargs["debug_info"],
"user_stylesheets": kwargs.get("user_stylesheets"), "binary_args": kwargs["binary_args"],
"render_backend": kwargs.get("servo_backend")} "user_stylesheets": kwargs.get("user_stylesheets"),
}
def executor_kwargs(test_type, server_config, cache_manager, run_info_data, def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
@ -51,31 +55,23 @@ def env_options():
"supports_debugger": True} "supports_debugger": True}
def run_info_extras(**kwargs):
return {"backend": kwargs["servo_backend"]}
def update_properties(): def update_properties():
return ["debug", "os", "version", "processor", "bits", "backend"], None return ["debug", "os", "version", "processor", "bits"], None
def render_arg(render_backend):
return {"cpu": "--cpu", "webrender": "-w"}[render_backend]
class ServoBrowser(NullBrowser): class ServoBrowser(NullBrowser):
def __init__(self, logger, binary, debug_info=None, binary_args=None, def __init__(self, logger, binary, debug_info=None, binary_args=None,
user_stylesheets=None, render_backend="webrender"): user_stylesheets=None):
NullBrowser.__init__(self, logger) NullBrowser.__init__(self, logger)
self.binary = binary self.binary = binary
self.debug_info = debug_info self.debug_info = debug_info
self.binary_args = binary_args or [] self.binary_args = binary_args or []
self.user_stylesheets = user_stylesheets or [] self.user_stylesheets = user_stylesheets or []
self.render_backend = render_backend
def executor_browser(self): def executor_browser(self):
return ExecutorBrowser, {"binary": self.binary, return ExecutorBrowser, {
"debug_info": self.debug_info, "binary": self.binary,
"binary_args": self.binary_args, "debug_info": self.debug_info,
"user_stylesheets": self.user_stylesheets, "binary_args": self.binary_args,
"render_backend": self.render_backend} "user_stylesheets": self.user_stylesheets,
}

View file

@ -9,23 +9,25 @@ import tempfile
from mozprocess import ProcessHandler from mozprocess import ProcessHandler
from .base import Browser, require_arg, get_free_port, browser_command, ExecutorBrowser from .base import Browser, require_arg, get_free_port, browser_command, ExecutorBrowser
from .servo import render_arg
from ..executors import executor_kwargs as base_executor_kwargs from ..executors import executor_kwargs as base_executor_kwargs
from ..executors.executorservodriver import (ServoWebDriverTestharnessExecutor, from ..executors.executorservodriver import (ServoWebDriverTestharnessExecutor,
ServoWebDriverRefTestExecutor) ServoWebDriverRefTestExecutor)
here = os.path.join(os.path.split(__file__)[0]) here = os.path.join(os.path.split(__file__)[0])
__wptrunner__ = {"product": "servodriver", __wptrunner__ = {
"check_args": "check_args", "product": "servodriver",
"browser": "ServoWebDriverBrowser", "check_args": "check_args",
"executor": {"testharness": "ServoWebDriverTestharnessExecutor", "browser": "ServoWebDriverBrowser",
"reftest": "ServoWebDriverRefTestExecutor"}, "executor": {
"browser_kwargs": "browser_kwargs", "testharness": "ServoWebDriverTestharnessExecutor",
"executor_kwargs": "executor_kwargs", "reftest": "ServoWebDriverRefTestExecutor",
"env_options": "env_options", },
"run_info_extras": "run_info_extras", "browser_kwargs": "browser_kwargs",
"update_properties": "update_properties"} "executor_kwargs": "executor_kwargs",
"env_options": "env_options",
"update_properties": "update_properties",
}
hosts_text = """127.0.0.1 web-platform.test hosts_text = """127.0.0.1 web-platform.test
127.0.0.1 www.web-platform.test 127.0.0.1 www.web-platform.test
@ -41,10 +43,11 @@ def check_args(**kwargs):
def browser_kwargs(**kwargs): def browser_kwargs(**kwargs):
return {"binary": kwargs["binary"], return {
"debug_info": kwargs["debug_info"], "binary": kwargs["binary"],
"user_stylesheets": kwargs.get("user_stylesheets"), "debug_info": kwargs["debug_info"],
"render_backend": kwargs.get("servo_backend")} "user_stylesheets": kwargs.get("user_stylesheets"),
}
def executor_kwargs(test_type, server_config, cache_manager, run_info_data, **kwargs): def executor_kwargs(test_type, server_config, cache_manager, run_info_data, **kwargs):
@ -61,12 +64,8 @@ def env_options():
"supports_debugger": True} "supports_debugger": True}
def run_info_extras(**kwargs):
return {"backend": kwargs["servo_backend"]}
def update_properties(): def update_properties():
return ["debug", "os", "version", "processor", "bits", "backend"], None return ["debug", "os", "version", "processor", "bits"], None
def make_hosts_file(): def make_hosts_file():
@ -80,7 +79,7 @@ class ServoWebDriverBrowser(Browser):
used_ports = set() used_ports = set()
def __init__(self, logger, binary, debug_info=None, webdriver_host="127.0.0.1", def __init__(self, logger, binary, debug_info=None, webdriver_host="127.0.0.1",
user_stylesheets=None, render_backend="webrender"): user_stylesheets=None):
Browser.__init__(self, logger) Browser.__init__(self, logger)
self.binary = binary self.binary = binary
self.webdriver_host = webdriver_host self.webdriver_host = webdriver_host
@ -90,7 +89,6 @@ class ServoWebDriverBrowser(Browser):
self.hosts_path = make_hosts_file() self.hosts_path = make_hosts_file()
self.command = None self.command = None
self.user_stylesheets = user_stylesheets if user_stylesheets else [] self.user_stylesheets = user_stylesheets if user_stylesheets else []
self.render_backend = render_backend
def start(self): def start(self):
self.webdriver_port = get_free_port(4444, exclude=self.used_ports) self.webdriver_port = get_free_port(4444, exclude=self.used_ports)
@ -100,11 +98,15 @@ class ServoWebDriverBrowser(Browser):
env["HOST_FILE"] = self.hosts_path env["HOST_FILE"] = self.hosts_path
env["RUST_BACKTRACE"] = "1" env["RUST_BACKTRACE"] = "1"
debug_args, command = browser_command(self.binary, debug_args, command = browser_command(
[render_arg(self.render_backend), "--hard-fail", self.binary,
"--webdriver", str(self.webdriver_port), [
"about:blank"], "--hard-fail",
self.debug_info) "--webdriver", str(self.webdriver_port),
"about:blank",
],
self.debug_info
)
for stylesheet in self.user_stylesheets: for stylesheet in self.user_stylesheets:
command += ["--user-stylesheet", stylesheet] command += ["--user-stylesheet", stylesheet]

View file

@ -30,15 +30,10 @@ from ..webdriver_server import ServoDriverServer
from .executormarionette import WdspecRun from .executormarionette import WdspecRun
pytestrunner = None pytestrunner = None
render_arg = None
webdriver = None webdriver = None
extra_timeout = 5 # seconds extra_timeout = 5 # seconds
def do_delayed_imports():
global render_arg
from ..browsers.servo import render_arg
hosts_text = """127.0.0.1 web-platform.test hosts_text = """127.0.0.1 web-platform.test
127.0.0.1 www.web-platform.test 127.0.0.1 www.web-platform.test
127.0.0.1 www1.web-platform.test 127.0.0.1 www1.web-platform.test
@ -80,8 +75,10 @@ class ServoTestharnessExecutor(ProcessTestExecutor):
self.result_data = None self.result_data = None
self.result_flag = threading.Event() self.result_flag = threading.Event()
args = [render_arg(self.browser.render_backend), "--hard-fail", "-u", "Servo/wptrunner", args = [
"-Z", "replace-surrogates", "-z", self.test_url(test)] "--hard-fail", "-u", "Servo/wptrunner",
"-Z", "replace-surrogates", "-z", self.test_url(test),
]
for stylesheet in self.browser.user_stylesheets: for stylesheet in self.browser.user_stylesheets:
args += ["--user-stylesheet", stylesheet] args += ["--user-stylesheet", stylesheet]
for pref, value in test.environment.get('prefs', {}).iteritems(): for pref, value in test.environment.get('prefs', {}).iteritems():
@ -213,9 +210,12 @@ class ServoRefTestExecutor(ProcessTestExecutor):
with TempFilename(self.tempdir) as output_path: with TempFilename(self.tempdir) as output_path:
debug_args, command = browser_command( debug_args, command = browser_command(
self.binary, self.binary,
[render_arg(self.browser.render_backend), "--hard-fail", "--exit", [
"-u", "Servo/wptrunner", "-Z", "disable-text-aa,load-webfonts-synchronously,replace-surrogates", "--hard-fail", "--exit",
"--output=%s" % output_path, full_url] + self.browser.binary_args, "-u", "Servo/wptrunner",
"-Z", "disable-text-aa,load-webfonts-synchronously,replace-surrogates",
"--output=%s" % output_path, full_url
] + self.browser.binary_args,
self.debug_info) self.debug_info)
for stylesheet in self.browser.user_stylesheets: for stylesheet in self.browser.user_stylesheets:
@ -295,7 +295,7 @@ class ServoWdspecProtocol(Protocol):
def setup(self, runner): def setup(self, runner):
try: try:
self.server = ServoDriverServer(self.logger, binary=self.browser.binary, binary_args=self.browser.binary_args, render_backend=self.browser.render_backend) self.server = ServoDriverServer(self.logger, binary=self.browser.binary, binary_args=self.browser.binary_args)
self.server.start(block=False) self.server.start(block=False)
self.logger.info( self.logger.info(
"WebDriver HTTP server listening at %s" % self.server.url) "WebDriver HTTP server listening at %s" % self.server.url)

View file

@ -165,12 +165,11 @@ class GeckoDriverServer(WebDriverServer):
class ServoDriverServer(WebDriverServer): class ServoDriverServer(WebDriverServer):
def __init__(self, logger, binary="servo", binary_args=None, host="127.0.0.1", port=None, render_backend=None): def __init__(self, logger, binary="servo", binary_args=None, host="127.0.0.1", port=None):
env = os.environ.copy() env = os.environ.copy()
env["RUST_BACKTRACE"] = "1" env["RUST_BACKTRACE"] = "1"
WebDriverServer.__init__(self, logger, binary, host=host, port=port, env=env) WebDriverServer.__init__(self, logger, binary, host=host, port=port, env=env)
self.binary_args = binary_args self.binary_args = binary_args
self.render_backend = render_backend
def make_command(self): def make_command(self):
command = [self.binary, command = [self.binary,
@ -179,10 +178,6 @@ class ServoDriverServer(WebDriverServer):
"--headless"] "--headless"]
if self.binary_args: if self.binary_args:
command += self.binary_args command += self.binary_args
if self.render_backend == "cpu":
command += ["--cpu"]
elif self.render_backend == "webrender":
command += ["--webrender"]
return command return command

View file

@ -178,10 +178,6 @@ scheme host and port.""")
servo_group.add_argument("--user-stylesheet", servo_group.add_argument("--user-stylesheet",
default=[], action="append", dest="user_stylesheets", default=[], action="append", dest="user_stylesheets",
help="Inject a user CSS stylesheet into every test.") help="Inject a user CSS stylesheet into every test.")
servo_group.add_argument("--servo-backend",
default="webrender", choices=["cpu", "webrender"],
help="Rendering backend to use with Servo.")
parser.add_argument("test_list", nargs="*", parser.add_argument("test_list", nargs="*",
help="List of URLs for tests to run, or paths including tests to run. " help="List of URLs for tests to run, or paths including tests to run. "

View file

@ -3,4 +3,3 @@
expected: expected:
if os == "linux": TIMEOUT if os == "linux": TIMEOUT
if os == "mac": CRASH if os == "mac": CRASH
if not debug and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64) and (backend == "cpu"): CRASH

View file

@ -2,4 +2,3 @@
type: testharness type: testharness
expected: expected:
if os == "mac": CRASH if os == "mac": CRASH
if not debug and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64) and (backend == "cpu"): CRASH

View file

@ -3,4 +3,3 @@
expected: expected:
if os == "linux": TIMEOUT if os == "linux": TIMEOUT
if os == "mac": CRASH if os == "mac": CRASH
if not debug and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64) and (backend == "cpu"): CRASH

View file

@ -3,4 +3,3 @@
expected: expected:
if os == "linux": TIMEOUT if os == "linux": TIMEOUT
if os == "mac": CRASH if os == "mac": CRASH
if not debug and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64) and (backend == "cpu"): CRASH

View file

@ -3,4 +3,3 @@
expected: expected:
if os == "linux": TIMEOUT if os == "linux": TIMEOUT
if os == "mac": CRASH if os == "mac": CRASH
if not debug and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64) and (backend == "cpu"): CRASH

View file

@ -2,4 +2,3 @@
type: testharness type: testharness
expected: expected:
if os == "mac": CRASH if os == "mac": CRASH
if not debug and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64) and (backend == "cpu"): CRASH

View file

@ -2,4 +2,3 @@
type: testharness type: testharness
expected: expected:
if os == "mac": CRASH if os == "mac": CRASH
if not debug and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64) and (backend == "cpu"): CRASH

View file

@ -3,4 +3,3 @@
expected: expected:
if os == "linux": TIMEOUT if os == "linux": TIMEOUT
if os == "mac": CRASH if os == "mac": CRASH
if not debug and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64) and (backend == "cpu"): CRASH

View file

@ -3,4 +3,3 @@
expected: expected:
if os == "linux": TIMEOUT if os == "linux": TIMEOUT
if os == "mac": CRASH if os == "mac": CRASH
if not debug and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64) and (backend == "cpu"): CRASH

View file

@ -2,4 +2,3 @@
type: testharness type: testharness
expected: expected:
if os == "mac": CRASH if os == "mac": CRASH
if not debug and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64) and (backend == "cpu"): CRASH

View file

@ -2,4 +2,3 @@
type: testharness type: testharness
expected: expected:
if os == "mac": CRASH if os == "mac": CRASH
if not debug and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64) and (backend == "cpu"): CRASH

View file

@ -2,4 +2,3 @@
type: testharness type: testharness
expected: expected:
if os == "mac": CRASH if os == "mac": CRASH
if not debug and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64) and (backend == "cpu"): CRASH