aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2025-01-07 03:57:14 -0500
committerGitHub <noreply@github.com>2025-01-07 08:57:14 +0000
commit17e2ca3f013e2ff8e7d7bca08d93c6c723a2b71d (patch)
treed9c750daf44bd68375e461781054f27ed1802028
parent8a68d47409559777d6b39c0bc4a5b4fe391794be (diff)
downloadservo-17e2ca3f013e2ff8e7d7bca08d93c6c723a2b71d.tar.gz
servo-17e2ca3f013e2ff8e7d7bca08d93c6c723a2b71d.zip
Various servodriver fixes (#34871)
* servodriver: Set initial URL to data:, instead of about:blank. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Ignore failed epoch update messages. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Make servo-max-session-history.html use an iframe. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
-rw-r--r--components/script/dom/window.rs2
-rw-r--r--components/webdriver_server/lib.rs3
-rw-r--r--tests/wpt/meta/MANIFEST.json2
-rw-r--r--tests/wpt/mozilla/meta/MANIFEST.json6
-rw-r--r--tests/wpt/mozilla/tests/mozilla/max-session-history-frame.html30
-rw-r--r--tests/wpt/mozilla/tests/mozilla/servo-max-session-history.html32
-rw-r--r--tests/wpt/tests/tools/wptrunner/wptrunner/browsers/servodriver.py2
7 files changed, 43 insertions, 34 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 61ee2412880..06df94b187d 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -2112,7 +2112,7 @@ impl Window {
let (sender, receiver) = ipc::channel().expect("Failed to create IPC channel!");
let event = ScriptMsg::SetLayoutEpoch(epoch, sender);
self.send_to_constellation(event);
- receiver.recv().unwrap();
+ let _ = receiver.recv();
}
pub fn layout_reflow(&self, query_msg: QueryMsg, can_gc: CanGc) -> bool {
diff --git a/components/webdriver_server/lib.rs b/components/webdriver_server/lib.rs
index 05746ac4423..4eb20c06b96 100644
--- a/components/webdriver_server/lib.rs
+++ b/components/webdriver_server/lib.rs
@@ -426,9 +426,6 @@ impl Handler {
}
fn focus_top_level_browsing_context_id(&self) -> WebDriverResult<TopLevelBrowsingContextId> {
- // FIXME(#34550): This is a hack for unexpected behaviour in the constellation.
- thread::sleep(Duration::from_millis(1000));
-
debug!("Getting focused context.");
let interval = 20;
let iterations = 30_000 / interval;
diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json
index d248c65d75b..142efac0ba5 100644
--- a/tests/wpt/meta/MANIFEST.json
+++ b/tests/wpt/meta/MANIFEST.json
@@ -502604,7 +502604,7 @@
[]
],
"servodriver.py": [
- "1e9a2f3090ef1ff826dac4ca3a88a958242ffae6",
+ "d3cc341babecb750ad55862997e52efcdc4c7491",
[]
],
"webkit.py": [
diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json
index cda69f9407c..0e36ca7dca4 100644
--- a/tests/wpt/mozilla/meta/MANIFEST.json
+++ b/tests/wpt/mozilla/meta/MANIFEST.json
@@ -10521,6 +10521,10 @@
"e2c2de8556c7fa88f54a76a3c18e06be14722de9",
[]
],
+ "max-session-history-frame.html": [
+ "192c7235d061b439ef2b57d4b01b170b7412dcdc",
+ []
+ ],
"nested_asap_script.js": [
"59562a8c9c39130cad411815059513c4ce0a7c04",
[]
@@ -14004,7 +14008,7 @@
]
},
"servo-max-session-history.html": [
- "e49616b326009da98f35bd0384d1715c38a40998",
+ "79fe4073601d7cbe9620132b281065aa6903af47",
[
null,
{}
diff --git a/tests/wpt/mozilla/tests/mozilla/max-session-history-frame.html b/tests/wpt/mozilla/tests/mozilla/max-session-history-frame.html
new file mode 100644
index 00000000000..192c7235d06
--- /dev/null
+++ b/tests/wpt/mozilla/tests/mozilla/max-session-history-frame.html
@@ -0,0 +1,30 @@
+<script>
+ onload = () => {
+ // This test goes forward by X pages, then back by Y pages,
+ // then checks to see if that triggered a reload.
+ // If it did, the document must have been discarded,
+
+ // The current page number (stored in the URL search string)
+ var page_number = location.search.substring(1) | 0;
+
+ // The number of pages to go forward by.
+ // This should be more than go_back_by, to ensure that
+ // we actually do more than one back traversal.
+ var go_forward_by = 24;
+
+ // The number of pages to go back by.
+ // This should be more than the default session-history.max-length pref,
+ // to ensure that going back reloads the page.
+ var go_back_by = Math.min(page_number, 21);
+
+ if (history.length < go_forward_by) {
+ // Keep loading new pages until we have loaded enough of them.
+ location.assign("?" + (page_number + 1));
+ } else if (page_number === 0) {
+ parent.postMessage("done");
+ } else {
+ // Otherwise, go back.
+ history.go(-go_back_by);
+ }
+ }
+</script>
diff --git a/tests/wpt/mozilla/tests/mozilla/servo-max-session-history.html b/tests/wpt/mozilla/tests/mozilla/servo-max-session-history.html
index e49616b3260..79fe4073601 100644
--- a/tests/wpt/mozilla/tests/mozilla/servo-max-session-history.html
+++ b/tests/wpt/mozilla/tests/mozilla/servo-max-session-history.html
@@ -4,33 +4,11 @@
<script src="/resources/testharnessreport.js"></script>
</head>
<body></body>
+<iframe src="max-session-history-frame.html"></iframe>
<script>
- // This test goes forward by X pages, then back by Y pages,
- // then checks to see if that triggered a reload.
- // If it did, the document must have been discarded,
-
- // The current page number (stored in the URL search string)
- var page_number = location.search.substring(1) | 0;
-
- // The number of pages to go forward by.
- // This should be more than go_back_by, to ensure that
- // we actually do more than one back traversal.
- var go_forward_by = 24;
-
- // The number of pages to go back by.
- // This should be more than the default session-history.max-length pref,
- // to ensure that going back reloads the page.
- var go_back_by = Math.min(page_number, 21);
-
- if (history.length < go_forward_by) {
- // Keep loading new pages until we have loaded enough of them.
- location.assign("?" + (page_number + 1));
- } else if (page_number === 0) {
- // If we got back to the beginning, we must have triggered reloads.
- test(function() {}, "Forward then back triggered a reload.");
- } else {
- // Otherwise, go back.
- history.go(-go_back_by);
- }
+ let t = async_test("Forward then back triggered a reload.");
+ onmessage = t.step_func(() => {
+ t.done();
+ });
</script>
</html>
diff --git a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/servodriver.py b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/servodriver.py
index 1e9a2f3090e..d3cc341babe 100644
--- a/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/servodriver.py
+++ b/tests/wpt/tests/tools/wptrunner/wptrunner/browsers/servodriver.py
@@ -87,7 +87,7 @@ class ServoWebDriverBrowser(WebDriverBrowser):
args = [
"--hard-fail",
"--webdriver=%s" % port,
- "about:blank",
+ "data:,",
]
ca_cert_path = server_config.ssl_config["ca_cert_path"]