OLD | NEW |
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 "chrome/browser/ui/browser_tabstrip.h" |
| 6 |
5 // Tests that tooltips of a browser action icon can be specified using UTF8. | 7 // Tests that tooltips of a browser action icon can be specified using UTF8. |
6 // See http://crbug.com/25349. | 8 // See http://crbug.com/25349. |
7 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TitleLocalizationBrowserAction) { | 9 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TitleLocalizationBrowserAction) { |
8 ExtensionService* service = browser()->profile()->GetExtensionService(); | 10 ExtensionService* service = browser()->profile()->GetExtensionService(); |
9 const size_t size_before = service->extensions()->size(); | 11 const size_t size_before = service->extensions()->size(); |
10 FilePath extension_path(test_data_dir_.AppendASCII("browsertest") | 12 FilePath extension_path(test_data_dir_.AppendASCII("browsertest") |
11 .AppendASCII("title_localized")); | 13 .AppendASCII("title_localized")); |
12 const Extension* extension = LoadExtension(extension_path); | 14 const Extension* extension = LoadExtension(extension_path); |
13 ASSERT_TRUE(extension); | 15 ASSERT_TRUE(extension); |
14 | 16 |
15 ASSERT_EQ(size_before + 1, service->extensions()->size()); | 17 ASSERT_EQ(size_before + 1, service->extensions()->size()); |
16 | 18 |
17 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur: l10n browser action").c_str(), | 19 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur: l10n browser action").c_str(), |
18 extension->description().c_str()); | 20 extension->description().c_str()); |
19 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur is my name").c_str(), | 21 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur is my name").c_str(), |
20 extension->name().c_str()); | 22 extension->name().c_str()); |
21 int tab_id = ExtensionTabUtil::GetTabId(browser()->GetActiveWebContents()); | 23 int tab_id = ExtensionTabUtil::GetTabId( |
| 24 chrome::GetActiveWebContents(browser())); |
22 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur").c_str(), | 25 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur").c_str(), |
23 extension->browser_action()->GetTitle(tab_id).c_str()); | 26 extension->browser_action()->GetTitle(tab_id).c_str()); |
24 } | 27 } |
OLD | NEW |