Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |