From db786a43994a552acc78f33238efe91edd3da9fb Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 10 Dec 2018 18:42:49 -0500 Subject: [PATCH 1/5] Add debug output for webdriver commands. --- components/webdriver_server/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/webdriver_server/lib.rs b/components/webdriver_server/lib.rs index 93df193283e..472bc7ab00e 100644 --- a/components/webdriver_server/lib.rs +++ b/components/webdriver_server/lib.rs @@ -1159,6 +1159,8 @@ impl WebDriverHandler for Handler { _session: &Option, msg: WebDriverMessage, ) -> WebDriverResult { + info!("{:?}", msg.command); + // Unless we are trying to create a new session, we need to ensure that a // session has previously been created match msg.command { From b62a1ca66204160f3461503ed8c0b3ffbae573fd Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 10 Dec 2018 18:43:26 -0500 Subject: [PATCH 2/5] Delay setting the constellation's active browser id until the context exists. --- components/constellation/constellation.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 828db1ce88e..2f921537f2d 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -4034,17 +4034,16 @@ where /// Send the current frame tree to compositor fn send_frame_tree(&mut self, top_level_browsing_context_id: TopLevelBrowsingContextId) { - self.active_browser_id = Some(top_level_browsing_context_id); - let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id); - // Note that this function can panic, due to ipc-channel creation failure. // avoiding this panic would require a mechanism for dealing // with low-resource scenarios. - debug!( - "Sending frame tree for browsing context {}.", - browsing_context_id - ); + let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id); if let Some(frame_tree) = self.browsing_context_to_sendable(browsing_context_id) { + debug!( + "Sending frame tree for browsing context {}.", + browsing_context_id + ); + self.active_browser_id = Some(top_level_browsing_context_id); self.compositor_proxy .send(ToCompositorMsg::SetFrameTree(frame_tree)); } From 832b7963f23f987d1776b2a680dd1ecbe084d6bd Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 10 Dec 2018 19:06:51 -0500 Subject: [PATCH 3/5] Add headless support to servodriver harness. --- .../tools/wptrunner/wptrunner/browsers/servodriver.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/servodriver.py b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/servodriver.py index 1632f8f539c..a6e614cdb60 100644 --- a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/servodriver.py +++ b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/servodriver.py @@ -40,6 +40,7 @@ def browser_kwargs(test_type, run_info_data, config, **kwargs): "debug_info": kwargs["debug_info"], "server_config": config, "user_stylesheets": kwargs.get("user_stylesheets"), + "headless": kwargs.get("headless"), } @@ -75,7 +76,7 @@ class ServoWebDriverBrowser(Browser): init_timeout = 300 # Large timeout for cases where we're booting an Android emulator def __init__(self, logger, binary, debug_info=None, webdriver_host="127.0.0.1", - server_config=None, binary_args=None, user_stylesheets=None): + server_config=None, binary_args=None, user_stylesheets=None, headless=None): Browser.__init__(self, logger) self.binary = binary self.binary_args = binary_args or [] @@ -87,6 +88,7 @@ class ServoWebDriverBrowser(Browser): self.server_ports = server_config.ports if server_config else {} self.command = None self.user_stylesheets = user_stylesheets if user_stylesheets else [] + self.headless = headless if headless else False def start(self, **kwargs): self.webdriver_port = get_free_port(4444, exclude=self.used_ports) @@ -112,6 +114,9 @@ class ServoWebDriverBrowser(Browser): self.debug_info ) + if self.headless: + command += ["--headless"] + for stylesheet in self.user_stylesheets: command += ["--user-stylesheet", stylesheet] From 08b76ee73f714bae25f34605a6c8bbb1b08d81e5 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 10 Dec 2018 19:07:06 -0500 Subject: [PATCH 4/5] Add automated test for servodriver harness. --- etc/ci/buildbot_steps.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/ci/buildbot_steps.yml b/etc/ci/buildbot_steps.yml index 0b70fcff4f5..f2a8c5db887 100644 --- a/etc/ci/buildbot_steps.yml +++ b/etc/ci/buildbot_steps.yml @@ -14,6 +14,7 @@ mac-rel-wpt1: - ./mach test-wpt --release --processes 4 --total-chunks 6 --this-chunk 1 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log --always-succeed - ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --tracker-api default --reporter-api default - ./mach test-wpt --release --binary-arg=--multiprocess --processes 8 --log-raw test-wpt-mp.log --log-errorsummary wpt-mp-errorsummary.log eventsource + - ./mach test-wpt --release --product=servodriver --headless tests/wpt/mozilla/tests/mozilla/DOMParser.html tests/wpt/mozilla/tests/css/per_glyph_font_fallback_a.html tests/wpt/mozilla/tests/css/img_simple.html - bash ./etc/ci/lockfile_changed.sh mac-rel-wpt2: @@ -141,6 +142,7 @@ linux-rel-wpt: - ./mach test-wpt --release --processes 24 --total-chunks 2 --this-chunk 1 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log --always-succeed - ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --tracker-api default --reporter-api default - ./mach test-wpt --release --binary-arg=--multiprocess --processes 24 --log-raw test-wpt-mp.log --log-errorsummary wpt-mp-errorsummary.log eventsource + - ./mach test-wpt --release --product=servodriver --headless tests/wpt/mozilla/tests/mozilla/DOMParser.html tests/wpt/mozilla/tests/css/per_glyph_font_fallback_a.html tests/wpt/mozilla/tests/css/img_simple.html - ./etc/ci/clean_build_artifacts.sh linux-rel-css: From 6ab475b0f433e4dee97b64917c769d6e6ca5db6d Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Mon, 10 Dec 2018 19:22:28 -0500 Subject: [PATCH 5/5] Make SSL tests work in servodriver. --- etc/ci/buildbot_steps.yml | 4 ++-- tests/wpt/metadata/MANIFEST.json | 2 +- .../tools/wptrunner/wptrunner/browsers/servodriver.py | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/etc/ci/buildbot_steps.yml b/etc/ci/buildbot_steps.yml index f2a8c5db887..ef7db03bcc5 100644 --- a/etc/ci/buildbot_steps.yml +++ b/etc/ci/buildbot_steps.yml @@ -14,7 +14,7 @@ mac-rel-wpt1: - ./mach test-wpt --release --processes 4 --total-chunks 6 --this-chunk 1 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log --always-succeed - ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --tracker-api default --reporter-api default - ./mach test-wpt --release --binary-arg=--multiprocess --processes 8 --log-raw test-wpt-mp.log --log-errorsummary wpt-mp-errorsummary.log eventsource - - ./mach test-wpt --release --product=servodriver --headless tests/wpt/mozilla/tests/mozilla/DOMParser.html tests/wpt/mozilla/tests/css/per_glyph_font_fallback_a.html tests/wpt/mozilla/tests/css/img_simple.html + - ./mach test-wpt --release --product=servodriver --headless tests/wpt/mozilla/tests/mozilla/DOMParser.html tests/wpt/mozilla/tests/css/per_glyph_font_fallback_a.html tests/wpt/mozilla/tests/css/img_simple.html tests/wpt/mozilla/tests/mozilla/secure.https.html - bash ./etc/ci/lockfile_changed.sh mac-rel-wpt2: @@ -142,7 +142,7 @@ linux-rel-wpt: - ./mach test-wpt --release --processes 24 --total-chunks 2 --this-chunk 1 --log-raw test-wpt.log --log-errorsummary wpt-errorsummary.log --always-succeed - ./mach filter-intermittents wpt-errorsummary.log --log-intermittents intermittents.log --log-filteredsummary filtered-wpt-errorsummary.log --tracker-api default --reporter-api default - ./mach test-wpt --release --binary-arg=--multiprocess --processes 24 --log-raw test-wpt-mp.log --log-errorsummary wpt-mp-errorsummary.log eventsource - - ./mach test-wpt --release --product=servodriver --headless tests/wpt/mozilla/tests/mozilla/DOMParser.html tests/wpt/mozilla/tests/css/per_glyph_font_fallback_a.html tests/wpt/mozilla/tests/css/img_simple.html + - ./mach test-wpt --release --product=servodriver --headless tests/wpt/mozilla/tests/mozilla/DOMParser.html tests/wpt/mozilla/tests/css/per_glyph_font_fallback_a.html tests/wpt/mozilla/tests/css/img_simple.html tests/wpt/mozilla/tests/mozilla/secure.https.html - ./etc/ci/clean_build_artifacts.sh linux-rel-css: diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 54d82a98ee7..52191180bea 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -671067,7 +671067,7 @@ "support" ], "tools/wptrunner/wptrunner/browsers/servodriver.py": [ - "1632f8f539ced2807ea7fa89258f6db9ef4eb47c", + "44efb8950b68a593417e49be668148b5daa452f6", "support" ], "tools/wptrunner/wptrunner/browsers/webkit.py": [ diff --git a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/servodriver.py b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/servodriver.py index a6e614cdb60..44efb8950b6 100644 --- a/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/servodriver.py +++ b/tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/servodriver.py @@ -89,6 +89,7 @@ class ServoWebDriverBrowser(Browser): self.command = None self.user_stylesheets = user_stylesheets if user_stylesheets else [] self.headless = headless if headless else False + self.ca_certificate_path = server_config.ssl_config["ca_cert_path"] def start(self, **kwargs): self.webdriver_port = get_free_port(4444, exclude=self.used_ports) @@ -117,6 +118,9 @@ class ServoWebDriverBrowser(Browser): if self.headless: command += ["--headless"] + if self.ca_certificate_path: + command += ["--certificate-path", self.ca_certificate_path] + for stylesheet in self.user_stylesheets: command += ["--user-stylesheet", stylesheet]