| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/api/developer_private/extension_info_generat
or.h" | 5 #include "chrome/browser/extensions/api/developer_private/extension_info_generat
or.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 203 |
| 204 private: | 204 private: |
| 205 base::Closure quit_closure_; | 205 base::Closure quit_closure_; |
| 206 | 206 |
| 207 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoGeneratorUnitTest); | 207 DISALLOW_COPY_AND_ASSIGN(ExtensionInfoGeneratorUnitTest); |
| 208 }; | 208 }; |
| 209 | 209 |
| 210 // Test some of the basic fields. | 210 // Test some of the basic fields. |
| 211 TEST_F(ExtensionInfoGeneratorUnitTest, BasicInfoTest) { | 211 TEST_F(ExtensionInfoGeneratorUnitTest, BasicInfoTest) { |
| 212 // Enable error console for testing. | 212 // Enable error console for testing. |
| 213 ResetThreadBundle(content::TestBrowserThreadBundle::DEFAULT); | |
| 214 FeatureSwitch::ScopedOverride error_console_override( | 213 FeatureSwitch::ScopedOverride error_console_override( |
| 215 FeatureSwitch::error_console(), true); | 214 FeatureSwitch::error_console(), true); |
| 216 profile()->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode, true); | 215 profile()->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode, true); |
| 217 | 216 |
| 218 const char kName[] = "extension name"; | 217 const char kName[] = "extension name"; |
| 219 const char kVersion[] = "1.0.0.1"; | 218 const char kVersion[] = "1.0.0.1"; |
| 220 std::string id = crx_file::id_util::GenerateId("alpha"); | 219 std::string id = crx_file::id_util::GenerateId("alpha"); |
| 221 std::unique_ptr<base::DictionaryValue> manifest = | 220 std::unique_ptr<base::DictionaryValue> manifest = |
| 222 DictionaryBuilder() | 221 DictionaryBuilder() |
| 223 .Set("name", kName) | 222 .Set("name", kName) |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 info_list = GenerateExtensionsInfo(); | 465 info_list = GenerateExtensionsInfo(); |
| 467 info1 = GetInfoFromList(info_list, id1); | 466 info1 = GetInfoFromList(info_list, id1); |
| 468 info2 = GetInfoFromList(info_list, id2); | 467 info2 = GetInfoFromList(info_list, id2); |
| 469 ASSERT_NE(nullptr, info1); | 468 ASSERT_NE(nullptr, info1); |
| 470 ASSERT_NE(nullptr, info2); | 469 ASSERT_NE(nullptr, info2); |
| 471 EXPECT_EQ(developer::EXTENSION_STATE_BLACKLISTED, info1->state); | 470 EXPECT_EQ(developer::EXTENSION_STATE_BLACKLISTED, info1->state); |
| 472 EXPECT_EQ(developer::EXTENSION_STATE_ENABLED, info2->state); | 471 EXPECT_EQ(developer::EXTENSION_STATE_ENABLED, info2->state); |
| 473 } | 472 } |
| 474 | 473 |
| 475 } // namespace extensions | 474 } // namespace extensions |
| OLD | NEW |