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

Unified Diff: remoting/base/resources_unittest.cc

Issue 21059003: Localized Chromoting Host on Mac and Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 5 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 | « remoting/base/resources_mac.mm ('k') | remoting/base/resources_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/resources_unittest.cc
diff --git a/remoting/base/resources_unittest.cc b/remoting/base/resources_unittest.cc
index 6d69ceeccdb2719b04607df9860f5ff203cdd3c7..b02a12b057e2579e70746f64c1002af40c1b0bef 100644
--- a/remoting/base/resources_unittest.cc
+++ b/remoting/base/resources_unittest.cc
@@ -4,52 +4,46 @@
#include "remoting/base/resources.h"
-#include "remoting/base/common_resources.h"
#include "remoting/base/string_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/resource/resource_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace remoting {
-// TODO(sergeyu): Resources loading doesn't work yet on OSX. Fix it and enable
-// the test.
-#if !defined(OS_MACOSX)
-#define MAYBE_ProductName ProductName
-#define MAYBE_ProductLogo ProductLogo
-#else // !defined(OS_MACOSX)
-#define MAYBE_ProductName DISABLED_ProductName
-#define MAYBE_ProductLogo DISABLED_ProductLogo
-#endif // defined(OS_MACOSX)
-
class ResourcesTest : public testing::Test {
protected:
+ ResourcesTest(): resources_available_(false) {
+ }
+
virtual void SetUp() OVERRIDE {
- ASSERT_TRUE(LoadResources("en-US"));
+ resources_available_ = LoadResources("en-US");
}
virtual void TearDown() OVERRIDE {
- ui::ResourceBundle::CleanupSharedInstance();
+ UnloadResources();
}
+
+ bool resources_available_;
};
-TEST_F(ResourcesTest, MAYBE_ProductName) {
+TEST_F(ResourcesTest, ProductName) {
#if defined(GOOGLE_CHROME_BUILD)
std::string expected_product_name = "Chrome Remote Desktop";
#else // defined(GOOGLE_CHROME_BUILD)
std::string expected_product_name = "Chromoting";
#endif // !defined(GOOGLE_CHROME_BUILD)
- EXPECT_EQ(expected_product_name,
- l10n_util::GetStringUTF8(IDR_PRODUCT_NAME));
-}
-TEST_F(ResourcesTest, MAYBE_ProductLogo) {
- gfx::Image logo16 = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
- IDR_PRODUCT_LOGO_16);
- EXPECT_FALSE(logo16.IsEmpty());
- gfx::Image logo32 = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
- IDR_PRODUCT_LOGO_32);
- EXPECT_FALSE(logo32.IsEmpty());
+ // Chrome-style i18n is not used on Windows.
+#if defined(OS_WIN)
+ EXPECT_FALSE(resources_available_);
+#else
+ EXPECT_TRUE(resources_available_);
+#endif
+
+ if (resources_available_) {
+ EXPECT_EQ(expected_product_name,
+ l10n_util::GetStringUTF8(IDR_PRODUCT_NAME));
+ }
}
} // namespace remoting
« no previous file with comments | « remoting/base/resources_mac.mm ('k') | remoting/base/resources_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698