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

Side by Side Diff: remoting/base/resources_unittest.cc

Issue 11087059: Add common_resources.grd for non-localizeable chromoting resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/base/resources.cc ('k') | remoting/grit_action.gypi » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "remoting/base/resources.h" 5 #include "remoting/base/resources.h"
6 6
7 #include "remoting/base/common_resources.h"
7 #include "remoting/base/string_resources.h" 8 #include "remoting/base/string_resources.h"
8 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
9 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
10 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
11 12
12 namespace remoting { 13 namespace remoting {
13 14
14 // TODO(sergeyu): Resources loading doesn't work yet on OSX. Fix it and enable 15 // TODO(sergeyu): Resources loading doesn't work yet on OSX. Fix it and enable
15 // the test. 16 // the test.
16 #if !defined(OS_MACOSX) 17 #if !defined(OS_MACOSX)
17 #define MAYBE_ProductName ProductName 18 #define MAYBE_ProductName ProductName
19 #define MAYBE_ProductLogo ProductLogo
18 #else // !defined(OS_MACOSX) 20 #else // !defined(OS_MACOSX)
19 #define MAYBE_ProductName DISABLED_ProductName 21 #define MAYBE_ProductName DISABLED_ProductName
22 #define MAYBE_ProductLogo DISABLED_ProductLogo
20 #endif // defined(OS_MACOSX) 23 #endif // defined(OS_MACOSX)
21 TEST(Resources, MAYBE_ProductName) { 24
25 class ResourcesTest : public testing::Test {
26 protected:
27 void SetUp() OVERRIDE {
28 ASSERT_TRUE(LoadResources("en-US"));
29 }
30
31 void TearDown() OVERRIDE {
32 ui::ResourceBundle::CleanupSharedInstance();
33 }
34 };
35
36 TEST_F(ResourcesTest, MAYBE_ProductName) {
22 #if defined(GOOGLE_CHROME_BUILD) 37 #if defined(GOOGLE_CHROME_BUILD)
23 std::string expected_product_name = "Chrome Remote Desktop"; 38 std::string expected_product_name = "Chrome Remote Desktop";
24 #else // defined(GOOGLE_CHROME_BUILD) 39 #else // defined(GOOGLE_CHROME_BUILD)
25 std::string expected_product_name = "Chromoting"; 40 std::string expected_product_name = "Chromoting";
26 #endif // !defined(GOOGLE_CHROME_BUILD) 41 #endif // !defined(GOOGLE_CHROME_BUILD)
27 ASSERT_TRUE(LoadResources("en-US"));
28 EXPECT_EQ(expected_product_name, 42 EXPECT_EQ(expected_product_name,
29 l10n_util::GetStringUTF8(IDR_REMOTING_PRODUCT_NAME)); 43 l10n_util::GetStringUTF8(IDR_REMOTING_PRODUCT_NAME));
30 ui::ResourceBundle::CleanupSharedInstance(); 44 }
45
46 TEST_F(ResourcesTest, MAYBE_ProductLogo) {
47 gfx::Image logo = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
48 IDR_PRODUCT_LOGO_16);
49 EXPECT_FALSE(logo.IsEmpty());
31 } 50 }
32 51
33 } // namespace remoting 52 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/resources.cc ('k') | remoting/grit_action.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698