mirror of
https://github.com/lexmount/moli.git
synced 2026-11-15 08:08:07 +00:00
test(navigation): await traversal and background target load
Wait for the destination traversal state and the background session load notification before inspecting document contents. A best-effort stability result or navigation acknowledgement does not establish either completion boundary.
This commit is contained in:
@@ -2547,7 +2547,7 @@ async fn navigation_activation_cross_document_back_destination_surface() -> Resu
|
||||
let dest_url =
|
||||
server.url("/compat/navigation-activation-cross-document-back-destination-surface-dest");
|
||||
|
||||
let page = browser
|
||||
let mut page = browser
|
||||
.fetch_with_wait_until(
|
||||
&source_url,
|
||||
RenderedDomWaitUntil::DomStable,
|
||||
@@ -2555,6 +2555,7 @@ async fn navigation_activation_cross_document_back_destination_surface() -> Resu
|
||||
)
|
||||
.await?;
|
||||
|
||||
wait_for_body_attribute(&browser, &mut page, "data-navigation-type", "traverse").await?;
|
||||
assert_eq!(page.final_url().as_str(), source_url);
|
||||
assert_cross_document_traversal_activation_destination_surface(
|
||||
&page.serialize_html_async().await.unwrap(),
|
||||
|
||||
@@ -294,6 +294,11 @@ async fn runtime_add_binding_then_navigation_on_auto_attached_background_target_
|
||||
consume_main_document_navigation_start(&mut ctx);
|
||||
let navigation = take_response_by_id(&mut ctx, 10353);
|
||||
assert_eq!(navigation["result"]["frameId"], json!(second_target_id));
|
||||
ctx.wait_for_scheduler_message("background target load after navigation", |message| {
|
||||
message["method"] == json!("Page.loadEventFired")
|
||||
&& message["sessionId"].as_str() == Some(session_id.as_str())
|
||||
})
|
||||
.await;
|
||||
ctx.take_all();
|
||||
|
||||
ctx.process_async(json!({
|
||||
|
||||
Reference in New Issue
Block a user