-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement browsingContext.historyUpdated (#2656)
Spec: w3c/webdriver-bidi#740 WPT: web-platform-tests/wpt#48347 --------- Co-authored-by: browser-automation-bot <133232582+browser-automation-bot@users.noreply.github.com>
- Loading branch information
1 parent
06ad2d0
commit 48d496a
Showing
5 changed files
with
112 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright 2024 Google LLC. | ||
# Copyright (c) Microsoft Corporation. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
import pytest | ||
from test_helpers import (goto_url, read_JSON_message, send_JSON_command, | ||
subscribe) | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_browsingContext_historyUpdated_event(websocket, context_id, | ||
url_base): | ||
await subscribe(websocket, ["browsingContext.historyUpdated"]) | ||
|
||
await goto_url(websocket, context_id, url_base) | ||
|
||
await send_JSON_command( | ||
websocket, { | ||
"method": "script.evaluate", | ||
"params": { | ||
"expression": "history.replaceState(null, '', '#test');", | ||
"target": { | ||
"context": context_id, | ||
}, | ||
"awaitPromise": False | ||
} | ||
}) | ||
|
||
response = await read_JSON_message(websocket) | ||
assert response == { | ||
'type': 'event', | ||
"method": "browsingContext.historyUpdated", | ||
"params": { | ||
"context": context_id, | ||
"url": url_base + "#test", | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...river/headful/webdriver/tests/bidi/browsing_context/fragment_navigated/history_api.py.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[history_api.py] | ||
[test_history_push_state[-#foo\]] | ||
expected: FAIL | ||
|
||
[test_history_push_state[#foo-#bar\]] | ||
expected: FAIL | ||
|
||
[test_history_push_state[#foo-#foo\]] | ||
expected: FAIL | ||
|
||
[test_history_push_state[#bar-\]] | ||
expected: FAIL |
12 changes: 12 additions & 0 deletions
12
...iver/headless/webdriver/tests/bidi/browsing_context/fragment_navigated/history_api.py.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[history_api.py] | ||
[test_history_push_state[-#foo\]] | ||
expected: FAIL | ||
|
||
[test_history_push_state[#foo-#bar\]] | ||
expected: FAIL | ||
|
||
[test_history_push_state[#foo-#foo\]] | ||
expected: FAIL | ||
|
||
[test_history_push_state[#bar-\]] | ||
expected: FAIL |
12 changes: 12 additions & 0 deletions
12
...pper/headless/webdriver/tests/bidi/browsing_context/fragment_navigated/history_api.py.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[history_api.py] | ||
[test_history_push_state[-#foo\]] | ||
expected: FAIL | ||
|
||
[test_history_push_state[#foo-#bar\]] | ||
expected: FAIL | ||
|
||
[test_history_push_state[#foo-#foo\]] | ||
expected: FAIL | ||
|
||
[test_history_push_state[#bar-\]] | ||
expected: FAIL |