Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2449)

Unified Diff: chrome/browser/prefs/tracked/pref_hash_calculator_helper_win_unittest.cc

Issue 393903002: Fix RLZ test support dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gypi tweak Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/tracked/pref_hash_calculator_helper_win_unittest.cc
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 e64cecea447b1573d980ed282d6323c697e061c7..480dbe7ae33cbdbedf1d01f2527c1ec860486ee5 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
« no previous file with comments | « no previous file | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698