Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/metrics/machine_id_provider.h" | 5 #include "chrome/browser/metrics/machine_id_provider.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "content/public/test/test_browser_thread_bundle.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 namespace metrics { | 11 namespace metrics { |
| 12 | 12 |
| 13 TEST(MachineIdProviderTest, GetId) { | 13 TEST(MachineIdProviderTest, GetId) { |
| 14 content::TestBrowserThreadBundle thread_bundle; | 14 base::MessageLoop message_loop; |
|
Ilya Sherman
2014/05/19 13:24:02
nit: Hmm, is this needed at all? If so, should it
blundell
2014/05/19 13:31:23
You're right, it looks like it's not needed (I don
| |
| 15 | 15 |
| 16 scoped_refptr<MachineIdProvider> provider( | 16 scoped_refptr<MachineIdProvider> provider( |
| 17 MachineIdProvider::CreateInstance()); | 17 MachineIdProvider::CreateInstance()); |
| 18 std::string id1 = provider->GetMachineId(); | 18 std::string id1 = provider->GetMachineId(); |
| 19 | 19 |
| 20 EXPECT_NE(std::string(), id1); | 20 EXPECT_NE(std::string(), id1); |
| 21 | 21 |
| 22 std::string id2 = provider->GetMachineId(); | 22 std::string id2 = provider->GetMachineId(); |
| 23 EXPECT_EQ(id1, id2); | 23 EXPECT_EQ(id1, id2); |
| 24 } | 24 } |
| 25 | 25 |
| 26 } // namespace metrics | 26 } // namespace metrics |
| OLD | NEW |