summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prefs
diff options
context:
space:
mode:
authorgrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-17 11:22:33 +0000
committergrt@chromium.org <grt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-17 11:22:33 +0000
commite7cd037c36a3ac5bab0f66bb10c009c80af53569 (patch)
tree0057e22b8c39e66f3c40bd368bf54383ff9a7889 /chrome/browser/prefs
parent20e23d0747f6caca635e18251e893fdeb0d4496f (diff)
downloadchromium_src-e7cd037c36a3ac5bab0f66bb10c009c80af53569.zip
chromium_src-e7cd037c36a3ac5bab0f66bb10c009c80af53569.tar.gz
chromium_src-e7cd037c36a3ac5bab0f66bb10c009c80af53569.tar.bz2
Fix RLZ test support dependency.
BUG=393815 R=thakis@chromium.org Review URL: https://codereview.chromium.org/393903002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283753 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prefs')
-rw-r--r--chrome/browser/prefs/tracked/pref_hash_calculator_helper_win_unittest.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/prefs/tracked/pref_hash_calculator_helper_win_unittest.cc b/chrome/browser/prefs/tracked/pref_hash_calculator_helper_win_unittest.cc
index e64cece..480dbe7 100644
--- a/chrome/browser/prefs/tracked/pref_hash_calculator_helper_win_unittest.cc
+++ b/chrome/browser/prefs/tracked/pref_hash_calculator_helper_win_unittest.cc
@@ -17,9 +17,12 @@
#include "content/public/test/test_browser_thread_bundle.h"
#include "content/public/test/test_utils.h"
#include "crypto/hmac.h"
-#include "rlz/lib/machine_id.h"
#include "testing/gtest/include/gtest/gtest.h"
+#if defined(ENABLE_RLZ)
+#include "rlz/lib/machine_id.h"
+#endif
+
namespace {
// extensions::api::DeviceId::GetDeviceId() signs the extension_id in
@@ -70,6 +73,7 @@ std::string GetDeviceIdFromRawDeviceId(const std::string& raw_device_id) {
return StringToLowerASCII(base::HexEncode(digest.data(), digest.size()));
}
+#if defined(ENABLE_RLZ)
std::string GetLegacyIdBasedOnRlzId() {
std::string rlz_machine_id;
rlz_lib::GetMachineId(&rlz_machine_id);
@@ -88,6 +92,7 @@ std::string GetLegacyIdBasedOnRlzId() {
return legacy_device_id;
}
+#endif // ENABLE_RLZ
// Simulate browser threads (required by extensions::api::DeviceId) off of the
// main message loop.
@@ -104,14 +109,18 @@ class PrefHashCalculatorHelperTest : public testing::Test {
// results in the mean time (it will be okay for the extension API's
// implementation to diverge on M34+ and this test can be removed once M34 ships
// to stable).
+#if defined(ENABLE_RLZ)
TEST_F(PrefHashCalculatorHelperTest, ResultMatchesMediaId) {
EXPECT_EQ(GetMediaDeviceIdSynchronously(), GetLegacyIdBasedOnRlzId());
}
+#endif // ENABLE_RLZ
TEST_F(PrefHashCalculatorHelperTest, MediaIdIsDeterministic) {
EXPECT_EQ(GetMediaDeviceIdSynchronously(), GetMediaDeviceIdSynchronously());
}
+#if defined(ENABLE_RLZ)
TEST_F(PrefHashCalculatorHelperTest, RlzBasedIdIsDeterministic) {
EXPECT_EQ(GetLegacyIdBasedOnRlzId(), GetLegacyIdBasedOnRlzId());
}
+#endif // ENABLE_RLZ