Skip hardware live readback

This commit is contained in:
2026-05-13 01:41:58 -04:00
parent c19e6923c3
commit 6ce5df83a8
6 changed files with 202 additions and 84 deletions
+13 -11
View File
@@ -183,7 +183,7 @@ impl WebSurfaceFrame {
#[cfg(all(test, feature = "live-site-smoke"))]
pub(super) fn size(&self) -> WebSurfaceSize {
WebSurfaceSize { width: self.width, height: self.height }
WebSurfaceSize { width: self.width, height: self.height, device_pixel_ratio_percent: 100 }
}
#[cfg(all(test, feature = "live-site-smoke"))]
@@ -204,16 +204,6 @@ impl WebSurfaceFrame {
self.loaded_url.as_deref()
}
#[cfg(all(test, feature = "live-site-smoke"))]
pub(super) fn click_point(&self) -> Option<WebSurfaceClickPoint> {
self.click_point
}
#[cfg(all(test, feature = "live-site-smoke"))]
pub(super) fn typed_text(&self) -> Option<&str> {
self.typed_text.as_deref()
}
#[cfg(all(test, feature = "live-site-smoke"))]
pub(super) fn non_white_pixel_count(&self) -> u64 {
self.non_white_pixel_count
@@ -228,6 +218,18 @@ impl WebSurfaceFrame {
pub(super) fn sample_hash(&self) -> u64 {
self.sample_hash
}
#[cfg(all(test, feature = "live-site-smoke"))]
pub(super) fn has_hardware_surface(&self) -> bool {
#[cfg(target_os = "macos")]
{
self.pixel_buffer.is_some()
}
#[cfg(not(target_os = "macos"))]
{
false
}
}
}
struct WebSurfaceFrameParts {
@@ -152,7 +152,12 @@ fn wait_for_ready_frame(
fn validate_prd_frame(frame: &WebSurfaceFrame, case: &LiveSiteCase) -> Result<(), String> {
require(
frame.size() == WebSurfaceSize { width: LIVE_SURFACE_WIDTH, height: LIVE_SURFACE_HEIGHT },
frame.size()
== WebSurfaceSize {
width: LIVE_SURFACE_WIDTH,
height: LIVE_SURFACE_HEIGHT,
device_pixel_ratio_percent: 100,
},
format!("{} size: {:?}", case.url, frame.size()),
)?;
require(
@@ -172,6 +177,9 @@ fn validate_prd_frame(frame: &WebSurfaceFrame, case: &LiveSiteCase) -> Result<()
frame.detail_label() == format!("{} 934x657", frame.render_state()),
format!("{} detail: {}", case.url, frame.detail_label()),
)?;
if frame.has_hardware_surface() {
return Ok(());
}
require(frame.non_white_pixel_count() > 0, case.url.to_string())?;
require(
frame.content_pixel_count() >= MINIMUM_CONTENT_PIXELS,