| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/format_macros.h" | 6 #include "base/format_macros.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 TEST(ExtensionTest, LocationValuesTest) { | 36 TEST(ExtensionTest, LocationValuesTest) { |
| 37 ASSERT_EQ(0, Manifest::INVALID_LOCATION); | 37 ASSERT_EQ(0, Manifest::INVALID_LOCATION); |
| 38 ASSERT_EQ(1, Manifest::INTERNAL); | 38 ASSERT_EQ(1, Manifest::INTERNAL); |
| 39 ASSERT_EQ(2, Manifest::EXTERNAL_PREF); | 39 ASSERT_EQ(2, Manifest::EXTERNAL_PREF); |
| 40 ASSERT_EQ(3, Manifest::EXTERNAL_REGISTRY); | 40 ASSERT_EQ(3, Manifest::EXTERNAL_REGISTRY); |
| 41 ASSERT_EQ(4, Manifest::UNPACKED); | 41 ASSERT_EQ(4, Manifest::UNPACKED); |
| 42 ASSERT_EQ(5, Manifest::COMPONENT); | 42 ASSERT_EQ(5, Manifest::COMPONENT); |
| 43 ASSERT_EQ(6, Manifest::EXTERNAL_PREF_DOWNLOAD); | 43 ASSERT_EQ(6, Manifest::EXTERNAL_PREF_DOWNLOAD); |
| 44 ASSERT_EQ(7, Manifest::EXTERNAL_POLICY_DOWNLOAD); | 44 ASSERT_EQ(7, Manifest::EXTERNAL_POLICY_DOWNLOAD); |
| 45 ASSERT_EQ(8, Manifest::COMMAND_LINE); | 45 ASSERT_EQ(8, Manifest::COMMAND_LINE); |
| 46 ASSERT_EQ(9, Manifest::EXTERNAL_POLICY); |
| 46 } | 47 } |
| 47 | 48 |
| 48 TEST(ExtensionTest, LocationPriorityTest) { | 49 TEST(ExtensionTest, LocationPriorityTest) { |
| 49 for (int i = 0; i < Manifest::NUM_LOCATIONS; i++) { | 50 for (int i = 0; i < Manifest::NUM_LOCATIONS; i++) { |
| 50 Manifest::Location loc = static_cast<Manifest::Location>(i); | 51 Manifest::Location loc = static_cast<Manifest::Location>(i); |
| 51 | 52 |
| 52 // INVALID is not a valid location. | 53 // INVALID is not a valid location. |
| 53 if (loc == Manifest::INVALID_LOCATION) | 54 if (loc == Manifest::INVALID_LOCATION) |
| 54 continue; | 55 continue; |
| 55 | 56 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 | 346 |
| 346 extension = LoadManifest("app", "manifest.json", Extension::FROM_BOOKMARK); | 347 extension = LoadManifest("app", "manifest.json", Extension::FROM_BOOKMARK); |
| 347 EXPECT_TRUE(extension->from_bookmark()); | 348 EXPECT_TRUE(extension->from_bookmark()); |
| 348 | 349 |
| 349 extension = LoadManifest("app", "manifest.json", Extension::NO_FLAGS); | 350 extension = LoadManifest("app", "manifest.json", Extension::NO_FLAGS); |
| 350 EXPECT_FALSE(extension->from_bookmark()); | 351 EXPECT_FALSE(extension->from_bookmark()); |
| 351 EXPECT_FALSE(extension->from_webstore()); | 352 EXPECT_FALSE(extension->from_webstore()); |
| 352 } | 353 } |
| 353 | 354 |
| 354 } // namespace extensions | 355 } // namespace extensions |
| OLD | NEW |