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>
This commit is contained in:
Josh Matthews 2025-01-07 03:57:14 -05:00 committed by GitHub
parent 8a68d47409
commit 17e2ca3f01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 43 additions and 34 deletions

View file

@ -2112,7 +2112,7 @@ impl Window {
let (sender, receiver) = ipc::channel().expect("Failed to create IPC channel!"); let (sender, receiver) = ipc::channel().expect("Failed to create IPC channel!");
let event = ScriptMsg::SetLayoutEpoch(epoch, sender); let event = ScriptMsg::SetLayoutEpoch(epoch, sender);
self.send_to_constellation(event); self.send_to_constellation(event);
receiver.recv().unwrap(); let _ = receiver.recv();
} }
pub fn layout_reflow(&self, query_msg: QueryMsg, can_gc: CanGc) -> bool { pub fn layout_reflow(&self, query_msg: QueryMsg, can_gc: CanGc) -> bool {

View file

@ -426,9 +426,6 @@ impl Handler {
} }
fn focus_top_level_browsing_context_id(&self) -> WebDriverResult<TopLevelBrowsingContextId> { 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."); debug!("Getting focused context.");
let interval = 20; let interval = 20;
let iterations = 30_000 / interval; let iterations = 30_000 / interval;

View file

@ -502604,7 +502604,7 @@
[] []
], ],
"servodriver.py": [ "servodriver.py": [
"1e9a2f3090ef1ff826dac4ca3a88a958242ffae6", "d3cc341babecb750ad55862997e52efcdc4c7491",
[] []
], ],
"webkit.py": [ "webkit.py": [

View file

@ -10521,6 +10521,10 @@
"e2c2de8556c7fa88f54a76a3c18e06be14722de9", "e2c2de8556c7fa88f54a76a3c18e06be14722de9",
[] []
], ],
"max-session-history-frame.html": [
"192c7235d061b439ef2b57d4b01b170b7412dcdc",
[]
],
"nested_asap_script.js": [ "nested_asap_script.js": [
"59562a8c9c39130cad411815059513c4ce0a7c04", "59562a8c9c39130cad411815059513c4ce0a7c04",
[] []
@ -14004,7 +14008,7 @@
] ]
}, },
"servo-max-session-history.html": [ "servo-max-session-history.html": [
"e49616b326009da98f35bd0384d1715c38a40998", "79fe4073601d7cbe9620132b281065aa6903af47",
[ [
null, null,
{} {}

View file

@ -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>

View file

@ -4,33 +4,11 @@
<script src="/resources/testharnessreport.js"></script> <script src="/resources/testharnessreport.js"></script>
</head> </head>
<body></body> <body></body>
<iframe src="max-session-history-frame.html"></iframe>
<script> <script>
// This test goes forward by X pages, then back by Y pages, let t = async_test("Forward then back triggered a reload.");
// then checks to see if that triggered a reload. onmessage = t.step_func(() => {
// If it did, the document must have been discarded, t.done();
});
// 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);
}
</script> </script>
</html> </html>

View file

@ -87,7 +87,7 @@ class ServoWebDriverBrowser(WebDriverBrowser):
args = [ args = [
"--hard-fail", "--hard-fail",
"--webdriver=%s" % port, "--webdriver=%s" % port,
"about:blank", "data:,",
] ]
ca_cert_path = server_config.ssl_config["ca_cert_path"] ca_cert_path = server_config.ssl_config["ca_cert_path"]