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

Side by Side Diff: base/win/win_util_unittest.cc

Issue 7740055: Set user-visible machine names and devices types for synced sessions. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Split off platform-specific code to various util files, addressed comments Created 9 years, 3 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 | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698