Commits:
-
a3d21efc
by Elena at 2026-11-30T08:42:10+01:00
fixup! BB 44045: Disable ML features.
BB 45501: Disable ML tests.
-
95f578be
by Elena at 2026-11-30T08:42:10+01:00
fixup! TB 44806: Implement the tor integration in Rust.
TB 45505: Boilerplate to use gtest with the oxidized tor integration.
10 changed files:
Changes:
Cargo.lock
| ... |
... |
@@ -2986,6 +2986,7 @@ dependencies = [ |
|
2986
|
2986
|
"mp4parse-gtest",
|
|
2987
|
2987
|
"nsstring-gtest",
|
|
2988
|
2988
|
"swgl",
|
|
|
2989
|
+ "tor-service-gtest",
|
|
2989
|
2990
|
"xpcom-gtest",
|
|
2990
|
2991
|
]
|
|
2991
|
2992
|
|
| ... |
... |
@@ -8436,6 +8437,16 @@ version = "0.1.0" |
|
8436
|
8437
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
8437
|
8438
|
checksum = "aa7c7f42dea4b1b99439786f5633aeb9c14c1b53f75e282803c2ec2ad545873c"
|
|
8438
|
8439
|
|
|
|
8440
|
+[[package]]
|
|
|
8441
|
+name = "tor-service-gtest"
|
|
|
8442
|
+version = "0.1.0"
|
|
|
8443
|
+dependencies = [
|
|
|
8444
|
+ "nserror",
|
|
|
8445
|
+ "nsstring",
|
|
|
8446
|
+ "tor_service",
|
|
|
8447
|
+ "xpcom",
|
|
|
8448
|
+]
|
|
|
8449
|
+
|
|
8439
|
8450
|
[[package]]
|
|
8440
|
8451
|
name = "tor_provider"
|
|
8441
|
8452
|
version = "0.1.0"
|
ipc/glue/test/gtest/TestUtilityProcess.cpp
| ... |
... |
@@ -116,7 +116,7 @@ TEST_F(TestUtilityProcess, LaunchAllKinds) { |
|
116
|
116
|
// SandboxingKind::HW_INFERENCE does not exist on Android, and the test below
|
|
117
|
117
|
// also keeps a second utility process alive alongside it, which Android cannot
|
|
118
|
118
|
// do: it declares a single `utility` service.
|
|
119
|
|
-#ifndef ANDROID
|
|
|
119
|
+#ifndef BASE_BROWSER_VERSION
|
|
120
|
120
|
|
|
121
|
121
|
// Checks that a request arriving in the window right after teardown launches
|
|
122
|
122
|
// a fresh process. HWInferenceParent is bound to PHWInference, a separate
|
toolkit/components/tor-integration/moz.build
| ... |
... |
@@ -10,6 +10,8 @@ XPCOM_MANIFESTS += [ |
|
10
|
10
|
|
|
11
|
11
|
EXPORTS.torproject += ["TorService.h"]
|
|
12
|
12
|
|
|
|
13
|
+TEST_DIRS += ["test/gtest"]
|
|
|
14
|
+
|
|
13
|
15
|
XPCSHELL_TESTS_MANIFESTS += ["test/xpcshell/xpcshell.toml"]
|
|
14
|
16
|
|
|
15
|
17
|
MOZ_SRC_FILES += ["OxidationAdapters.sys.mjs", "OxidizedControlPort.sys.mjs"] |
toolkit/components/tor-integration/test/gtest/Cargo.toml
|
|
1
|
+[package]
|
|
|
2
|
+edition = "2021"
|
|
|
3
|
+name = "tor-service-gtest"
|
|
|
4
|
+version = "0.1.0"
|
|
|
5
|
+description = "Tests for the Tor Service crate"
|
|
|
6
|
+
|
|
|
7
|
+[dependencies]
|
|
|
8
|
+tor_service = { path = "../../tor_service", features = ["gtest"] }
|
|
|
9
|
+
|
|
|
10
|
+nserror = { path = "../../../../../xpcom/rust/nserror" }
|
|
|
11
|
+nsstring = { path = "../../../../../xpcom/rust/nsstring" }
|
|
|
12
|
+xpcom = { path = "../../../../../xpcom/rust/xpcom" }
|
|
|
13
|
+
|
|
|
14
|
+[lib]
|
|
|
15
|
+path = "test.rs" |
toolkit/components/tor-integration/test/gtest/moz.build
|
|
1
|
+# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
2
|
+# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
3
|
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
4
|
+
|
|
|
5
|
+FINAL_LIBRARY = "xul-gtest" |
toolkit/components/tor-integration/test/gtest/test.rs
|
|
1
|
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
2
|
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
3
|
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
4
|
+
|
|
|
5
|
+#[macro_use]
|
|
|
6
|
+extern crate xpcom; |
toolkit/components/tor-integration/tor_service/Cargo.toml
| ... |
... |
@@ -25,3 +25,6 @@ log = "0.4" |
|
25
|
25
|
serde = { version = "1.0", features = ["derive"] }
|
|
26
|
26
|
serde_json = "1.0"
|
|
27
|
27
|
thin-vec = { version = "0.2.1", features = ["gecko-ffi"] }
|
|
|
28
|
+
|
|
|
29
|
+[features]
|
|
|
30
|
+gtest = [] |
toolkit/library/gtest/rust/Cargo.toml
| ... |
... |
@@ -24,6 +24,8 @@ kvstore-gtest = { path = "../../../components/kvstore/test/gtest" } |
|
24
|
24
|
mozglue-static = { path = "../../../../mozglue/static/rust" }
|
|
25
|
25
|
swgl = { path = "../../../../gfx/wr/swgl" }
|
|
26
|
26
|
|
|
|
27
|
+tor-service-gtest = { path = "../../../components/tor-integration/test/gtest", optional = true }
|
|
|
28
|
+
|
|
27
|
29
|
[lib]
|
|
28
|
30
|
path = "lib.rs"
|
|
29
|
31
|
crate-type = ["staticlib"]
|
toolkit/library/gtest/rust/lib.rs
| ... |
... |
@@ -13,4 +13,6 @@ extern crate l10nregistry_ffi_gtest; |
|
13
|
13
|
extern crate moz_task_gtest;
|
|
14
|
14
|
extern crate mp4parse_gtest;
|
|
15
|
15
|
extern crate nsstring_gtest;
|
|
|
16
|
+#[cfg(feature = "tor-service-gtest")]
|
|
|
17
|
+extern crate tor_service_gtest;
|
|
16
|
18
|
extern crate xpcom_gtest; |
toolkit/library/gtest/rust/moz.build
| ... |
... |
@@ -7,6 +7,9 @@ include("../../rust/gkrust-features.mozbuild") |
|
7
|
7
|
if CONFIG["FUZZING_INTERFACES"]:
|
|
8
|
8
|
gkrust_features += ["gecko-fuzz-targets"]
|
|
9
|
9
|
|
|
|
10
|
+if CONFIG["TOR_RUST_INTEGRATION"]:
|
|
|
11
|
+ gkrust_features += ["tor-service-gtest"]
|
|
|
12
|
+
|
|
10
|
13
|
RustLibrary(
|
|
11
|
14
|
"gkrust-gtest",
|
|
12
|
15
|
gkrust_features,
|
|