Auto merge of #22411 - jdm:fix-webdriver, r=SimonSapin

Make desktop webdriver WPT harness work

This change allows me to run `./mach test-wpt --product servodriver --no-pause-after-test tests/wpt/mozilla/tests/mozilla/DOMParser.html` successfully again.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22409
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22411)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-12-11 13:03:52 -05:00 committed by GitHub
commit 92962de76c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 9 deletions

View file

@ -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));
}

View file

@ -1159,6 +1159,8 @@ impl WebDriverHandler<ServoExtensionRoute> for Handler {
_session: &Option<Session>,
msg: WebDriverMessage<ServoExtensionRoute>,
) -> WebDriverResult<WebDriverResponse> {
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 {