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.
5 // This file contains unit tests for Windows internationalization funcs.
7 #include "testing/gtest/include/gtest/gtest.h"
9 #include "base/win/i18n.h"
10 #include "base/win/windows_version.h"
16 // Tests that at least one user preferred UI language can be obtained.
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),
22 for (std::vector
<std::wstring
>::const_iterator scan
= languages
.begin(),
23 end
= languages
.end(); scan
!= end
; ++scan
) {
24 EXPECT_FALSE((*scan
).empty());
28 // Tests that at least one thread preferred UI language can be obtained.
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),
34 for (std::vector
<std::wstring
>::const_iterator scan
= languages
.begin(),
35 end
= languages
.end(); scan
!= end
; ++scan
) {
36 EXPECT_FALSE((*scan
).empty());