mirror of
https://github.com/lexmount/moli.git
synced 2026-11-21 16:03:10 +00:00
test(scripts): gate stylesheet completion on script execution
This commit is contained in:
@@ -30,9 +30,9 @@ pub use cdp::discover_browser_websocket_url;
|
||||
struct FixtureRuntimeState {
|
||||
dynamic_stylesheet_dcl: Arc<FixtureEvent>,
|
||||
dynamic_stylesheet_script_executed: Arc<FixtureEvent>,
|
||||
alternate_stylesheet_probe_executed: Arc<FixtureEvent>,
|
||||
runtime_inline_module_executed: Arc<FixtureEvent>,
|
||||
runtime_stylesheet_snapshot_applied: Arc<FixtureEvent>,
|
||||
alternate_stylesheet_probe_executed: Arc<FixtureEvent>,
|
||||
runtime_owned_async_script_executed: Arc<FixtureEvent>,
|
||||
parse_time_async_task_first_executed: Arc<FixtureEvent>,
|
||||
parse_time_async_task_visibility_first_executed: Arc<FixtureEvent>,
|
||||
|
||||
@@ -4647,13 +4647,6 @@ pub(super) async fn asset_blocking_stylesheet_alternate_probe_script() -> Respon
|
||||
javascript_response(BLOCKING_STYLESHEET_ALTERNATE_PROBE_JS)
|
||||
}
|
||||
|
||||
pub(super) async fn asset_runtime_inline_module_executed(
|
||||
Extension(state): Extension<FixtureRuntimeState>,
|
||||
) -> StatusCode {
|
||||
state.runtime_inline_module_executed.signal();
|
||||
StatusCode::NO_CONTENT
|
||||
}
|
||||
|
||||
pub(super) async fn asset_blocking_stylesheet_alternate_probe_executed(
|
||||
Extension(state): Extension<FixtureRuntimeState>,
|
||||
) -> StatusCode {
|
||||
@@ -4661,6 +4654,13 @@ pub(super) async fn asset_blocking_stylesheet_alternate_probe_executed(
|
||||
StatusCode::NO_CONTENT
|
||||
}
|
||||
|
||||
pub(super) async fn asset_runtime_inline_module_executed(
|
||||
Extension(state): Extension<FixtureRuntimeState>,
|
||||
) -> StatusCode {
|
||||
state.runtime_inline_module_executed.signal();
|
||||
StatusCode::NO_CONTENT
|
||||
}
|
||||
|
||||
pub(super) async fn runtime_stylesheet_snapshot_applied(
|
||||
Extension(state): Extension<FixtureRuntimeState>,
|
||||
) -> StatusCode {
|
||||
@@ -5712,18 +5712,18 @@ async fn script_gated_stylesheet(event: &FixtureEvent) -> Response {
|
||||
css_response(BLOCKING_STYLESHEET_SLOW_CSS)
|
||||
}
|
||||
|
||||
pub(super) async fn asset_runtime_inline_module_gated_css(
|
||||
Extension(state): Extension<FixtureRuntimeState>,
|
||||
) -> Response {
|
||||
script_gated_stylesheet(&state.runtime_inline_module_executed).await
|
||||
}
|
||||
|
||||
pub(super) async fn asset_blocking_stylesheet_alternate_gated_css(
|
||||
Extension(state): Extension<FixtureRuntimeState>,
|
||||
) -> Response {
|
||||
script_gated_stylesheet(&state.alternate_stylesheet_probe_executed).await
|
||||
}
|
||||
|
||||
pub(super) async fn asset_runtime_inline_module_gated_css(
|
||||
Extension(state): Extension<FixtureRuntimeState>,
|
||||
) -> Response {
|
||||
script_gated_stylesheet(&state.runtime_inline_module_executed).await
|
||||
}
|
||||
|
||||
pub(super) async fn asset_runtime_stylesheet_snapshot_gated_css(
|
||||
Extension(state): Extension<FixtureRuntimeState>,
|
||||
) -> Response {
|
||||
|
||||
@@ -2420,14 +2420,6 @@ pub(super) fn build_router() -> Router {
|
||||
"/assets/blocking_stylesheet_alternate_probe.js",
|
||||
get(asset_blocking_stylesheet_alternate_probe_script),
|
||||
)
|
||||
.route(
|
||||
"/assets/runtime_inline_module_executed",
|
||||
get(asset_runtime_inline_module_executed),
|
||||
)
|
||||
.route(
|
||||
"/assets/runtime_inline_module_gated.css",
|
||||
get(asset_runtime_inline_module_gated_css),
|
||||
)
|
||||
.route(
|
||||
"/assets/blocking_stylesheet_alternate_probe_executed",
|
||||
get(asset_blocking_stylesheet_alternate_probe_executed),
|
||||
@@ -2436,6 +2428,14 @@ pub(super) fn build_router() -> Router {
|
||||
"/assets/blocking_stylesheet_alternate_gated.css",
|
||||
get(asset_blocking_stylesheet_alternate_gated_css),
|
||||
)
|
||||
.route(
|
||||
"/assets/runtime_inline_module_executed",
|
||||
get(asset_runtime_inline_module_executed),
|
||||
)
|
||||
.route(
|
||||
"/assets/runtime_inline_module_gated.css",
|
||||
get(asset_runtime_inline_module_gated_css),
|
||||
)
|
||||
.route(
|
||||
"/assets/dynamic_blocking_stylesheet_runtime.js",
|
||||
get(asset_dynamic_blocking_stylesheet_runtime_script),
|
||||
|
||||
Reference in New Issue
Block a user