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

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

Issue 1781563003: chrome.browserAction.setBadgeBackgroundColor accepts color keyword (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 ASSERT_EQ(SkColorSetARGB(255, 255, 255, 255), 625 ASSERT_EQ(SkColorSetARGB(255, 255, 255, 255),
626 action->GetBadgeBackgroundColor(ExtensionAction::kDefaultTabId)); 626 action->GetBadgeBackgroundColor(ExtensionAction::kDefaultTabId));
627 627
628 ui_test_utils::NavigateToURL(browser(), 628 ui_test_utils::NavigateToURL(browser(),
629 GURL(extension->GetResourceURL("update3.html"))); 629 GURL(extension->GetResourceURL("update3.html")));
630 ASSERT_TRUE(catcher.GetNextResult()); 630 ASSERT_TRUE(catcher.GetNextResult());
631 631
632 // Test that hsl() values 'hsl(120, 100%, 50%)' set color correctly. 632 // Test that hsl() values 'hsl(120, 100%, 50%)' set color correctly.
633 ASSERT_EQ(SkColorSetARGB(255, 0, 255, 0), 633 ASSERT_EQ(SkColorSetARGB(255, 0, 255, 0),
634 action->GetBadgeBackgroundColor(ExtensionAction::kDefaultTabId)); 634 action->GetBadgeBackgroundColor(ExtensionAction::kDefaultTabId));
635
636 // Test basic color keyword set correctly.
637 ui_test_utils::NavigateToURL(browser(),
638 GURL(extension->GetResourceURL("update4.html")));
639 ASSERT_TRUE(catcher.GetNextResult());
640
641 ASSERT_EQ(SkColorSetARGB(255, 0, 0, 255),
642 action->GetBadgeBackgroundColor(ExtensionAction::kDefaultTabId));
635 } 643 }
636 644
637 IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, Getters) { 645 IN_PROC_BROWSER_TEST_F(BrowserActionApiTest, Getters) {
638 ASSERT_TRUE(RunExtensionTest("browser_action/getters")) << message_; 646 ASSERT_TRUE(RunExtensionTest("browser_action/getters")) << message_;
639 const Extension* extension = GetSingleLoadedExtension(); 647 const Extension* extension = GetSingleLoadedExtension();
640 ASSERT_TRUE(extension) << message_; 648 ASSERT_TRUE(extension) << message_;
641 649
642 // Test that there is a browser action in the toolbar. 650 // Test that there is a browser action in the toolbar.
643 ASSERT_EQ(1, GetBrowserActionsBar()->NumberOfBrowserActions()); 651 ASSERT_EQ(1, GetBrowserActionsBar()->NumberOfBrowserActions());
644 652
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 test_data_dir_.AppendASCII("browser_action/open_popup_on_reply"))); 789 test_data_dir_.AppendASCII("browser_action/open_popup_on_reply")));
782 EXPECT_TRUE(listener.WaitUntilSatisfied()); 790 EXPECT_TRUE(listener.WaitUntilSatisfied());
783 791
784 ResultCatcher catcher; 792 ResultCatcher catcher;
785 listener.Reply(std::string()); 793 listener.Reply(std::string());
786 EXPECT_TRUE(catcher.GetNextResult()) << message_; 794 EXPECT_TRUE(catcher.GetNextResult()) << message_;
787 } 795 }
788 796
789 } // namespace 797 } // namespace
790 } // namespace extensions 798 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/extension_action/extension_action_api.cc » ('j') | extensions/common/image_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698