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

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

Issue 1446363003: Deleted OS_WIN and all Windows specific files from base. (Closed) Base URL: https://github.com/domokit/mojo.git@base_tests
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « base/win/win_util.cc ('k') | base/win/windows_version.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <windows.h>
6
7 #include "base/basictypes.h"
8 #include "base/strings/string_util.h"
9 #include "base/win/win_util.h"
10 #include "base/win/windows_version.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 namespace base {
14 namespace win {
15
16 namespace {
17
18 // Saves the current thread's locale ID when initialized, and restores it when
19 // the instance is going out of scope.
20 class ThreadLocaleSaver {
21 public:
22 ThreadLocaleSaver() : original_locale_id_(GetThreadLocale()) {}
23 ~ThreadLocaleSaver() { SetThreadLocale(original_locale_id_); }
24
25 private:
26 LCID original_locale_id_;
27
28 DISALLOW_COPY_AND_ASSIGN(ThreadLocaleSaver);
29 };
30
31 } // namespace
32
33 // The test is somewhat silly, because the Vista bots some have UAC enabled
34 // and some have it disabled. At least we check that it does not crash.
35 TEST(BaseWinUtilTest, TestIsUACEnabled) {
36 if (GetVersion() >= base::win::VERSION_VISTA) {
37 UserAccountControlIsEnabled();
38 } else {
39 EXPECT_TRUE(UserAccountControlIsEnabled());
40 }
41 }
42
43 TEST(BaseWinUtilTest, TestGetUserSidString) {
44 std::wstring user_sid;
45 EXPECT_TRUE(GetUserSidString(&user_sid));
46 EXPECT_TRUE(!user_sid.empty());
47 }
48
49 TEST(BaseWinUtilTest, TestGetNonClientMetrics) {
50 NONCLIENTMETRICS_XP metrics = {0};
51 GetNonClientMetrics(&metrics);
52 EXPECT_GT(metrics.cbSize, 0u);
53 EXPECT_GT(metrics.iScrollWidth, 0);
54 EXPECT_GT(metrics.iScrollHeight, 0);
55 }
56
57 } // namespace win
58 } // namespace base
OLDNEW
« no previous file with comments | « base/win/win_util.cc ('k') | base/win/windows_version.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698