OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "build/build_config.h" |
| 6 #include "chrome/browser/prefs/tracked/device_id.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 |
| 9 namespace tracked_prefs { |
| 10 |
| 11 TEST(GetDeterministicMachineSpecificIdTest, IsDeterministic) { |
| 12 std::string first_machine_id; |
| 13 std::string second_machine_id; |
| 14 |
| 15 const MachineIdStatus kExpectedStatus = |
| 16 #if defined(OS_WIN) |
| 17 MachineIdStatus::SUCCESS; |
| 18 #else |
| 19 MachineIdStatus::NOT_IMPLEMENTED; |
| 20 #endif |
| 21 |
| 22 ASSERT_EQ(kExpectedStatus, |
| 23 GetDeterministicMachineSpecificId(&first_machine_id)); |
| 24 ASSERT_EQ(kExpectedStatus, |
| 25 GetDeterministicMachineSpecificId(&second_machine_id)); |
| 26 |
| 27 EXPECT_EQ(kExpectedStatus == MachineIdStatus::SUCCESS, |
| 28 !first_machine_id.empty()); |
| 29 EXPECT_EQ(first_machine_id, second_machine_id); |
| 30 } |
| 31 |
| 32 } // namespace tracked_prefs |
OLD | NEW |