Backed out changeset bec3fe861b06 (bug 1507283) for failures on /webdriver/tests/set_timeouts/set.py. CLOSED TREE
authorCsoregi Natalia <ncsoregi@mozilla.com>
Fri, 25 Jan 2019 17:25:23 +0200
changeset 515462 aefe78c0ffdfd7db65e03a893b75e36c8d8fb111
parent 515461 712eb70b540a195fb7435e3f390eb44dbe792840
child 515467 27ab766b2c4457b4f50aeaa6fb0a6417d21e839d
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1507283
milestone66.0a1
backs outbec3fe861b0652f81ba635eee4155b8063430d5a
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
Backed out changeset bec3fe861b06 (bug 1507283) for failures on /webdriver/tests/set_timeouts/set.py. CLOSED TREE
testing/webdriver/src/command.rs
--- a/testing/webdriver/src/command.rs
+++ b/testing/webdriver/src/command.rs
@@ -493,16 +493,17 @@ pub struct SwitchToWindowParameters {
 }
 
 #[derive(Debug, PartialEq, Serialize, Deserialize)]
 pub struct TakeScreenshotParameters {
     pub element: Option<WebElement>,
 }
 
 #[derive(Debug, PartialEq, Serialize, Deserialize)]
+#[serde(deny_unknown_fields)]
 pub struct TimeoutsParameters {
     #[serde(
         default, skip_serializing_if = "Option::is_none", deserialize_with = "deserialize_to_u64"
     )]
     pub implicit: Option<u64>,
     #[serde(
         default,
         rename = "pageLoad",
@@ -669,24 +670,16 @@ mod tests {
     fn test_json_action_parameters_empty_list() {
         let json = r#"{"actions":[]}"#;
         let data = ActionsParameters { actions: vec![] };
 
         check_deserialize(&json, &data);
     }
 
     #[test]
-    fn test_json_action_parameters_with_unknown_field() {
-        let json = r#"{"actions":[],"foo":"bar"}"#;
-        let data = ActionsParameters { actions: vec![] };
-
-        check_deserialize(&json, &data);
-    }
-
-    #[test]
     fn test_json_add_cookie_parameters_with_values() {
         let json = r#"{"cookie":{
             "name":"foo",
             "value":"bar",
             "path":"/",
             "domain":"foo.bar",
             "expiry":123,
             "secure":true,
@@ -753,38 +746,16 @@ mod tests {
     #[test]
     fn test_json_add_cookie_parameters_with_invalid_cookie_field() {
         let json = r#"{"name":"foo"}"#;
 
         assert!(serde_json::from_str::<AddCookieParameters>(&json).is_err());
     }
 
     #[test]
-    fn test_json_add_cookie_parameters_with_unknown_field() {
-        let json = r#"{"cookie":{
-            "name":"foo",
-            "value":"bar",
-            "secure":true,
-            "httpOnly":false,
-            "foo":"bar"
-        },"foo":"bar"}"#;
-        let data = AddCookieParameters {
-            name: "foo".into(),
-            value: "bar".into(),
-            path: None,
-            domain: None,
-            expiry: None,
-            secure: true,
-            httpOnly: false,
-        };
-
-        check_deserialize(&json, &data);
-    }
-
-    #[test]
     fn test_json_get_parameters_with_url() {
         let json = r#"{"url":"foo.bar"}"#;
         let data = GetParameters {
             url: "foo.bar".into(),
         };
 
         check_deserialize(&json, &data);
     }
@@ -799,26 +770,16 @@ mod tests {
     #[test]
     fn test_json_get_parameters_with_invalid_url_field() {
         let json = r#"{"foo":"bar"}"#;
 
         assert!(serde_json::from_str::<GetParameters>(&json).is_err());
     }
 
     #[test]
-    fn test_json_get_parameters_with_unknown_field() {
-        let json = r#"{"url":"foo.bar","foo":"bar"}"#;
-        let data = GetParameters {
-            url: "foo.bar".into(),
-        };
-
-        check_deserialize(&json, &data);
-    }
-
-    #[test]
     fn test_json_get_named_cookie_parameters_with_value() {
         let json = r#"{"name":"foo"}"#;
         let data = GetNamedCookieParameters {
             name: Some("foo".into()),
         };
 
         check_deserialize(&json, &data);
     }
@@ -842,26 +803,16 @@ mod tests {
     #[test]
     fn test_json_get_named_cookie_parameters_with_invalid_name_field() {
         let json = r#"{"name":3"#;
 
         assert!(serde_json::from_str::<GetNamedCookieParameters>(&json).is_err());
     }
 
     #[test]
-    fn test_json_get_named_cookie_parameters_with_unknown_field() {
-        let json = r#"{"name":"foo","foo":"bar"}"#;
-        let data = GetNamedCookieParameters {
-            name: Some("foo".into()),
-        };
-
-        check_deserialize(&json, &data);
-    }
-
-    #[test]
     fn test_json_javascript_command_parameters_with_values() {
         let json = r#"{"script":"foo","args":["1",2]}"#;
         let data = JavascriptCommandParameters {
             script: "foo".into(),
             args: Some(vec!["1".into(), 2.into()]),
         };
 
         check_deserialize(&json, &data);
@@ -906,27 +857,16 @@ mod tests {
     #[test]
     fn test_json_javascript_command_parameters_missing_script_field() {
         let json = r#"{"args":null}"#;
 
         assert!(serde_json::from_str::<JavascriptCommandParameters>(&json).is_err());
     }
 
     #[test]
-    fn test_json_javascript_command_parameters_with_unknown_field() {
-        let json = r#"{"script":"foo","foo":"bar"}"#;
-        let data = JavascriptCommandParameters {
-            script: "foo".into(),
-            args: None,
-        };
-
-        check_deserialize(&json, &data);
-    }
-
-    #[test]
     fn test_json_locator_parameters_with_values() {
         let json = r#"{"using":"xpath","value":"bar"}"#;
         let data = LocatorParameters {
             using: LocatorStrategy::XPath,
             value: "bar".into(),
         };
 
         check_deserialize(&json, &data);
@@ -956,27 +896,16 @@ mod tests {
     #[test]
     fn test_json_locator_parameters_missing_value_field() {
         let json = r#"{"using":"xpath"}"#;
 
         assert!(serde_json::from_str::<LocatorParameters>(&json).is_err());
     }
 
     #[test]
-    fn test_json_locator_parameters_with_unknown_field() {
-        let json = r#"{"using":"xpath","value":"bar","foo":"bar"}"#;
-        let data = LocatorParameters {
-            using: LocatorStrategy::XPath,
-            value: "bar".into(),
-        };
-
-        check_deserialize(&json, &data);
-    }
-
-    #[test]
     fn test_json_new_session_parameters_spec() {
         let json = r#"{"capabilities":{"alwaysMatch":{},"firstMatch":[{}]}}"#;
         let data = NewSessionParameters::Spec(SpecNewSessionParameters {
             alwaysMatch: Capabilities::new(),
             firstMatch: vec![Capabilities::new()],
         });
 
         check_deserialize(&json, &data);
@@ -1014,32 +943,16 @@ mod tests {
             alwaysMatch: Capabilities::new(),
             firstMatch: vec![Capabilities::new()],
         });
 
         check_deserialize(&json, &data);
     }
 
     #[test]
-    fn test_json_new_session_parameters_with_unknown_field() {
-        let json = r#"{
-            "capabilities":{
-                "alwaysMatch":{},
-                "firstMatch":[{}]
-            },
-            "foo":"bar"}"#;
-        let data = NewSessionParameters::Spec(SpecNewSessionParameters {
-            alwaysMatch: Capabilities::new(),
-            firstMatch: vec![Capabilities::new()],
-        });
-
-        check_deserialize(&json, &data);
-    }
-
-    #[test]
     fn test_json_new_window_parameters_without_type() {
         let json = r#"{}"#;
         let data = NewWindowParameters { type_hint: None };
 
         check_deserialize(&json, &data);
     }
 
     #[test]
@@ -1069,26 +982,16 @@ mod tests {
     #[test]
     fn test_json_new_window_parameters_with_invalid_type() {
         let json = r#"{"type":3}"#;
 
         assert!(serde_json::from_str::<NewWindowParameters>(&json).is_err());
     }
 
     #[test]
-    fn test_json_new_window_parameters_with_unknown_field() {
-        let json = r#"{"type":"tab","foo":"bar"}"#;
-        let data = NewWindowParameters {
-            type_hint: Some("tab".into())
-        };
-
-        check_deserialize(&json, &data);
-    }
-
-    #[test]
     fn test_json_send_keys_parameters_with_value() {
         let json = r#"{"text":"foo"}"#;
         let data = SendKeysParameters { text: "foo".into() };
 
         check_deserialize(&json, &data);
     }
 
     #[test]
@@ -1101,24 +1004,16 @@ mod tests {
     #[test]
     fn test_json_send_keys_parameters_missing_text_field() {
         let json = r#"{}"#;
 
         assert!(serde_json::from_str::<SendKeysParameters>(&json).is_err());
     }
 
     #[test]
-    fn test_json_send_keys_parameters_with_unknown_field() {
-        let json = r#"{"text":"foo","foo":"bar"}"#;
-        let data = SendKeysParameters { text: "foo".into() };
-
-        check_deserialize(&json, &data);
-    }
-
-    #[test]
     fn test_json_switch_to_frame_parameters_with_value() {
         let json = r#"{"id":3}"#;
         let data = SwitchToFrameParameters {
             id: Some(FrameId::Short(3)),
         };
 
         check_deserialize(&json, &data);
     }
@@ -1142,26 +1037,16 @@ mod tests {
     #[test]
     fn test_json_switch_to_frame_parameters_with_invalid_id_field() {
         let json = r#"{"id":"3"}"#;
 
         assert!(serde_json::from_str::<SwitchToFrameParameters>(&json).is_err());
     }
 
     #[test]
-    fn test_json_switch_to_frame_parameters_with_unknown_field() {
-        let json = r#"{"id":3,"foo":"bar"}"#;
-        let data = SwitchToFrameParameters {
-            id: Some(FrameId::Short(3)),
-        };
-
-        check_deserialize(&json, &data);
-    }
-
-    #[test]
     fn test_json_switch_to_window_parameters_with_value() {
         let json = r#"{"handle":"foo"}"#;
         let data = SwitchToWindowParameters {
             handle: "foo".into(),
         };
 
         check_deserialize(&json, &data);
     }
@@ -1176,26 +1061,16 @@ mod tests {
     #[test]
     fn test_json_switch_to_window_parameters_missing_handle_field() {
         let json = r#"{}"#;
 
         assert!(serde_json::from_str::<SwitchToWindowParameters>(&json).is_err());
     }
 
     #[test]
-    fn test_json_switch_to_window_parameters_with_unknown_field() {
-        let json = r#"{"handle":"foo","foo":"bar"}"#;
-        let data = SwitchToWindowParameters {
-            handle: "foo".into(),
-        };
-
-        check_deserialize(&json, &data);
-    }
-
-    #[test]
     fn test_json_take_screenshot_parameters_with_element() {
         let json = r#"{"element":{"element-6066-11e4-a52e-4f735466cecf":"elem"}}"#;
         let data = TakeScreenshotParameters {
             element: Some(WebElement::new("elem".into())),
         };
 
         check_deserialize(&json, &data);
     }
@@ -1218,26 +1093,16 @@ mod tests {
 
     #[test]
     fn test_json_take_screenshot_parameters_with_invalid_element_field() {
         let json = r#"{"element":"foo"}"#;
         assert!(serde_json::from_str::<TakeScreenshotParameters>(&json).is_err());
     }
 
     #[test]
-    fn test_json_take_screenshot_parameters_with_unknown_field() {
-        let json = r#"{"element":{"element-6066-11e4-a52e-4f735466cecf":"elem"},"foo":"bar"}"#;
-        let data = TakeScreenshotParameters {
-            element: Some(WebElement::new("elem".into())),
-        };
-
-        check_deserialize(&json, &data);
-    }
-
-    #[test]
     fn test_json_timeout_parameters_with_values() {
         let json = r#"{"implicit":0,"pageLoad":2.0,"script":9007199254740991}"#;
         let data = TimeoutsParameters {
             implicit: Some(0u64),
             page_load: Some(2u64),
             script: Some(Some(9007199254740991u64)),
         };
 
@@ -1265,28 +1130,16 @@ mod tests {
             page_load: None,
             script: None,
         };
 
         check_deserialize(&json, &data);
     }
 
     #[test]
-    fn test_json_timeout_parameters_with_unknown_field() {
-        let json = r#"{"script":60000,"foo":"bar"}"#;
-        let data = TimeoutsParameters {
-            implicit: None,
-            page_load: None,
-            script: Some(Some(60000)),
-        };
-
-        check_deserialize(&json, &data);
-    }
-
-    #[test]
     fn test_json_window_rect_parameters_with_values() {
         let json = r#"{"x":0,"y":1,"width":2,"height":3}"#;
         let data = WindowRectParameters {
             x: Some(0i32),
             y: Some(1i32),
             width: Some(2i32),
             height: Some(3i32),
         };
@@ -1327,22 +1180,9 @@ mod tests {
             x: Some(1),
             y: Some(2),
             width: Some(3),
             height: Some(4),
         };
 
         check_deserialize(&json, &data);
     }
-
-    #[test]
-    fn test_json_window_rect_parameters_with_unknown_field() {
-        let json = r#"{"x":1.1,"y":2.2,"foo":"bar"}"#;
-        let data = WindowRectParameters {
-            x: Some(1),
-            y: Some(2),
-            width: None,
-            height: None,
-        };
-
-        check_deserialize(&json, &data);
-    }
 }