Chromium Code Reviews| Index: chrome/browser/prefs/tracked/device_id_unittest.cc |
| diff --git a/chrome/browser/prefs/tracked/device_id_unittest.cc b/chrome/browser/prefs/tracked/device_id_unittest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bbbc8282bde94f8a7a4ba1e0f87db2e81e2afbd5 |
| --- /dev/null |
| +++ b/chrome/browser/prefs/tracked/device_id_unittest.cc |
| @@ -0,0 +1,25 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/prefs/tracked/device_id.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +TEST(GetDeterministicMachineSpecificIdTest, IsDeterministic) { |
| + std::string first_machine_id; |
| + std::string second_machine_id; |
| + |
| + bool machine_id_enabled = false; |
| +#if defined(OS_WIN) |
| + machine_id_enabled = true; |
| +#endif |
|
gab
2015/01/20 15:34:12
This will likely change based on other comments, b
alito
2015/01/26 16:32:48
Acknowledged.
|
| + |
| + ASSERT_EQ(machine_id_enabled, |
| + GetDeterministicMachineSpecificId(&first_machine_id)); |
| + ASSERT_EQ(machine_id_enabled, |
| + GetDeterministicMachineSpecificId(&second_machine_id)); |
| + if (!machine_id_enabled) { |
| + EXPECT_EQ(string(""), first_machine_id); |
|
gab
2015/01/20 15:34:12
I think this test will change based on other comme
alito
2015/01/26 16:32:48
Acknowledged.
|
| + } |
| + EXPECT_EQ(first_machine_id, second_machine_id); |
| +} |