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

Side by Side Diff: chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc

Issue 10806058: Move icon fallbacks into ExtensionAction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Windows support Created 8 years, 4 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/extensions/browser_action_test_util.h" 6 #include "chrome/browser/extensions/browser_action_test_util.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_prefs.h" 8 #include "chrome/browser/extensions/extension_prefs.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extension_tab_util.h" 10 #include "chrome/browser/extensions/extension_tab_util.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 { 89 {
90 // Tell the extension to update the page action state again. 90 // Tell the extension to update the page action state again.
91 ResultCatcher catcher; 91 ResultCatcher catcher;
92 ui_test_utils::NavigateToURL(browser(), 92 ui_test_utils::NavigateToURL(browser(),
93 GURL(extension->GetResourceURL("update2.html"))); 93 GURL(extension->GetResourceURL("update2.html")));
94 ASSERT_TRUE(catcher.GetNextResult()); 94 ASSERT_TRUE(catcher.GetNextResult());
95 } 95 }
96 96
97 // Test that we received the changes. 97 // Test that we received the changes.
98 EXPECT_FALSE(action->GetIcon(tab_id).isNull()); 98 ExtensionAction::PathToIconCache empty_cache;
99 EXPECT_FALSE(action->GetIcon(tab_id, empty_cache).IsEmpty());
99 } 100 }
100 101
101 // Test that calling chrome.pageAction.setPopup() can enable a popup. 102 // Test that calling chrome.pageAction.setPopup() can enable a popup.
102 IN_PROC_BROWSER_TEST_F(PageAsBrowserActionApiTest, AddPopup) { 103 IN_PROC_BROWSER_TEST_F(PageAsBrowserActionApiTest, AddPopup) {
103 // Load the extension, which has no default popup. 104 // Load the extension, which has no default popup.
104 ASSERT_TRUE(RunExtensionTest("page_action/add_popup")) << message_; 105 ASSERT_TRUE(RunExtensionTest("page_action/add_popup")) << message_;
105 const Extension* extension = GetSingleLoadedExtension(); 106 const Extension* extension = GetSingleLoadedExtension();
106 ASSERT_TRUE(extension) << message_; 107 ASSERT_TRUE(extension) << message_;
107 108
108 int tab_id = ExtensionTabUtil::GetTabId( 109 int tab_id = ExtensionTabUtil::GetTabId(
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 const Extension* extension = GetSingleLoadedExtension(); 180 const Extension* extension = GetSingleLoadedExtension();
180 ASSERT_TRUE(extension) << message_; 181 ASSERT_TRUE(extension) << message_;
181 182
182 ResultCatcher catcher; 183 ResultCatcher catcher;
183 ui_test_utils::NavigateToURL(browser(), 184 ui_test_utils::NavigateToURL(browser(),
184 GURL(extension->GetResourceURL("update.html"))); 185 GURL(extension->GetResourceURL("update.html")));
185 ASSERT_TRUE(catcher.GetNextResult()); 186 ASSERT_TRUE(catcher.GetNextResult());
186 } 187 }
187 188
188 } 189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698