From 28ac0abf6a1aeb8540d1b41526c0fccffa749ce9 Mon Sep 17 00:00:00 2001 From: James Graham Date: Tue, 28 Apr 2015 18:16:23 +0100 Subject: Make WebDriver Get() command wait on pages loading before returning. This makes using WebDriver significantly less racy. Also refactors the message structure a little --- components/script/script_task.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'components/script/script_task.rs') diff --git a/components/script/script_task.rs b/components/script/script_task.rs index c9d92497a04..df838f130e8 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -726,7 +726,7 @@ impl ScriptTask { self.handle_update_subpage_id(containing_pipeline_id, old_subpage_id, new_subpage_id), ConstellationControlMsg::FocusIFrame(containing_pipeline_id, subpage_id) => self.handle_focus_iframe_msg(containing_pipeline_id, subpage_id), - ConstellationControlMsg::WebDriverCommand(pipeline_id, msg) => + ConstellationControlMsg::WebDriverScriptCommand(pipeline_id, msg) => self.handle_webdriver_msg(pipeline_id, msg), ConstellationControlMsg::TickAllAnimations(pipeline_id) => self.handle_tick_all_animations(pipeline_id), @@ -801,8 +801,8 @@ impl ScriptTask { fn handle_webdriver_msg(&self, pipeline_id: PipelineId, msg: WebDriverScriptCommand) { let page = self.root_page(); match msg { - WebDriverScriptCommand::EvaluateJS(script, reply) => - webdriver_handlers::handle_evaluate_js(&page, pipeline_id, script, reply), + WebDriverScriptCommand::ExecuteScript(script, reply) => + webdriver_handlers::handle_execute_script(&page, pipeline_id, script, reply), WebDriverScriptCommand::FindElementCSS(selector, reply) => webdriver_handlers::handle_find_element_css(&page, pipeline_id, selector, reply), WebDriverScriptCommand::FindElementsCSS(selector, reply) => -- cgit v1.2.3