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

Side by Side Diff: chrome_frame/test/simple_resource_loader_test.cc

Issue 4139010: The UI language rather than the locale is now used to pick Chrome's language ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome_frame/simple_resource_loader.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome_frame/simple_resource_loader.h" 5 #include "chrome_frame/simple_resource_loader.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/win/windows_version.h" 8 #include "base/win/windows_version.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 EXPECT_TRUE( 49 EXPECT_TRUE(
50 SimpleResourceLoader::LoadLocaleDll(language_tags, locales_path, 50 SimpleResourceLoader::LoadLocaleDll(language_tags, locales_path,
51 &dll_handle, &file_path)); 51 &dll_handle, &file_path));
52 if (NULL != dll_handle) { 52 if (NULL != dll_handle) {
53 FreeLibrary(dll_handle); 53 FreeLibrary(dll_handle);
54 dll_handle = NULL; 54 dll_handle = NULL;
55 } 55 }
56 EXPECT_TRUE(file_path.BaseName() == FilePath(L"en-US.dll")); 56 EXPECT_TRUE(file_path.BaseName() == FilePath(L"en-US.dll"));
57 } 57 }
58 58
59 TEST(SimpleResourceLoaderTest, GetThreadPreferredUILanguages) {
60 std::vector<std::wstring> language_tags;
61
62 if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
63 EXPECT_TRUE(
64 SimpleResourceLoader::GetThreadPreferredUILanguages(&language_tags));
65 // Did we find at least one language?
66 EXPECT_NE(static_cast<std::vector<std::wstring>::size_type>(0),
67 language_tags.size());
68 } else {
69 EXPECT_FALSE(
70 SimpleResourceLoader::GetThreadPreferredUILanguages(&language_tags));
71 }
72 }
73
74 TEST(SimpleResourceLoaderTest, GetICUSystemLanguage) {
75 std::wstring language;
76 std::wstring region;
77
78 SimpleResourceLoader::GetICUSystemLanguage(&language, &region);
79 EXPECT_NE(static_cast<std::wstring::size_type>(0), language.size());
80 }
81
82 TEST(SimpleResourceLoaderTest, InstanceTest) { 59 TEST(SimpleResourceLoaderTest, InstanceTest) {
83 SimpleResourceLoader* loader = SimpleResourceLoader::instance(); 60 SimpleResourceLoader* loader = SimpleResourceLoader::instance();
84 61
85 ASSERT_TRUE(NULL != loader); 62 ASSERT_TRUE(NULL != loader);
86 ASSERT_TRUE(NULL != loader->GetResourceModuleHandle()); 63 ASSERT_TRUE(NULL != loader->GetResourceModuleHandle());
87 } 64 }
OLDNEW
« no previous file with comments | « chrome_frame/simple_resource_loader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698