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

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

Issue 1669163002: [Extensions] Allow extensions to set a rectangular icon for the extension action (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/extension_action/extension_action_api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" 9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
10 #include "chrome/browser/extensions/browser_action_test_util.h" 10 #include "chrome/browser/extensions/browser_action_test_util.h"
(...skipping 13 matching lines...) Expand all
24 #include "content/public/browser/notification_service.h" 24 #include "content/public/browser/notification_service.h"
25 #include "content/public/browser/render_frame_host.h" 25 #include "content/public/browser/render_frame_host.h"
26 #include "content/public/browser/web_contents.h" 26 #include "content/public/browser/web_contents.h"
27 #include "content/public/test/browser_test_utils.h" 27 #include "content/public/test/browser_test_utils.h"
28 #include "extensions/browser/extension_registry.h" 28 #include "extensions/browser/extension_registry.h"
29 #include "extensions/browser/extension_system.h" 29 #include "extensions/browser/extension_system.h"
30 #include "extensions/browser/notification_types.h" 30 #include "extensions/browser/notification_types.h"
31 #include "extensions/browser/process_manager.h" 31 #include "extensions/browser/process_manager.h"
32 #include "extensions/browser/test_extension_registry_observer.h" 32 #include "extensions/browser/test_extension_registry_observer.h"
33 #include "extensions/common/feature_switch.h" 33 #include "extensions/common/feature_switch.h"
34 #include "extensions/test/extension_test_message_listener.h"
34 #include "extensions/test/result_catcher.h" 35 #include "extensions/test/result_catcher.h"
35 #include "grit/theme_resources.h" 36 #include "grit/theme_resources.h"
36 #include "net/dns/mock_host_resolver.h" 37 #include "net/dns/mock_host_resolver.h"
37 #include "net/test/embedded_test_server/embedded_test_server.h" 38 #include "net/test/embedded_test_server/embedded_test_server.h"
38 #include "ui/base/resource/resource_bundle.h" 39 #include "ui/base/resource/resource_bundle.h"
39 #include "ui/gfx/geometry/rect.h" 40 #include "ui/gfx/geometry/rect.h"
40 #include "ui/gfx/geometry/size.h" 41 #include "ui/gfx/geometry/size.h"
41 #include "ui/gfx/image/canvas_image_source.h" 42 #include "ui/gfx/image/canvas_image_source.h"
42 #include "ui/gfx/image/image_skia.h" 43 #include "ui/gfx/image/image_skia.h"
43 #include "ui/gfx/image/image_skia_operations.h" 44 #include "ui/gfx/image/image_skia_operations.h"
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 GURL foo_url(embedded_test_server()->GetURL("foo.com", "/popup_iframe.html")); 730 GURL foo_url(embedded_test_server()->GetURL("foo.com", "/popup_iframe.html"));
730 std::string script = "location.href = '" + foo_url.spec() + "'"; 731 std::string script = "location.href = '" + foo_url.spec() + "'";
731 std::string result; 732 std::string result;
732 EXPECT_TRUE( 733 EXPECT_TRUE(
733 content::ExecuteScriptAndExtractString(frame_host, script, &result)); 734 content::ExecuteScriptAndExtractString(frame_host, script, &result));
734 EXPECT_EQ("DONE", result); 735 EXPECT_EQ("DONE", result);
735 736
736 EXPECT_TRUE(actions_bar->HidePopup()); 737 EXPECT_TRUE(actions_bar->HidePopup());
737 } 738 }
738 739
740 IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, BrowserActionWithRectangularIcon) {
741 ExtensionTestMessageListener ready_listener("ready", true);
742 ASSERT_TRUE(LoadExtension(
743 test_data_dir_.AppendASCII("browser_action").AppendASCII("rect_icon")));
744 EXPECT_TRUE(ready_listener.WaitUntilSatisfied());
745 gfx::Image first_icon = GetBrowserActionsBar()->GetIcon(0);
746 ResultCatcher catcher;
747 ready_listener.Reply(std::string());
748 EXPECT_TRUE(catcher.GetNextResult());
749 gfx::Image next_icon = GetBrowserActionsBar()->GetIcon(0);
750 EXPECT_FALSE(gfx::test::AreImagesEqual(first_icon, next_icon));
751 }
752
739 } // namespace 753 } // namespace
740 } // namespace extensions 754 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/extension_action/extension_action_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698