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/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 } | 697 } |
698 | 698 |
699 private: | 699 private: |
700 void SetUpCommandLine(base::CommandLine* command_line) override { | 700 void SetUpCommandLine(base::CommandLine* command_line) override { |
701 DeclarativeContentApiTest::SetUpCommandLine(command_line); | 701 DeclarativeContentApiTest::SetUpCommandLine(command_line); |
702 override_toolbar_redesign_.reset(new FeatureSwitch::ScopedOverride( | 702 override_toolbar_redesign_.reset(new FeatureSwitch::ScopedOverride( |
703 FeatureSwitch::extension_action_redesign(), enable_redesign_)); | 703 FeatureSwitch::extension_action_redesign(), enable_redesign_)); |
704 } | 704 } |
705 | 705 |
706 bool enable_redesign_; | 706 bool enable_redesign_; |
707 scoped_ptr<FeatureSwitch::ScopedOverride> override_toolbar_redesign_; | 707 std::unique_ptr<FeatureSwitch::ScopedOverride> override_toolbar_redesign_; |
708 DISALLOW_COPY_AND_ASSIGN(ShowPageActionWithoutPageActionTest); | 708 DISALLOW_COPY_AND_ASSIGN(ShowPageActionWithoutPageActionTest); |
709 }; | 709 }; |
710 | 710 |
711 class ShowPageActionWithoutPageActionLegacyTest | 711 class ShowPageActionWithoutPageActionLegacyTest |
712 : public ShowPageActionWithoutPageActionTest { | 712 : public ShowPageActionWithoutPageActionTest { |
713 protected: | 713 protected: |
714 ShowPageActionWithoutPageActionLegacyTest() | 714 ShowPageActionWithoutPageActionLegacyTest() |
715 : ShowPageActionWithoutPageActionTest(false) {} | 715 : ShowPageActionWithoutPageActionTest(false) {} |
716 }; | 716 }; |
717 | 717 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 ASSERT_TRUE(extension); | 830 ASSERT_TRUE(extension); |
831 const ExtensionAction* page_action = ExtensionActionManager::Get( | 831 const ExtensionAction* page_action = ExtensionActionManager::Get( |
832 browser()->profile())->GetPageAction(*extension); | 832 browser()->profile())->GetPageAction(*extension); |
833 ASSERT_TRUE(page_action); | 833 ASSERT_TRUE(page_action); |
834 | 834 |
835 // Create two tabs. | 835 // Create two tabs. |
836 content::WebContents* const tab1 = | 836 content::WebContents* const tab1 = |
837 browser()->tab_strip_model()->GetWebContentsAt(0); | 837 browser()->tab_strip_model()->GetWebContentsAt(0); |
838 | 838 |
839 AddTabAtIndex(1, GURL("http://test2/"), ui::PAGE_TRANSITION_LINK); | 839 AddTabAtIndex(1, GURL("http://test2/"), ui::PAGE_TRANSITION_LINK); |
840 scoped_ptr<content::WebContents> tab2( | 840 std::unique_ptr<content::WebContents> tab2( |
841 browser()->tab_strip_model()->GetWebContentsAt(1)); | 841 browser()->tab_strip_model()->GetWebContentsAt(1)); |
842 | 842 |
843 // Add a rule matching the second tab. | 843 // Add a rule matching the second tab. |
844 const std::string kAddTestRules = | 844 const std::string kAddTestRules = |
845 "addRules([{\n" | 845 "addRules([{\n" |
846 " id: '1',\n" | 846 " id: '1',\n" |
847 " conditions: [new PageStateMatcher({\n" | 847 " conditions: [new PageStateMatcher({\n" |
848 " pageUrl: {hostPrefix: \"test1\"}})],\n" | 848 " pageUrl: {hostPrefix: \"test1\"}})],\n" |
849 " actions: [new ShowPageAction()]\n" | 849 " actions: [new ShowPageAction()]\n" |
850 "}, {\n" | 850 "}, {\n" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 // action interfaces, add a test that checks that a navigation always evaluates | 925 // action interfaces, add a test that checks that a navigation always evaluates |
926 // consistent URL state for all conditions. i.e.: if condition1 evaluates to | 926 // consistent URL state for all conditions. i.e.: if condition1 evaluates to |
927 // false on url0 and true on url1, and condition2 evaluates to true on url0 and | 927 // false on url0 and true on url1, and condition2 evaluates to true on url0 and |
928 // false on url1, navigate from url0 to url1 and validate that no action is | 928 // false on url1, navigate from url0 to url1 and validate that no action is |
929 // triggered. Do the same when navigating back to url0. This kind of test is | 929 // triggered. Do the same when navigating back to url0. This kind of test is |
930 // unfortunately not feasible with the current implementation and the existing | 930 // unfortunately not feasible with the current implementation and the existing |
931 // supported conditions and actions. | 931 // supported conditions and actions. |
932 | 932 |
933 } // namespace | 933 } // namespace |
934 } // namespace extensions | 934 } // namespace extensions |
OLD | NEW |