Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / remoting / base / resources_unittest.cc
blob6d69ceeccdb2719b04607df9860f5ff203cdd3c7
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
3 // found in the LICENSE file.
5 #include "remoting/base/resources.h"
7 #include "remoting/base/common_resources.h"
8 #include "remoting/base/string_resources.h"
9 #include "ui/base/l10n/l10n_util.h"
10 #include "ui/base/resource/resource_bundle.h"
11 #include "testing/gtest/include/gtest/gtest.h"
13 namespace remoting {
15 // TODO(sergeyu): Resources loading doesn't work yet on OSX. Fix it and enable
16 // the test.
17 #if !defined(OS_MACOSX)
18 #define MAYBE_ProductName ProductName
19 #define MAYBE_ProductLogo ProductLogo
20 #else // !defined(OS_MACOSX)
21 #define MAYBE_ProductName DISABLED_ProductName
22 #define MAYBE_ProductLogo DISABLED_ProductLogo
23 #endif // defined(OS_MACOSX)
25 class ResourcesTest : public testing::Test {
26 protected:
27 virtual void SetUp() OVERRIDE {
28 ASSERT_TRUE(LoadResources("en-US"));
31 virtual void TearDown() OVERRIDE {
32 ui::ResourceBundle::CleanupSharedInstance();
36 TEST_F(ResourcesTest, MAYBE_ProductName) {
37 #if defined(GOOGLE_CHROME_BUILD)
38 std::string expected_product_name = "Chrome Remote Desktop";
39 #else // defined(GOOGLE_CHROME_BUILD)
40 std::string expected_product_name = "Chromoting";
41 #endif // !defined(GOOGLE_CHROME_BUILD)
42 EXPECT_EQ(expected_product_name,
43 l10n_util::GetStringUTF8(IDR_PRODUCT_NAME));
46 TEST_F(ResourcesTest, MAYBE_ProductLogo) {
47 gfx::Image logo16 = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
48 IDR_PRODUCT_LOGO_16);
49 EXPECT_FALSE(logo16.IsEmpty());
50 gfx::Image logo32 = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
51 IDR_PRODUCT_LOGO_32);
52 EXPECT_FALSE(logo32.IsEmpty());
55 } // namespace remoting