Skip to content

Commit 70a684a

Browse files
committed
Update heck, remove ureq
1 parent 4db8307 commit 70a684a

3 files changed

Lines changed: 21 additions & 16 deletions

File tree

chromiumoxide_cdp/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ include = ["src/**/*", "*.pdl", "LICENSE-*"]
1414

1515
[dev-dependencies]
1616
chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.9" }
17-
ureq = "2.10.0"
18-
tempfile = "3.10.1"
17+
reqwest = { version = "0.13", features = ["rustls"], default-features = false }
18+
tempfile = "3.10"
19+
tokio = { version = "1", features = ["rt", "fs", "process", "macros"] }
1920

2021
[dependencies]
2122
chromiumoxide_pdl = { path = "../chromiumoxide_pdl", version = "0.9" }

chromiumoxide_cdp/tests/generate.rs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ fn generated_code_is_fresh() {
3535
}
3636

3737
/// Check that the PDL files are up to date
38-
#[test]
39-
fn pdl_is_fresh() {
38+
#[tokio::test]
39+
async fn pdl_is_fresh() {
4040
const BASE_URL: &str = "https://raw.githubusercontent.com/ChromeDevTools/devtools-protocol";
4141

4242
let dir = Path::new(env!("CARGO_MANIFEST_DIR"));
@@ -48,12 +48,13 @@ fn pdl_is_fresh() {
4848
.unwrap_or_else(|_| dir.join("pdl/js_protocol.pdl"));
4949

5050
let js_proto_old = fs::read_to_string(&js_proto).unwrap_or_default();
51-
let js_proto_new = ureq::get(&format!(
51+
let js_proto_new = reqwest::get(&format!(
5252
"{BASE_URL}/{CURRENT_REVISION}/pdl/js_protocol.pdl",
5353
))
54-
.call()
54+
.await
5555
.unwrap()
56-
.into_string()
56+
.text()
57+
.await
5758
.unwrap();
5859
assert!(js_proto_new.contains("The Chromium Authors"));
5960

@@ -68,12 +69,13 @@ fn pdl_is_fresh() {
6869
.unwrap_or_else(|_| dir.join("pdl/browser_protocol.pdl"));
6970

7071
let browser_proto_old = fs::read_to_string(&browser_proto).unwrap_or_default();
71-
let browser_proto_new = ureq::get(&format!(
72+
let browser_proto_new = reqwest::get(&format!(
7273
"{BASE_URL}/{CURRENT_REVISION}/pdl/browser_protocol.pdl"
7374
))
74-
.call()
75+
.await
7576
.unwrap()
76-
.into_string()
77+
.text()
78+
.await
7779
.unwrap();
7880
assert!(browser_proto_new.contains("The Chromium Authors"));
7981

@@ -95,11 +97,13 @@ fn pdl_is_fresh() {
9597
let include_path = dir.join("pdl").join(include);
9698

9799
let include_proto_old = fs::read_to_string(&include_path).unwrap_or_default();
98-
let include_proto_new = ureq::get(&format!("{BASE_URL}/{CURRENT_REVISION}/pdl/{include}"))
99-
.call()
100-
.unwrap()
101-
.into_string()
102-
.unwrap();
100+
let include_proto_new =
101+
reqwest::get(&format!("{BASE_URL}/{CURRENT_REVISION}/pdl/{include}"))
102+
.await
103+
.unwrap()
104+
.text()
105+
.await
106+
.unwrap();
103107
assert!(include_proto_new.contains("The Chromium Authors"));
104108

105109
if include_proto_new != include_proto_old {

chromiumoxide_pdl/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ once_cell = "1.8.0"
1616
regex = "1.5.4"
1717
quote = "1.0.10"
1818
proc-macro2 = "1.0.32"
19-
heck = "0.4"
19+
heck = "0.5"
2020
serde_json = "1"
2121
serde = { version = "1", features = ["derive"], optional = true }
2222
chromiumoxide_types = { path = "../chromiumoxide_types", version = "0.9" }

0 commit comments

Comments
 (0)