diff --git a/Cargo.lock b/Cargo.lock
index 0f9a5a4dba8..d6e12bf7afa 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3088,7 +3088,6 @@ dependencies = [
"app_units 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "embedder_traits 0.0.1",
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/components/bluetooth_traits/Cargo.toml b/components/bluetooth_traits/Cargo.toml
index c1d84570765..c0d01079449 100644
--- a/components/bluetooth_traits/Cargo.toml
+++ b/components/bluetooth_traits/Cargo.toml
@@ -14,3 +14,6 @@ ipc-channel = "0.10"
regex = "0.2"
serde = "1.0"
embedder_traits = { path = "../embedder_traits" }
+
+[dev-dependencies]
+embedder_traits = { path = "../embedder_traits", features = ["tests"] }
diff --git a/components/config/Cargo.toml b/components/config/Cargo.toml
index fdab7afc61a..9dcd4c627e3 100644
--- a/components/config/Cargo.toml
+++ b/components/config/Cargo.toml
@@ -26,6 +26,7 @@ url = "1.2"
[dev-dependencies]
env_logger = "0.5"
+embedder_traits = { path = "../embedder_traits", features = ["tests"] }
[target.'cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))'.dependencies]
xdg = "2.0"
diff --git a/components/config/tests/opts.rs b/components/config/tests/opts.rs
index 23e9bae4341..53a049e103c 100644
--- a/components/config/tests/opts.rs
+++ b/components/config/tests/opts.rs
@@ -2,10 +2,8 @@
* 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/. */
-extern crate embedder_traits;
extern crate servo_config;
-use embedder_traits::resources::register_resources_for_tests;
use servo_config::opts::{parse_url_or_filename, parse_pref_from_command_line};
use servo_config::prefs::{PrefValue, PREFS};
use std::path::Path;
@@ -75,7 +73,6 @@ fn test_argument_parsing_special() {
#[test]
fn test_parse_pref_from_command_line() {
- register_resources_for_tests();
// Test with boolean values.
parse_pref_from_command_line("testtrue=true");
assert_eq!(*PREFS.get("testtrue"), PrefValue::Boolean(true));
diff --git a/components/config/tests/prefs.rs b/components/config/tests/prefs.rs
index dc11f0939a6..0b50d51ac8e 100644
--- a/components/config/tests/prefs.rs
+++ b/components/config/tests/prefs.rs
@@ -2,10 +2,8 @@
* 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/. */
-extern crate embedder_traits;
extern crate servo_config;
-use embedder_traits::resources::register_resources_for_tests;
use servo_config::basedir;
use servo_config::prefs::{PREFS, PrefValue, read_prefs};
use std::fs::{self, File};
@@ -28,7 +26,6 @@ fn test_create_pref() {
#[test]
fn test_get_set_reset_extend() {
- register_resources_for_tests();
let json_str = "{\
\"layout.writing-mode.enabled\": true,\
\"extra.stuff\": false,\
diff --git a/components/constellation/Cargo.toml b/components/constellation/Cargo.toml
index 8787e67618b..d582c55deb9 100644
--- a/components/constellation/Cargo.toml
+++ b/components/constellation/Cargo.toml
@@ -43,3 +43,6 @@ webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
[target.'cfg(all(not(target_os = "windows"), not(target_os = "ios")))'.dependencies]
gaol = {git = "https://github.com/servo/gaol"}
+
+[dev-dependencies]
+embedder_traits = { path = "../embedder_traits", features = ["tests"] }
diff --git a/components/embedder_traits/Cargo.toml b/components/embedder_traits/Cargo.toml
index 5d4db8f8063..9146893b13d 100644
--- a/components/embedder_traits/Cargo.toml
+++ b/components/embedder_traits/Cargo.toml
@@ -9,5 +9,8 @@ publish = false
name = "embedder_traits"
path = "lib.rs"
+[features]
+tests = []
+
[dependencies]
lazy_static = "1"
diff --git a/components/embedder_traits/resources.rs b/components/embedder_traits/resources.rs
index 2f301e21340..603a2a83c28 100644
--- a/components/embedder_traits/resources.rs
+++ b/components/embedder_traits/resources.rs
@@ -2,14 +2,18 @@
* 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 std::env;
-use std::fs::File;
-use std::io::Read;
use std::path::PathBuf;
-use std::sync::{Once, ONCE_INIT, RwLock};
+use std::sync::RwLock;
lazy_static! {
- static ref RES: RwLock