| 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 "chrome/browser/extensions/extension_action_manager.h" | 5 #include "chrome/browser/extensions/extension_action_manager.h" |
| 6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
| 7 #include "chrome/browser/extensions/extension_tab_util.h" | 7 #include "chrome/browser/extensions/extension_tab_util.h" |
| 8 #include "chrome/browser/extensions/test_extension_dir.h" | 8 #include "chrome/browser/extensions/test_extension_dir.h" |
| 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 10 #include "chrome/common/extensions/features/feature_channel.h" | 10 #include "chrome/common/extensions/features/feature_channel.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 " \"permissions\": [\n" | 28 " \"permissions\": [\n" |
| 29 " \"declarativeContent\"\n" | 29 " \"declarativeContent\"\n" |
| 30 " ]\n" | 30 " ]\n" |
| 31 "}\n"; | 31 "}\n"; |
| 32 | 32 |
| 33 class SetIconAPITest : public ExtensionApiTest { | 33 class SetIconAPITest : public ExtensionApiTest { |
| 34 public: | 34 public: |
| 35 SetIconAPITest() | 35 SetIconAPITest() |
| 36 // Set the channel to "trunk" since declarativeContent is restricted | 36 // Set the channel to "trunk" since declarativeContent is restricted |
| 37 // to trunk. | 37 // to trunk. |
| 38 : current_channel_(chrome::VersionInfo::CHANNEL_UNKNOWN) { | 38 : current_channel_(version_info::Channel::UNKNOWN) { |
| 39 } | 39 } |
| 40 ~SetIconAPITest() override {} | 40 ~SetIconAPITest() override {} |
| 41 | 41 |
| 42 extensions::ScopedCurrentChannel current_channel_; | 42 extensions::ScopedCurrentChannel current_channel_; |
| 43 TestExtensionDir ext_dir_; | 43 TestExtensionDir ext_dir_; |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 IN_PROC_BROWSER_TEST_F(SetIconAPITest, Overview) { | 46 IN_PROC_BROWSER_TEST_F(SetIconAPITest, Overview) { |
| 47 ext_dir_.WriteManifest(kDeclarativeContentManifest); | 47 ext_dir_.WriteManifest(kDeclarativeContentManifest); |
| 48 ext_dir_.WriteFile( | 48 ext_dir_.WriteFile( |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 EXPECT_TRUE(page_action->GetDeclarativeIcon(tab_id).IsEmpty()); | 87 EXPECT_TRUE(page_action->GetDeclarativeIcon(tab_id).IsEmpty()); |
| 88 NavigateInRenderer(tab, GURL("http://test1/")); | 88 NavigateInRenderer(tab, GURL("http://test1/")); |
| 89 EXPECT_FALSE(page_action->GetDeclarativeIcon(tab_id).IsEmpty()); | 89 EXPECT_FALSE(page_action->GetDeclarativeIcon(tab_id).IsEmpty()); |
| 90 | 90 |
| 91 // Navigating to an unmatched page should reset the icon. | 91 // Navigating to an unmatched page should reset the icon. |
| 92 NavigateInRenderer(tab, GURL("http://test2/")); | 92 NavigateInRenderer(tab, GURL("http://test2/")); |
| 93 EXPECT_TRUE(page_action->GetDeclarativeIcon(tab_id).IsEmpty()); | 93 EXPECT_TRUE(page_action->GetDeclarativeIcon(tab_id).IsEmpty()); |
| 94 } | 94 } |
| 95 } // namespace | 95 } // namespace |
| 96 } // namespace extensions | 96 } // namespace extensions |
| OLD | NEW |