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

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

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

Powered by Google App Engine
This is Rietveld 408576698