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

Unified Diff: chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc

Issue 10905005: Change browser/page action default icon defined in manifest to support hidpi. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc
diff --git a/chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc b/chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc
index 850ffafa56adb9443d4baad7a670ae10d3cfa136..c9c3ccbbed27ebf4ac9c9ab9d2f724c99a5dddf8 100644
--- a/chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc
+++ b/chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc
@@ -20,14 +20,24 @@
#include "chrome/common/extensions/extension_action.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/web_contents.h"
+#include "testing/gmock/include/gmock/gmock.h"
// These are a mash-up of the tests from from page_actions_apitest.cc and
// browser_actions_apitest.cc.
using extensions::Extension;
+using ::testing::_;
namespace {
+class MockActionIconFactory : public ExtensionAction::IconFactory {
+ public:
+ virtual ~MockActionIconFactory() {}
+
+ MOCK_METHOD2(GetIcon, gfx::ImageSkia(const ExtensionIconSet* icon_set,
+ ExtensionAction::Type type));
+};
+
class PageAsBrowserActionApiTest : public ExtensionApiTest {
public:
PageAsBrowserActionApiTest() {}
@@ -94,8 +104,11 @@ IN_PROC_BROWSER_TEST_F(PageAsBrowserActionApiTest, Basic) {
ASSERT_TRUE(catcher.GetNextResult());
}
+ MockActionIconFactory mock_icon_factory;
+ EXPECT_CALL(mock_icon_factory, GetIcon(_, _)).Times(0);
+
// Test that we received the changes.
- EXPECT_FALSE(action->GetIcon(tab_id).IsEmpty());
+ EXPECT_FALSE(action->GetIcon(tab_id, &mock_icon_factory).IsEmpty());
}
// Test that calling chrome.pageAction.setPopup() can enable a popup.

Powered by Google App Engine
This is Rietveld 408576698