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

Side by Side Diff: components/user_prefs/tracked/device_id_unittest.cc

Issue 2782803002: Move tracked prefs into services/preferences/tracked. (Closed)
Patch Set: rebase Created 3 years, 8 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 unified diff | Download patch
OLDNEW
(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 "components/user_prefs/tracked/device_id.h"
6
7 #include "build/build_config.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 TEST(GetDeterministicMachineSpecificIdTest, IsDeterministic) {
11 std::string first_machine_id;
12 std::string second_machine_id;
13
14 const MachineIdStatus kExpectedStatus =
15 #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS))
16 MachineIdStatus::SUCCESS;
17 #else
18 MachineIdStatus::NOT_IMPLEMENTED;
19 #endif
20
21 ASSERT_EQ(kExpectedStatus,
22 GetDeterministicMachineSpecificId(&first_machine_id));
23 ASSERT_EQ(kExpectedStatus,
24 GetDeterministicMachineSpecificId(&second_machine_id));
25
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
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:
30 // https://code.google.com/p/googletest/issues/detail?id=322
31 // https://code.google.com/p/googletest/issues/detail?id=458
32 EXPECT_TRUE((kExpectedStatus == MachineIdStatus::SUCCESS) ==
33 !first_machine_id.empty());
34 EXPECT_EQ(first_machine_id, second_machine_id);
35 }
OLDNEW
« no previous file with comments | « components/user_prefs/tracked/device_id_stub.cc ('k') | components/user_prefs/tracked/device_id_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698