From 79743b5358c989da23c11c025509dd2c46dba48b Mon Sep 17 00:00:00 2001 From: Alan Jeffrey Date: Mon, 22 May 2017 09:40:17 -0500 Subject: Webdriver uses browsing context ids rather than pipeline ids. --- components/script/webdriver_handlers.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'components/script/webdriver_handlers.rs') diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs index 7bc31263c25..1aa2ad05dab 100644 --- a/components/script/webdriver_handlers.rs +++ b/components/script/webdriver_handlers.rs @@ -29,6 +29,7 @@ use hyper_serde::Serde; use ipc_channel::ipc::{self, IpcSender}; use js::jsapi::{HandleValue, JSContext}; use js::jsval::UndefinedValue; +use msg::constellation_msg::BrowsingContextId; use msg::constellation_msg::PipelineId; use net_traits::CookieSource::{HTTP, NonHTTP}; use net_traits::CoreResourceMsg::{GetCookiesDataForUrl, SetCookieForUrl}; @@ -109,23 +110,23 @@ pub fn handle_execute_async_script(documents: &Documents, window.upcast::().evaluate_js_on_global_with_result(&eval, rval.handle_mut()); } -pub fn handle_get_pipeline_id(documents: &Documents, - pipeline: PipelineId, - webdriver_frame_id: WebDriverFrameId, - reply: IpcSender, ()>>) { +pub fn handle_get_browsing_context_id(documents: &Documents, + pipeline: PipelineId, + webdriver_frame_id: WebDriverFrameId, + reply: IpcSender>) { let result = match webdriver_frame_id { WebDriverFrameId::Short(_) => { // This isn't supported yet - Ok(None) + Err(()) }, WebDriverFrameId::Element(x) => { find_node_by_unique_id(documents, pipeline, x) - .and_then(|node| node.downcast::().map(|elem| elem.pipeline_id())) + .and_then(|node| node.downcast::().and_then(|elem| elem.browsing_context_id())) .ok_or(()) }, WebDriverFrameId::Parent => { documents.find_window(pipeline) - .map(|window| window.parent_info().map(|(parent_id, _)| parent_id)) + .and_then(|window| window.window_proxy().parent().map(|parent| parent.browsing_context_id())) .ok_or(()) } }; -- cgit v1.2.3