summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/simple_resource_loader_test.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-26 22:26:13 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-26 22:26:13 +0000
commit3a78fbdb6ccf439fc5d991c5b3c7ca8adc80a780 (patch)
treee3b388538d7997f07e2d409d9da1d854ded67656 /chrome_frame/test/simple_resource_loader_test.cc
parentaec1d834ed08f78123cc81668fcd3b7f0d91600c (diff)
downloadchromium_src-3a78fbdb6ccf439fc5d991c5b3c7ca8adc80a780.zip
chromium_src-3a78fbdb6ccf439fc5d991c5b3c7ca8adc80a780.tar.gz
chromium_src-3a78fbdb6ccf439fc5d991c5b3c7ca8adc80a780.tar.bz2
Load both language packs and the resource dlls in ChromeFrame and look for localized strings
in the language pack and the other resources like dialogs in the dll. The latter part is done automatically by ATL. BUG=94362 TEST=No change in behavior. The resources should continue to load as before. Review URL: http://codereview.chromium.org/7763006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98502 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/simple_resource_loader_test.cc')
-rw-r--r--chrome_frame/test/simple_resource_loader_test.cc44
1 files changed, 34 insertions, 10 deletions
diff --git a/chrome_frame/test/simple_resource_loader_test.cc b/chrome_frame/test/simple_resource_loader_test.cc
index 98729f3..bf881c0 100644
--- a/chrome_frame/test/simple_resource_loader_test.cc
+++ b/chrome_frame/test/simple_resource_loader_test.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,6 +7,7 @@
#include "base/file_path.h"
#include "base/win/windows_version.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/base/resource/data_pack.h"
TEST(SimpleResourceLoaderTest, LoadLocaleDll) {
std::vector<std::wstring> language_tags;
@@ -20,40 +21,63 @@ TEST(SimpleResourceLoaderTest, LoadLocaleDll) {
language_tags.clear();
language_tags.push_back(L"en-GB");
language_tags.push_back(L"en");
+ ui::DataPack* data_pack = NULL;
+
+ std::wstring language;
+
EXPECT_TRUE(
- SimpleResourceLoader::LoadLocaleDll(language_tags, locales_path,
- &dll_handle, &file_path));
+ SimpleResourceLoader::LoadLocalePack(language_tags, locales_path,
+ &dll_handle, &data_pack,
+ &language));
if (NULL != dll_handle) {
FreeLibrary(dll_handle);
dll_handle = NULL;
}
- EXPECT_TRUE(file_path.BaseName() == FilePath(L"en-GB.dll"));
+ EXPECT_TRUE(data_pack != NULL);
+ delete data_pack;
+ data_pack = NULL;
+
+ EXPECT_EQ(language, L"en-GB");
+ language.clear();
// Test valid language-region string for which we only have a language dll:
language_tags.clear();
language_tags.push_back(L"fr-FR");
language_tags.push_back(L"fr");
EXPECT_TRUE(
- SimpleResourceLoader::LoadLocaleDll(language_tags, locales_path,
- &dll_handle, &file_path));
+ SimpleResourceLoader::LoadLocalePack(language_tags, locales_path,
+ &dll_handle, &data_pack,
+ &language));
if (NULL != dll_handle) {
FreeLibrary(dll_handle);
dll_handle = NULL;
}
- EXPECT_TRUE(file_path.BaseName() == FilePath(L"fr.dll"));
+ EXPECT_TRUE(data_pack != NULL);
+ delete data_pack;
+ data_pack = NULL;
+
+ EXPECT_EQ(language, L"fr");
+ language.clear();
// Test invalid language-region string, make sure fallback works:
language_tags.clear();
language_tags.push_back(L"xx-XX");
language_tags.push_back(L"en-US");
EXPECT_TRUE(
- SimpleResourceLoader::LoadLocaleDll(language_tags, locales_path,
- &dll_handle, &file_path));
+ SimpleResourceLoader::LoadLocalePack(language_tags, locales_path,
+ &dll_handle, &data_pack,
+ &language));
if (NULL != dll_handle) {
FreeLibrary(dll_handle);
dll_handle = NULL;
}
- EXPECT_TRUE(file_path.BaseName() == FilePath(L"en-US.dll"));
+
+ EXPECT_TRUE(data_pack != NULL);
+ delete data_pack;
+ data_pack = NULL;
+
+ EXPECT_EQ(language, L"en-US");
+ language.clear();
}
TEST(SimpleResourceLoaderTest, InstanceTest) {