summaryrefslogtreecommitdiffstats
path: root/crypto/BUILD.gn
diff options
context:
space:
mode:
authorpneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-28 09:56:51 +0000
committerpneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-28 09:56:51 +0000
commit190933f29103844bbc40a88bca8b14e49bf7e008 (patch)
tree8a14ff4d9011f73175a12f851d5fb039c45bd41c /crypto/BUILD.gn
parenta017c66088a4671cf0ea59be150c73d3679f31d4 (diff)
downloadchromium_src-190933f29103844bbc40a88bca8b14e49bf7e008.zip
chromium_src-190933f29103844bbc40a88bca8b14e49bf7e008.tar.gz
chromium_src-190933f29103844bbc40a88bca8b14e49bf7e008.tar.bz2
Extract ScopedTestNSSDB from nss_util.
Before ScopedTestNSSDB affected several slot getters from nss_util.h . This change reduces ScopedTestNSSDB to solely setup a temporary test DB and not influencing the global state in nss_util anymore. As a replacement for some of its old behavior, a new ScopedTestSystemNSSKeySlot is added, which allows to override the slot returned by GetSystemNSSKeySlot(). With this change it's now possible to write tests that need both a user and system NSS DB by using ScopedTestSystemNSSKeySlot. As a side-effect, GetPersistentNSSKeySlot() is now compiled on !OS_CHROMEOS only. BUG=210525 (For include changes:) R=rsleevi@chromium.org TBR=nkostylev@chromium.org, stevenjb@chromium.org Review URL: https://codereview.chromium.org/401623006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285881 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/BUILD.gn')
-rw-r--r--crypto/BUILD.gn34
1 files changed, 34 insertions, 0 deletions
diff --git a/crypto/BUILD.gn b/crypto/BUILD.gn
index bd7f06d..6871bda 100644
--- a/crypto/BUILD.gn
+++ b/crypto/BUILD.gn
@@ -131,6 +131,7 @@ component("crypto") {
"hmac_nss.cc",
"nss_util.cc",
"nss_util.h",
+ "nss_util_internal.h",
"rsa_private_key_nss.cc",
"secure_hash_default.cc",
"signature_creator_nss.cc",
@@ -229,6 +230,7 @@ test("crypto_unittests") {
deps = [
":crypto",
":platform",
+ ":test_support",
"//base",
"//base/test:run_all_unittests",
"//base/test:test_support",
@@ -237,6 +239,38 @@ test("crypto_unittests") {
]
}
+source_set("test_support") {
+ sources = [
+ "scoped_test_nss_db.cc",
+ "scoped_test_nss_db.h",
+ "scoped_test_nss_chromeos_user.cc",
+ "scoped_test_nss_chromeos_user.h",
+ "scoped_test_system_nss_key_slot.cc",
+ "scoped_test_system_nss_key_slot.h",
+ ]
+ deps = [
+ ":crypto",
+ ":platform",
+ "//base",
+ ]
+
+ if (!use_nss_certs) {
+ sources -= [
+ "scoped_test_nss_db.cc",
+ "scoped_test_nss_db.h",
+ ]
+ }
+
+ if (!is_chromeos) {
+ sources -= [
+ "scoped_test_nss_chromeos_user.cc",
+ "scoped_test_nss_chromeos_user.h",
+ "scoped_test_system_nss_key_slot.cc",
+ "scoped_test_system_nss_key_slot.h",
+ ]
+ }
+}
+
# This is a meta-target that forwards to NSS's SSL library or OpenSSL,
# according to the state of the crypto flags. A target just wanting to depend
# on the current SSL library should just depend on this.