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

Unified Diff: chrome_frame/test/simple_resource_loader_test.cc

Issue 7763006: Load both language packs and the resource dlls in ChromeFrame and look for localized strings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/simple_resource_loader.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/simple_resource_loader_test.cc
===================================================================
--- chrome_frame/test/simple_resource_loader_test.cc (revision 98458)
+++ chrome_frame/test/simple_resource_loader_test.cc (working copy)
@@ -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 @@
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) {
« 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