blob: d1bc851eeaecc6f0aa5b95ca41e47bd3712ab2b7 [file] [log] [blame]
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001// 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.
4
5#include "remoting/base/resources.h"
6
Torne (Richard Coles)58218062012-11-14 11:43:16 +00007#include "remoting/base/string_resources.h"
8#include "ui/base/l10n/l10n_util.h"
Torne (Richard Coles)58218062012-11-14 11:43:16 +00009#include "testing/gtest/include/gtest/gtest.h"
10
11namespace remoting {
12
Torne (Richard Coles)58218062012-11-14 11:43:16 +000013class ResourcesTest : public testing::Test {
14 protected:
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +010015 ResourcesTest(): resources_available_(false) {
16 }
17
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000018 virtual void SetUp() OVERRIDE {
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +010019 resources_available_ = LoadResources("en-US");
Torne (Richard Coles)58218062012-11-14 11:43:16 +000020 }
21
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000022 virtual void TearDown() OVERRIDE {
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +010023 UnloadResources();
Torne (Richard Coles)58218062012-11-14 11:43:16 +000024 }
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +010025
26 bool resources_available_;
Torne (Richard Coles)58218062012-11-14 11:43:16 +000027};
28
Ben Murdochbb1529c2013-08-08 10:24:53 +010029// TODO(alexeypa): Reenable the test once http://crbug.com/269143 (ChromeOS) and
30// http://crbug.com/268043 (MacOS) are fixed.
31TEST_F(ResourcesTest, DISABLED_ProductName) {
Torne (Richard Coles)58218062012-11-14 11:43:16 +000032#if defined(GOOGLE_CHROME_BUILD)
33 std::string expected_product_name = "Chrome Remote Desktop";
34#else // defined(GOOGLE_CHROME_BUILD)
35 std::string expected_product_name = "Chromoting";
36#endif // !defined(GOOGLE_CHROME_BUILD)
Torne (Richard Coles)58218062012-11-14 11:43:16 +000037
Torne (Richard Coles)a36e5922013-08-05 13:57:33 +010038 // Chrome-style i18n is not used on Windows.
39#if defined(OS_WIN)
40 EXPECT_FALSE(resources_available_);
41#else
42 EXPECT_TRUE(resources_available_);
43#endif
44
45 if (resources_available_) {
46 EXPECT_EQ(expected_product_name,
47 l10n_util::GetStringUTF8(IDR_PRODUCT_NAME));
48 }
Torne (Richard Coles)58218062012-11-14 11:43:16 +000049}
50
51} // namespace remoting