summaryrefslogtreecommitdiffstats
path: root/third_party/rust/glean/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:33 +0000
commit086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch)
treea4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /third_party/rust/glean/tests
parentAdding debian version 124.0.1-1. (diff)
downloadfirefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz
firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/glean/tests')
-rw-r--r--third_party/rust/glean/tests/init_fails.rs2
-rw-r--r--third_party/rust/glean/tests/never_init.rs2
-rw-r--r--third_party/rust/glean/tests/no_time_to_init.rs2
-rw-r--r--third_party/rust/glean/tests/schema.rs13
-rw-r--r--third_party/rust/glean/tests/simple.rs2
-rw-r--r--third_party/rust/glean/tests/upload_timing.rs10
6 files changed, 11 insertions, 20 deletions
diff --git a/third_party/rust/glean/tests/init_fails.rs b/third_party/rust/glean/tests/init_fails.rs
index def5acc4b9..a0c23ca277 100644
--- a/third_party/rust/glean/tests/init_fails.rs
+++ b/third_party/rust/glean/tests/init_fails.rs
@@ -43,7 +43,7 @@ mod pings {
#[allow(non_upper_case_globals)]
pub static validation: Lazy<PingType> =
- Lazy::new(|| glean::private::PingType::new("validation", true, true, true, vec![]));
+ Lazy::new(|| glean::private::PingType::new("validation", true, true, true, true, vec![]));
}
/// Test scenario: Glean initialization fails.
diff --git a/third_party/rust/glean/tests/never_init.rs b/third_party/rust/glean/tests/never_init.rs
index 3df472ee31..0d0d3768ff 100644
--- a/third_party/rust/glean/tests/never_init.rs
+++ b/third_party/rust/glean/tests/never_init.rs
@@ -39,7 +39,7 @@ mod pings {
#[allow(non_upper_case_globals)]
pub static validation: Lazy<PingType> =
- Lazy::new(|| glean::private::PingType::new("validation", true, true, true, vec![]));
+ Lazy::new(|| glean::private::PingType::new("validation", true, true, true, true, vec![]));
}
/// Test scenario: Glean is never initialized.
diff --git a/third_party/rust/glean/tests/no_time_to_init.rs b/third_party/rust/glean/tests/no_time_to_init.rs
index 763835f2f3..c312b397af 100644
--- a/third_party/rust/glean/tests/no_time_to_init.rs
+++ b/third_party/rust/glean/tests/no_time_to_init.rs
@@ -41,7 +41,7 @@ mod pings {
#[allow(non_upper_case_globals)]
pub static validation: Lazy<PingType> =
- Lazy::new(|| glean::private::PingType::new("validation", true, true, true, vec![]));
+ Lazy::new(|| glean::private::PingType::new("validation", true, true, true, true, vec![]));
}
/// Test scenario: Glean initialization fails.
diff --git a/third_party/rust/glean/tests/schema.rs b/third_party/rust/glean/tests/schema.rs
index 0a1bf4d2e8..01a2108b3c 100644
--- a/third_party/rust/glean/tests/schema.rs
+++ b/third_party/rust/glean/tests/schema.rs
@@ -10,7 +10,7 @@ use glean_core::TextMetric;
use jsonschema_valid::{self, schemas::Draft};
use serde_json::Value;
-use glean::net::UploadResult;
+use glean::net::{PingUploadRequest, UploadResult};
use glean::private::*;
use glean::{
traits, ClientInfoMetrics, CommonMetricData, ConfigurationBuilder, HistogramType, MemoryUnit,
@@ -60,13 +60,8 @@ fn validate_against_schema() {
sender: crossbeam_channel::Sender<Vec<u8>>,
}
impl glean::net::PingUploader for ValidatingUploader {
- fn upload(
- &self,
- _url: String,
- body: Vec<u8>,
- _headers: Vec<(String, String)>,
- ) -> UploadResult {
- self.sender.send(body).unwrap();
+ fn upload(&self, ping_request: PingUploadRequest) -> UploadResult {
+ self.sender.send(ping_request.body).unwrap();
UploadResult::http_status(200)
}
}
@@ -176,7 +171,7 @@ fn validate_against_schema() {
text_metric.set("loooooong text".repeat(100));
// Define a new ping and submit it.
- let custom_ping = glean::private::PingType::new(PING_NAME, true, true, true, vec![]);
+ let custom_ping = glean::private::PingType::new(PING_NAME, true, true, true, true, vec![]);
custom_ping.submit(None);
// Wait for the ping to arrive.
diff --git a/third_party/rust/glean/tests/simple.rs b/third_party/rust/glean/tests/simple.rs
index 3685d44faa..3baa4df14e 100644
--- a/third_party/rust/glean/tests/simple.rs
+++ b/third_party/rust/glean/tests/simple.rs
@@ -41,7 +41,7 @@ mod pings {
#[allow(non_upper_case_globals)]
pub static validation: Lazy<PingType> =
- Lazy::new(|| glean::private::PingType::new("validation", true, true, true, vec![]));
+ Lazy::new(|| glean::private::PingType::new("validation", true, true, true, true, vec![]));
}
/// Test scenario: A clean run
diff --git a/third_party/rust/glean/tests/upload_timing.rs b/third_party/rust/glean/tests/upload_timing.rs
index 9e77fc3eb5..ba0eee3402 100644
--- a/third_party/rust/glean/tests/upload_timing.rs
+++ b/third_party/rust/glean/tests/upload_timing.rs
@@ -97,7 +97,7 @@ mod pings {
#[allow(non_upper_case_globals)]
pub static validation: Lazy<PingType> =
- Lazy::new(|| glean::private::PingType::new("validation", true, true, true, vec![]));
+ Lazy::new(|| glean::private::PingType::new("validation", true, true, true, true, vec![]));
}
// Define a fake uploader that sleeps.
@@ -108,13 +108,9 @@ struct FakeUploader {
}
impl net::PingUploader for FakeUploader {
- fn upload(
- &self,
- _url: String,
- body: Vec<u8>,
- _headers: Vec<(String, String)>,
- ) -> net::UploadResult {
+ fn upload(&self, upload_request: net::PingUploadRequest) -> net::UploadResult {
let calls = self.calls.fetch_add(1, Ordering::SeqCst);
+ let body = upload_request.body;
let decode = |body: Vec<u8>| {
let mut gzip_decoder = GzDecoder::new(&body[..]);
let mut s = String::with_capacity(body.len());