| 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/common/extensions/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 EXPECT_FALSE(extension); | 119 EXPECT_FALSE(extension); |
| 120 EXPECT_EQ(expected_error, error); | 120 EXPECT_EQ(expected_error, error); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } | 123 } |
| 124 | 124 |
| 125 class ExtensionTest : public testing::Test { | 125 class ExtensionTest : public testing::Test { |
| 126 protected: | 126 protected: |
| 127 virtual void SetUp() OVERRIDE { | 127 virtual void SetUp() OVERRIDE { |
| 128 ManifestHandler::Register(extension_manifest_keys::kCommands, | 128 ManifestHandler::Register(extension_manifest_keys::kCommands, |
| 129 new CommandsHandler); | 129 make_linked_ptr(new CommandsHandler)); |
| 130 } | 130 } |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 // We persist location values in the preferences, so this is a sanity test that | 133 // We persist location values in the preferences, so this is a sanity test that |
| 134 // someone doesn't accidentally change them. | 134 // someone doesn't accidentally change them. |
| 135 TEST_F(ExtensionTest, LocationValuesTest) { | 135 TEST_F(ExtensionTest, LocationValuesTest) { |
| 136 ASSERT_EQ(0, Manifest::INVALID_LOCATION); | 136 ASSERT_EQ(0, Manifest::INVALID_LOCATION); |
| 137 ASSERT_EQ(1, Manifest::INTERNAL); | 137 ASSERT_EQ(1, Manifest::INTERNAL); |
| 138 ASSERT_EQ(2, Manifest::EXTERNAL_PREF); | 138 ASSERT_EQ(2, Manifest::EXTERNAL_PREF); |
| 139 ASSERT_EQ(3, Manifest::EXTERNAL_REGISTRY); | 139 ASSERT_EQ(3, Manifest::EXTERNAL_REGISTRY); |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1292 scoped_refptr<Extension> extension( | 1292 scoped_refptr<Extension> extension( |
| 1293 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), | 1293 MakeSyncTestExtension(EXTENSION, GURL(), GURL(), |
| 1294 Manifest::INTERNAL, 2, FilePath(), | 1294 Manifest::INTERNAL, 2, FilePath(), |
| 1295 Extension::NO_FLAGS)); | 1295 Extension::NO_FLAGS)); |
| 1296 if (extension) | 1296 if (extension) |
| 1297 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); | 1297 EXPECT_EQ(extension->GetSyncType(), Extension::SYNC_TYPE_NONE); |
| 1298 } | 1298 } |
| 1299 #endif // !defined(OS_CHROMEOS) | 1299 #endif // !defined(OS_CHROMEOS) |
| 1300 | 1300 |
| 1301 } // namespace extensions | 1301 } // namespace extensions |
| OLD | NEW |