webdriver: Fix parsing of FrameIds with Elements
authorJames Graham <james@hoppipolla.co.uk>
Fri, 06 Mar 2015 14:50:25 +0000
changeset 428012 4bc65981e01e76b9366947bf8f47e3981d055f02
parent 428011 b7d7af148781b4233ab2d3639382c7c75571e783
child 428013 7a255f401de1cf9706afb6d2bc7aa63434e782aa
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
webdriver: Fix parsing of FrameIds with Elements Source-Repo: https://github.com/mozilla/webdriver-rust Source-Revision: f0168a1510f08990dc5394050adade86dc548944
testing/webdriver/src/common.rs
--- a/testing/webdriver/src/common.rs
+++ b/testing/webdriver/src/common.rs
@@ -123,17 +123,18 @@ impl FrameId {
         match data {
             &Json::U64(x) => {
                 let id = try_opt!(x.to_u16(),
                                   ErrorStatus::NoSuchFrame,
                                   "frame id out of range");
                 Ok(FrameId::Short(id))
             },
             &Json::Null => Ok(FrameId::Null),
-            &Json::String(ref x) => Ok(FrameId::Element(WebElement::new(x.clone()))),
+            &Json::Object(_) => Ok(FrameId::Element(
+                try!(WebElement::from_json(data)))),
             _ => Err(WebDriverError::new(ErrorStatus::NoSuchFrame,
                                          "frame id has unexpected type"))
         }
     }
 }
 
 impl ToJson for FrameId {
     fn to_json(&self) -> Json {