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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "chrome/browser/extensions/extension_action.h" | 6 #include "chrome/browser/extensions/extension_action.h" |
7 #include "chrome/browser/extensions/extension_action_manager.h" | 7 #include "chrome/browser/extensions/extension_action_manager.h" |
8 #include "chrome/browser/extensions/extension_browsertest.h" | 8 #include "chrome/browser/extensions/extension_browsertest.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_system.h" | 10 #include "chrome/browser/extensions/extension_system.h" |
11 #include "chrome/browser/extensions/extension_tab_util.h" | 11 #include "chrome/browser/extensions/extension_tab_util.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/browser_tabstrip.h" | 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
14 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
15 #include "chrome/common/extensions/extension.h" | 15 #include "chrome/common/extensions/extension.h" |
16 #include "chrome/test/base/ui_test_utils.h" | 16 #include "chrome/test/base/ui_test_utils.h" |
17 | 17 |
18 namespace extensions { | 18 namespace extensions { |
19 namespace { | 19 namespace { |
20 | 20 |
21 const std::string kFeedPage = "files/feeds/feed.html"; | 21 const std::string kFeedPage = "files/feeds/feed.html"; |
22 const std::string kNoFeedPage = "files/feeds/no_feed.html"; | 22 const std::string kNoFeedPage = "files/feeds/no_feed.html"; |
23 const std::string kLocalization = | 23 const std::string kLocalization = |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 ui_test_utils::NavigateToURL(browser(), url); | 187 ui_test_utils::NavigateToURL(browser(), url); |
188 ASSERT_TRUE(WaitForPageActionVisibilityChangeTo(1)); | 188 ASSERT_TRUE(WaitForPageActionVisibilityChangeTo(1)); |
189 | 189 |
190 ASSERT_EQ(size_before + 1, service->extensions()->size()); | 190 ASSERT_EQ(size_before + 1, service->extensions()->size()); |
191 | 191 |
192 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur: l10n page action").c_str(), | 192 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur: l10n page action").c_str(), |
193 extension->description().c_str()); | 193 extension->description().c_str()); |
194 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur is my name").c_str(), | 194 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur is my name").c_str(), |
195 extension->name().c_str()); | 195 extension->name().c_str()); |
196 int tab_id = ExtensionTabUtil::GetTabId( | 196 int tab_id = ExtensionTabUtil::GetTabId( |
197 chrome::GetActiveWebContents(browser())); | 197 browser()->tab_strip_model()->GetActiveWebContents()); |
198 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur").c_str(), | 198 EXPECT_STREQ(WideToUTF8(L"Hreggvi\u00F0ur").c_str(), |
199 ExtensionActionManager::Get(browser()->profile())-> | 199 ExtensionActionManager::Get(browser()->profile())-> |
200 GetPageAction(*extension)-> | 200 GetPageAction(*extension)-> |
201 GetTitle(tab_id).c_str()); | 201 GetTitle(tab_id).c_str()); |
202 } | 202 } |
203 | 203 |
204 } // namespace | 204 } // namespace |
205 } // namespace extensions | 205 } // namespace extensions |
OLD | NEW |