OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 | 6 |
7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
8 #include "chrome/browser/extensions/extension_action.h" | 8 #include "chrome/browser/extensions/extension_action.h" |
9 #include "chrome/test/base/testing_profile.h" | 9 #include "chrome/test/base/testing_profile.h" |
| 10 #include "content/public/test/test_browser_thread_bundle.h" |
10 #include "extensions/browser/extension_registry.h" | 11 #include "extensions/browser/extension_registry.h" |
11 #include "extensions/common/extension_builder.h" | 12 #include "extensions/common/extension_builder.h" |
12 #include "extensions/common/manifest_handlers/icons_handler.h" | 13 #include "extensions/common/manifest_handlers/icons_handler.h" |
13 #include "extensions/common/value_builder.h" | 14 #include "extensions/common/value_builder.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 | 16 |
16 namespace extensions { | 17 namespace extensions { |
17 | 18 |
18 namespace { | 19 namespace { |
19 | 20 |
(...skipping 28 matching lines...) Expand all Loading... |
48 const Extension& extension); | 49 const Extension& extension); |
49 | 50 |
50 // Tests that values that are missing from the |action_type| key are properly | 51 // Tests that values that are missing from the |action_type| key are properly |
51 // populated with values from the other keys in the manifest (e.g. | 52 // populated with values from the other keys in the manifest (e.g. |
52 // "default_icon" key of |action_type| is populated with "icons" key). | 53 // "default_icon" key of |action_type| is populated with "icons" key). |
53 void TestPopulateMissingValues(const char* action_type); | 54 void TestPopulateMissingValues(const char* action_type); |
54 | 55 |
55 ExtensionActionManager* manager() { return manager_; } | 56 ExtensionActionManager* manager() { return manager_; } |
56 | 57 |
57 private: | 58 private: |
| 59 content::TestBrowserThreadBundle thread_bundle_; |
58 ExtensionRegistry* registry_; | 60 ExtensionRegistry* registry_; |
59 int curr_id_; | 61 int curr_id_; |
60 ExtensionActionManager* manager_; | 62 ExtensionActionManager* manager_; |
61 scoped_ptr<TestingProfile> profile_; | 63 scoped_ptr<TestingProfile> profile_; |
62 }; | 64 }; |
63 | 65 |
64 ExtensionActionManagerTest::ExtensionActionManagerTest() | 66 ExtensionActionManagerTest::ExtensionActionManagerTest() |
65 : curr_id_(0), | 67 : curr_id_(0), |
66 profile_(new TestingProfile) { | 68 profile_(new TestingProfile) { |
67 registry_ = ExtensionRegistry::Get(profile_.get()); | 69 registry_ = ExtensionRegistry::Get(profile_.get()); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 manager()->GetBestFitAction(*extension.get(), ActionInfo::TYPE_BROWSER); | 217 manager()->GetBestFitAction(*extension.get(), ActionInfo::TYPE_BROWSER); |
216 | 218 |
217 // Now these values match because |extension| does not have page action | 219 // Now these values match because |extension| does not have page action |
218 // defaults. | 220 // defaults. |
219 ASSERT_TRUE(TitlesMatch(*extension.get(), *action)); | 221 ASSERT_TRUE(TitlesMatch(*extension.get(), *action)); |
220 ASSERT_TRUE(IconsMatch(*extension.get(), 48, *action, 38)); | 222 ASSERT_TRUE(IconsMatch(*extension.get(), 48, *action, 38)); |
221 } | 223 } |
222 | 224 |
223 } // namespace | 225 } // namespace |
224 } // namespace extensions | 226 } // namespace extensions |
OLD | NEW |