Skip to content

Commit

Permalink
Auto merge of #18710 - mhaessig:remove-rustc-serialize, r=jdm
Browse files Browse the repository at this point in the history
Replace rustc_serialize with serde_json in style_tests

#12410 Stop using rustc_serialize

Replaced rustc_serialize with serde_json in
- [ ] ~~components/config/Cargo.toml~~
- [ ] ~~components/config/lib.rs~~
- [ ] ~~components/config/prefs.rs~~
- [ ] ~~components/script_traits/Cargo.toml~~
- [ ] ~~components/script_traits/lib.rs~~
- [ ] ~~components/script_traits/webdriver_msg.rs~~
- [ ] ~~components/webdriver_server/Cargo.toml~~
- [ ] ~~components/webdriver_server/lib.rs~~
- [X] tests/unit/style/Cargo.toml
- [X] test/unit/style/lib.rs
- [X] test/unit/style/properties/scaffolding.rs

PR checks:
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [X] These changes fix (partially) #12410.
- [X] These changes do not require tests because functionality was not changed or a test itself was edited

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18710)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Nov 15, 2017
2 parents c988460 + 93cee84 commit 2977a4e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/unit/style/Cargo.toml
Expand Up @@ -17,7 +17,7 @@ euclid = "0.15"
html5ever = "0.21"
parking_lot = "0.4"
rayon = "0.8"
rustc-serialize = "0.3"
serde_json = "1.0"
selectors = {path = "../../../components/selectors"}
servo_arc = {path = "../../../components/servo_arc"}
servo_atoms = {path = "../../../components/atoms"}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/style/lib.rs
Expand Up @@ -11,8 +11,8 @@ extern crate euclid;
#[macro_use] extern crate html5ever;
extern crate parking_lot;
extern crate rayon;
extern crate rustc_serialize;
extern crate selectors;
extern crate serde_json;
extern crate servo_arc;
extern crate servo_atoms;
extern crate servo_config;
Expand Down
9 changes: 5 additions & 4 deletions tests/unit/style/properties/scaffolding.rs
Expand Up @@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use rustc_serialize::json::Json;
use serde_json::{self, Value};
use std::env;
use std::fs::{File, remove_file};
use std::path::Path;
Expand All @@ -25,10 +25,11 @@ fn properties_list_json() {
.status()
.unwrap();
assert!(status.success());
let properties = Json::from_reader(&mut File::open(json).unwrap()).unwrap();

let properties: Value = serde_json::from_reader(File::open(json).unwrap()).unwrap();
assert!(properties.as_object().unwrap().len() > 100);
assert!(properties.find("margin").is_some());
assert!(properties.find("margin-top").is_some());
assert!(properties.as_object().unwrap().contains_key("margin"));
assert!(properties.as_object().unwrap().contains_key("margin-top"));
}

#[cfg(windows)]
Expand Down

0 comments on commit 2977a4e

Please sign in to comment.