Fix a webdriver timeout during server start up

When sending a webdriver load URL command soon enough after starting Servo,
that command could time out with a logged warning:

```
constellation: Webdriver load for closed browsing context (0,2).
```

When `closed` in this case really meant not opened yet.
This commit is contained in:
Simon Sapin 2018-07-19 16:32:47 +02:00
parent 4acdb81197
commit 48f6e168d4

View file

@ -931,7 +931,12 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF>
FromCompositorMsg::GetFocusTopLevelBrowsingContext(resp_chan) => {
let focus_browsing_context = self.focus_pipeline_id
.and_then(|pipeline_id| self.pipelines.get(&pipeline_id))
.map(|pipeline| pipeline.top_level_browsing_context_id);
.map(|pipeline| pipeline.top_level_browsing_context_id)
.filter(|&top_level_browsing_context_id| {
let browsing_context_id =
BrowsingContextId::from(top_level_browsing_context_id);
self.browsing_contexts.contains_key(&browsing_context_id)
});
let _ = resp_chan.send(focus_browsing_context);
}
FromCompositorMsg::KeyEvent(ch, key, state, modifiers) => {