• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // This file contains unit tests for Windows internationalization funcs.
6 
7 #include "testing/gtest/include/gtest/gtest.h"
8 
9 #include "base/win/i18n.h"
10 #include "base/win/windows_version.h"
11 
12 namespace base {
13 namespace win {
14 namespace i18n {
15 
16 // Tests that at least one user preferred UI language can be obtained.
TEST(I18NTest,GetUserPreferredUILanguageList)17 TEST(I18NTest, GetUserPreferredUILanguageList) {
18   std::vector<std::wstring> languages;
19   EXPECT_TRUE(GetUserPreferredUILanguageList(&languages));
20   EXPECT_NE(static_cast<std::vector<std::wstring>::size_type>(0),
21             languages.size());
22   for (std::vector<std::wstring>::const_iterator scan = languages.begin(),
23           end = languages.end(); scan != end; ++scan) {
24     EXPECT_FALSE((*scan).empty());
25   }
26 }
27 
28 // Tests that at least one thread preferred UI language can be obtained.
TEST(I18NTest,GetThreadPreferredUILanguageList)29 TEST(I18NTest, GetThreadPreferredUILanguageList) {
30   std::vector<std::wstring> languages;
31   EXPECT_TRUE(GetThreadPreferredUILanguageList(&languages));
32   EXPECT_NE(static_cast<std::vector<std::wstring>::size_type>(0),
33             languages.size());
34   for (std::vector<std::wstring>::const_iterator scan = languages.begin(),
35           end = languages.end(); scan != end; ++scan) {
36     EXPECT_FALSE((*scan).empty());
37   }
38 }
39 
40 }  // namespace i18n
41 }  // namespace win
42 }  // namespace base
43