mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Verify webview
still open in webdriver switch frame command (#37411)
SwitchToParentFrame webdriver commands do not handle the case where the current top-level browsing context has been closed. Tests: `./tests/wpt/tests/webdriver/tests/classic/switch_to_parent_frame/switch.py` `./tests/wpt/tests/webdriver/tests/classic/switch_to_frame/switch.py` Signed-off-by: batu_hoang <longvatrong111@gmail.com>
This commit is contained in:
parent
1bbdcb1911
commit
4c598037a5
3 changed files with 7 additions and 12 deletions
|
@ -1043,6 +1043,8 @@ impl Handler {
|
|||
&mut self,
|
||||
parameters: &SwitchToFrameParameters,
|
||||
) -> WebDriverResult<WebDriverResponse> {
|
||||
self.verify_top_level_browsing_context_is_open(self.session()?.webview_id)?;
|
||||
|
||||
use webdriver::common::FrameId;
|
||||
let frame_id = match parameters.id {
|
||||
FrameId::Top => {
|
||||
|
@ -1058,6 +1060,11 @@ impl Handler {
|
|||
}
|
||||
|
||||
fn handle_switch_to_parent_frame(&mut self) -> WebDriverResult<WebDriverResponse> {
|
||||
let webview_id = self.session()?.webview_id;
|
||||
self.verify_top_level_browsing_context_is_open(webview_id)?;
|
||||
if self.session()?.browsing_context_id == webview_id {
|
||||
return Ok(WebDriverResponse::Void);
|
||||
}
|
||||
self.switch_to_frame(WebDriverFrameId::Parent)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,6 @@
|
|||
[switch.py]
|
||||
[test_no_top_browsing_context[None\]]
|
||||
expected: FAIL
|
||||
|
||||
[test_no_top_browsing_context[0\]]
|
||||
expected: FAIL
|
||||
|
||||
[test_no_browsing_context[0\]]
|
||||
expected: FAIL
|
||||
|
||||
[test_no_browsing_context[id2\]]
|
||||
expected: FAIL
|
||||
|
||||
[test_no_browsing_context_when_already_top_level]
|
||||
expected: FAIL
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[switch.py]
|
||||
[test_switch_from_top_level]
|
||||
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue