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

Side by Side Diff: chrome/browser/extensions/browser_action_apitest.cc

Issue 12314090: Add utf_string_conversions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
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 "chrome/browser/extensions/extension_system.h" 5 #include "chrome/browser/extensions/extension_system.h"
6 #include "chrome/browser/ui/browser.h" 6 #include "chrome/browser/ui/browser.h"
7 #include "chrome/browser/ui/tabs/tab_strip_model.h" 7 #include "chrome/browser/ui/tabs/tab_strip_model.h"
8 8
9 // Tests that tooltips of a browser action icon can be specified using UTF8. 9 // Tests that tooltips of a browser action icon can be specified using UTF8.
10 // See http://crbug.com/25349. 10 // See http://crbug.com/25349.
11 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TitleLocalizationBrowserAction) { 11 IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest, TitleLocalizationBrowserAction) {
12 ExtensionService* service = extensions::ExtensionSystem::Get( 12 ExtensionService* service = extensions::ExtensionSystem::Get(
13 browser()->profile())->extension_service(); 13 browser()->profile())->extension_service();
14 const size_t size_before = service->extensions()->size(); 14 const size_t size_before = service->extensions()->size();
15 base::FilePath extension_path(test_data_dir_.AppendASCII("browsertest") 15 base::FilePath extension_path(test_data_dir_.AppendASCII("browsertest")
16 .AppendASCII("title_localized")); 16 .AppendASCII("title_localized"));
17 const Extension* extension = LoadExtension(extension_path); 17 const Extension* extension = LoadExtension(extension_path);
18 ASSERT_TRUE(extension); 18 ASSERT_TRUE(extension);
19 19
20 ASSERT_EQ(size_before + 1, service->extensions()->size()); 20 ASSERT_EQ(size_before + 1, service->extensions()->size());
21 21
22 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur: l10n browser action").c_str(), 22 EXPECT_STREQ(
23 extension->description().c_str()); 23 base::WideToUTF8(L"Hreggvi\u00F0ur: l10n browser action").c_str(),
24 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur is my name").c_str(), 24 extension->description().c_str());
25 EXPECT_STREQ(base::WideToUTF8(L"Hreggvi\u00F0ur is my name").c_str(),
25 extension->name().c_str()); 26 extension->name().c_str());
26 int tab_id = ExtensionTabUtil::GetTabId( 27 int tab_id = ExtensionTabUtil::GetTabId(
27 browser()->tab_strip_model()->GetActiveWebContents()); 28 browser()->tab_strip_model()->GetActiveWebContents());
28 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur").c_str(), 29 EXPECT_STREQ(base::WideToUTF8(L"Hreggvi\u00F0ur").c_str(),
29 extension->browser_action()->GetTitle(tab_id).c_str()); 30 extension->browser_action()->GetTitle(tab_id).c_str());
30 } 31 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_notification_storage.cc ('k') | chrome/browser/extensions/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698