From 55f908653f6fb02c344459319a7ca87487cfa4bf Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Sat, 9 Mar 2024 03:29:43 +0100 Subject: [PATCH] compositor: Remove the `is_running_problem_test` setting (#31589) These tests don't seem to time out any longer and this mechanism is probably better served by some sort of adjustment to `RUST_LOG` in the WPT harness. --- components/compositing/compositor.rs | 41 ++++------------------- components/config/opts.rs | 17 +--------- components/constellation/constellation.rs | 15 ++------- components/servo/lib.rs | 2 -- ports/servoshell/lib.rs | 3 -- 5 files changed, 11 insertions(+), 67 deletions(-) diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 8830ddee79e..fbee79dc232 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -232,8 +232,6 @@ pub struct IOCompositor { /// Whether to invalidate `prev_offscreen_framebuffer` at the end of the next frame. invalidate_prev_offscreen_framebuffer: bool, - is_running_problem_test: bool, - /// True to exit after page load ('-x'). exit_after_load: bool, @@ -384,7 +382,6 @@ impl IOCompositor { window: Rc, state: InitialCompositorState, composite_target: CompositeTarget, - is_running_problem_test: bool, exit_after_load: bool, convert_mouse_to_touch: bool, top_level_browsing_context_id: TopLevelBrowsingContextId, @@ -426,7 +423,6 @@ impl IOCompositor { next_offscreen_framebuffer: OnceCell::new(), prev_offscreen_framebuffer: None, invalidate_prev_offscreen_framebuffer: false, - is_running_problem_test, exit_after_load, convert_mouse_to_touch, pending_frames: 0, @@ -439,7 +435,6 @@ impl IOCompositor { window: Rc, state: InitialCompositorState, composite_target: CompositeTarget, - is_running_problem_test: bool, exit_after_load: bool, convert_mouse_to_touch: bool, top_level_browsing_context_id: TopLevelBrowsingContextId, @@ -448,7 +443,6 @@ impl IOCompositor { window, state, composite_target, - is_running_problem_test, exit_after_load, convert_mouse_to_touch, top_level_browsing_context_id, @@ -594,14 +588,8 @@ impl IOCompositor { ); if is_ready && self.pending_frames == 0 { self.ready_to_save_state = ReadyState::ReadyToSaveImage; - if self.is_running_problem_test { - println!("ready to save image!"); - } } else { self.ready_to_save_state = ReadyState::Unknown; - if self.is_running_problem_test { - println!("resetting ready_to_save_state!"); - } } self.composite_if_necessary(CompositingReason::Headless); }, @@ -1709,9 +1697,6 @@ impl IOCompositor { // for saving. // Reset the flag so that we check again in the future // TODO: only reset this if we load a new document? - if self.is_running_problem_test { - println!("was ready to save, resetting ready_to_save_state"); - } self.ready_to_save_state = ReadyState::Unknown; Ok(()) }, @@ -1728,14 +1713,8 @@ impl IOCompositor { self.start_shutting_down(); } }, - Err(e) => { - if self.is_running_problem_test { - if e != UnableToComposite::NotReadyToPaintImage( - NotReadyToPaint::WaitingOnConstellation, - ) { - println!("not ready to composite: {:?}", e); - } - } + Err(error) => { + trace!("Unable to composite: {error:?}"); }, } } @@ -1985,17 +1964,11 @@ impl IOCompositor { } fn composite_if_necessary(&mut self, reason: CompositingReason) { - if self.composition_request == CompositionRequest::NoCompositingNecessary { - if self.is_running_problem_test { - println!("updating composition_request ({:?})", reason); - } - self.composition_request = CompositionRequest::CompositeNow(reason) - } else if self.is_running_problem_test { - println!( - "composition_request is already {:?}", - self.composition_request - ); - } + trace!( + "Will schedule a composite {reason:?}. Previously was {:?}", + self.composition_request + ); + self.composition_request = CompositionRequest::CompositeNow(reason) } fn clear_background(&self) { diff --git a/components/config/opts.rs b/components/config/opts.rs index 43348fccc2e..0f909148859 100644 --- a/components/config/opts.rs +++ b/components/config/opts.rs @@ -27,8 +27,6 @@ use crate::{pref, set_pref}; /// Global flags for Servo, currently set on the command line. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Opts { - pub is_running_problem_test: bool, - /// Whether or not the legacy layout system is enabled. pub legacy_layout: bool, @@ -398,7 +396,6 @@ pub fn multiprocess() -> bool { pub fn default_opts() -> Opts { Opts { - is_running_problem_test: false, legacy_layout: false, tile_size: 512, time_profiling: None, @@ -598,18 +595,6 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR DebugOptions::print_usage(app_name) } - let cwd = env::current_dir().unwrap(); - let url_opt = if !opt_match.free.is_empty() { - Some(&opt_match.free[0][..]) - } else { - None - }; - let is_running_problem_test = url_opt.as_ref().map_or(false, |url| { - url.starts_with("http://web-platform.test:8000/2dcontext/drawing-images-to-the-canvas/") || - url.starts_with("http://web-platform.test:8000/_mozilla/mozilla/canvas/") || - url.starts_with("http://web-platform.test:8000/_mozilla/css/canvas_over_area.html") - }); - let tile_size: usize = match opt_match.opt_str("s") { Some(tile_size_str) => tile_size_str .parse() @@ -733,6 +718,7 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR .opt_strs("user-stylesheet") .iter() .map(|filename| { + let cwd = env::current_dir().unwrap(); let path = cwd.join(filename); let url = ServoUrl::from_url(Url::from_file_path(&path).unwrap()); let mut contents = Vec::new(); @@ -754,7 +740,6 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR let opts = Opts { debug: debug_options.clone(), - is_running_problem_test, legacy_layout, tile_size, time_profiling, diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index b478845c66f..bed908bc798 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -475,8 +475,6 @@ pub struct Constellation { /// currently being pressed. pressed_mouse_buttons: u16, - is_running_problem_test: bool, - /// If True, exits on thread failure instead of displaying about:failure hard_fail: bool, @@ -621,7 +619,6 @@ where initial_window_size: WindowSizeData, random_pipeline_closure_probability: Option, random_pipeline_closure_seed: Option, - is_running_problem_test: bool, hard_fail: bool, enable_canvas_antialiasing: bool, canvas_create_sender: Sender, @@ -807,7 +804,6 @@ where canvas_ipc_sender, pending_approval_navigations: HashMap::new(), pressed_mouse_buttons: 0, - is_running_problem_test, hard_fail, enable_canvas_antialiasing, glplayer_threads: state.glplayer_threads, @@ -1450,15 +1446,10 @@ where FromCompositorMsg::IsReadyToSaveImage(pipeline_states) => { let is_ready = self.handle_is_ready_to_save_image(pipeline_states); debug!("Ready to save image {:?}.", is_ready); - if self.is_running_problem_test { - println!("got ready to save image query, result is {:?}", is_ready); - } - let is_ready = is_ready == ReadyToSave::Ready; self.compositor_proxy - .send(CompositorMsg::IsReadyToSaveImageReply(is_ready)); - if self.is_running_problem_test { - println!("sent response"); - } + .send(CompositorMsg::IsReadyToSaveImageReply( + is_ready == ReadyToSave::Ready, + )); }, // Create a new top level browsing context. Will use response_chan to return // the browsing context id. diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 7c25f74df8b..eed1a3d84be 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -460,7 +460,6 @@ where webxr_main_thread, }, composite_target, - opts.is_running_problem_test, opts.exit_after_load, opts.debug.convert_mouse_to_touch, top_level_browsing_context_id, @@ -992,7 +991,6 @@ fn create_constellation( initial_window_size, opts.random_pipeline_closure_probability, opts.random_pipeline_closure_seed, - opts.is_running_problem_test, opts.hard_fail, !opts.debug.disable_canvas_antialiasing, canvas_create_sender, diff --git a/ports/servoshell/lib.rs b/ports/servoshell/lib.rs index 2c24e11572b..fb33982cf16 100644 --- a/ports/servoshell/lib.rs +++ b/ports/servoshell/lib.rs @@ -96,9 +96,6 @@ pub fn main() { ArgumentParsingResult::ContentProcess(matches, token) => { opts_matches = matches; content_process_token = Some(token); - if opts::get().is_running_problem_test && env::var("RUST_LOG").is_err() { - env::set_var("RUST_LOG", "compositing::constellation"); - } }, ArgumentParsingResult::ChromeProcess(matches) => { opts_matches = matches;