OLD | NEW |
1 // Copyright (c) 2010 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 <windows.h> | 5 #include <windows.h> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/win/win_util.h" | 9 #include "base/win/win_util.h" |
10 #include "base/win/windows_version.h" | 10 #include "base/win/windows_version.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 EXPECT_TRUE(UserAccountControlIsEnabled()); | 39 EXPECT_TRUE(UserAccountControlIsEnabled()); |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 TEST(BaseWinUtilTest, TestGetUserSidString) { | 43 TEST(BaseWinUtilTest, TestGetUserSidString) { |
44 std::wstring user_sid; | 44 std::wstring user_sid; |
45 EXPECT_TRUE(GetUserSidString(&user_sid)); | 45 EXPECT_TRUE(GetUserSidString(&user_sid)); |
46 EXPECT_TRUE(!user_sid.empty()); | 46 EXPECT_TRUE(!user_sid.empty()); |
47 } | 47 } |
48 | 48 |
| 49 // The test is somewhat silly, and just verifies that we return a computer name. |
| 50 TEST(BaseWinUtilTest, TestGetComputerName) { |
| 51 std::string computer_name = GetComputerName(); |
| 52 EXPECT_TRUE(!computer_name.empty()); |
| 53 } |
| 54 |
49 TEST(BaseWinUtilTest, TestGetNonClientMetrics) { | 55 TEST(BaseWinUtilTest, TestGetNonClientMetrics) { |
50 NONCLIENTMETRICS metrics = {0}; | 56 NONCLIENTMETRICS metrics = {0}; |
51 GetNonClientMetrics(&metrics); | 57 GetNonClientMetrics(&metrics); |
52 EXPECT_TRUE(metrics.cbSize > 0); | 58 EXPECT_TRUE(metrics.cbSize > 0); |
53 EXPECT_TRUE(metrics.iScrollWidth > 0); | 59 EXPECT_TRUE(metrics.iScrollWidth > 0); |
54 EXPECT_TRUE(metrics.iScrollHeight > 0); | 60 EXPECT_TRUE(metrics.iScrollHeight > 0); |
55 } | 61 } |
56 | 62 |
57 } // namespace win | 63 } // namespace win |
58 } // namespace base | 64 } // namespace base |
OLD | NEW |