Work on Windows GN component build.
[chromium-blink-merge.git] / components / metrics / machine_id_provider_win_unittest.cc
blob11ffd8f73dfc69a1d901c9ebab7638c4ae9ac6cd
1 // Copyright 2014 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.
5 #include "components/metrics/machine_id_provider.h"
7 #include "base/memory/ref_counted.h"
8 #include "base/win/windows_version.h"
9 #include "testing/gtest/include/gtest/gtest.h"
11 namespace metrics {
13 TEST(MachineIdProviderTest, GetId) {
14 scoped_refptr<MachineIdProvider> provider(
15 MachineIdProvider::CreateInstance());
16 std::string id1 = provider->GetMachineId();
18 // TODO(rpaquay): See crbug/458230
19 if (base::win::GetVersion() <= base::win::VERSION_XP)
20 return;
22 EXPECT_NE(std::string(), id1);
24 std::string id2 = provider->GetMachineId();
25 EXPECT_EQ(id1, id2);
28 } // namespace metrics