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

Side by Side Diff: sandbox/win/src/lpc_policy_test.cc

Issue 1324523008: Windows sbox: Warmup locales before sandbox lockdown (and tests) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « sandbox/win/sandbox_win.gypi ('k') | sandbox/win/src/sandbox_policy.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) 2011 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 // These tests have been added to specifically tests issues arising from (A)LPC
6 // lock down.
7
8 #include <algorithm>
9 #include <cctype>
10
11 #include <windows.h>
12 #include <winioctl.h>
13
14 #include "sandbox/win/src/sandbox.h"
15 #include "sandbox/win/src/sandbox_factory.h"
16 #include "sandbox/win/src/sandbox_policy.h"
17 #include "sandbox/win/tests/common/controller.h"
18 #include "sandbox/win/tests/common/test_utils.h"
19 #include "testing/gtest/include/gtest/gtest.h"
20
21 namespace sandbox {
22
23 SBOX_TESTS_COMMAND int Lpc_GetUserDefaultLangID(int argc, wchar_t **argv) {
24 ::GetUserDefaultLangID();
Will Harris 2015/09/03 20:58:03 is there a way of verifying the return value here
25 return SBOX_TEST_SUCCEEDED;
26 }
27
28 TEST(LpcPolicyTest, GetUserDefaultLangID) {
29 TestRunner runner;
30 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"Lpc_GetUserDefaultLangID"));
31 }
32
33 SBOX_TESTS_COMMAND int Lpc_GetUserDefaultLCID(int argc, wchar_t **argv) {
34 ::GetUserDefaultLCID();
35 return SBOX_TEST_SUCCEEDED;
36 }
37
38 TEST(LpcPolicyTest, GetUserDefaultLCID) {
39 TestRunner runner;
40 EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner.RunTest(L"Lpc_GetUserDefaultLCID"));
41 }
42
43 SBOX_TESTS_COMMAND int Lpc_GetUserDefaultLocaleName(int argc, wchar_t **argv) {
44 wchar_t localeName[LOCALE_NAME_MAX_LENGTH] = { 0 };
45 int ret = ::GetUserDefaultLocaleName(
46 localeName, LOCALE_NAME_MAX_LENGTH * sizeof(wchar_t));
47 if (!ret) {
48 return SBOX_TEST_FAILED;
49 }
50 if (!wcsnlen(localeName, LOCALE_NAME_MAX_LENGTH)) {
51 return SBOX_TEST_FAILED;
52 }
53 return SBOX_TEST_SUCCEEDED;
54 }
55
56 TEST(LpcPolicyTest, GetUserDefaultLocaleName) {
57 TestRunner runner;
58 EXPECT_EQ(SBOX_TEST_SUCCEEDED,
59 runner.RunTest(L"Lpc_GetUserDefaultLocaleName"));
60 }
61
62 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/win/sandbox_win.gypi ('k') | sandbox/win/src/sandbox_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698