OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/metrics_service.h" | 5 #include "chrome/browser/metrics/metrics_service.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 #if defined(OS_POSIX) && defined(LINUX2) | 10 #if defined(OS_POSIX) && defined(LINUX2) |
11 TEST(MetricsServiceTest, ClientIdGeneratesAllZeroes) { | 11 TEST(MetricsServiceTest, ClientIdGeneratesAllZeroes) { |
(...skipping 14 matching lines...) Expand all Loading... |
26 for (uint32 i = 0; i < clientid.length(); i++) { | 26 for (uint32 i = 0; i < clientid.length(); i++) { |
27 char current = clientid.at(i); | 27 char current = clientid.at(i); |
28 if (i == 8 || i == 13 || i == 18 || i == 23) { | 28 if (i == 8 || i == 13 || i == 18 || i == 23) { |
29 EXPECT_EQ('-', current); | 29 EXPECT_EQ('-', current); |
30 } else { | 30 } else { |
31 EXPECT_TRUE(std::string::npos != hexchars.find(current)); | 31 EXPECT_TRUE(std::string::npos != hexchars.find(current)); |
32 } | 32 } |
33 } | 33 } |
34 } | 34 } |
35 #endif | 35 #endif |
| 36 |
| 37 #if defined(OS_CHROMEOS) |
| 38 TEST(MetricsServiceTest, GetHardwareClass) { |
| 39 // The assumption is that unit tests run on the build host rather |
| 40 // than on the Chrome OS device so the hardware_class tool is not |
| 41 // available. |
| 42 std::string hardware_class = MetricsService::GetHardwareClass(); |
| 43 EXPECT_EQ("unknown", hardware_class); |
| 44 } |
| 45 #endif // OS_CHROMEOS |
OLD | NEW |