OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/user_prefs/tracked/device_id.h" | 5 #include "services/preferences/tracked/device_id.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 TEST(GetDeterministicMachineSpecificIdTest, IsDeterministic) { | 10 TEST(GetDeterministicMachineSpecificIdTest, IsDeterministic) { |
11 std::string first_machine_id; | 11 std::string first_machine_id; |
12 std::string second_machine_id; | 12 std::string second_machine_id; |
13 | 13 |
14 const MachineIdStatus kExpectedStatus = | 14 const MachineIdStatus kExpectedStatus = |
15 #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) | 15 #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) |
(...skipping 10 matching lines...) Expand all Loading... |
26 // The reason for using |EXPECT_TRUE| with one argument instead of |EXPECT_EQ| | 26 // The reason for using |EXPECT_TRUE| with one argument instead of |EXPECT_EQ| |
27 // with two arguments is a compiler bug in gcc that results in a "converting | 27 // with two arguments is a compiler bug in gcc that results in a "converting |
28 // 'false' to pointer type" error when the first argument to |EXPECT_EQ| is a | 28 // 'false' to pointer type" error when the first argument to |EXPECT_EQ| is a |
29 // compile-time const false value. See also the following bug reports: | 29 // compile-time const false value. See also the following bug reports: |
30 // https://code.google.com/p/googletest/issues/detail?id=322 | 30 // https://code.google.com/p/googletest/issues/detail?id=322 |
31 // https://code.google.com/p/googletest/issues/detail?id=458 | 31 // https://code.google.com/p/googletest/issues/detail?id=458 |
32 EXPECT_TRUE((kExpectedStatus == MachineIdStatus::SUCCESS) == | 32 EXPECT_TRUE((kExpectedStatus == MachineIdStatus::SUCCESS) == |
33 !first_machine_id.empty()); | 33 !first_machine_id.empty()); |
34 EXPECT_EQ(first_machine_id, second_machine_id); | 34 EXPECT_EQ(first_machine_id, second_machine_id); |
35 } | 35 } |
OLD | NEW |