OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_service_unittest.h" | 5 #include "chrome/browser/extensions/extension_service_unittest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2161 // We'll write the extension manifest dynamically to a temporary path | 2161 // We'll write the extension manifest dynamically to a temporary path |
2162 // to make it easier to change the version number. | 2162 // to make it easier to change the version number. |
2163 FilePath extension_path = temp.path(); | 2163 FilePath extension_path = temp.path(); |
2164 FilePath manifest_path = extension_path.Append(Extension::kManifestFilename); | 2164 FilePath manifest_path = extension_path.Append(Extension::kManifestFilename); |
2165 ASSERT_FALSE(file_util::PathExists(manifest_path)); | 2165 ASSERT_FALSE(file_util::PathExists(manifest_path)); |
2166 | 2166 |
2167 // Start with version 2.0. | 2167 // Start with version 2.0. |
2168 DictionaryValue manifest; | 2168 DictionaryValue manifest; |
2169 manifest.SetString("version", "2.0"); | 2169 manifest.SetString("version", "2.0"); |
2170 manifest.SetString("name", "LOAD Downgrade Test"); | 2170 manifest.SetString("name", "LOAD Downgrade Test"); |
| 2171 manifest.SetInteger("manifest_version", 2); |
2171 | 2172 |
2172 JSONFileValueSerializer serializer(manifest_path); | 2173 JSONFileValueSerializer serializer(manifest_path); |
2173 ASSERT_TRUE(serializer.Serialize(manifest)); | 2174 ASSERT_TRUE(serializer.Serialize(manifest)); |
2174 | 2175 |
2175 extensions::UnpackedInstaller::Create(service_)->Load(extension_path); | 2176 extensions::UnpackedInstaller::Create(service_)->Load(extension_path); |
2176 loop_.RunAllPending(); | 2177 loop_.RunAllPending(); |
2177 | 2178 |
2178 EXPECT_EQ(0u, GetErrors().size()); | 2179 EXPECT_EQ(0u, GetErrors().size()); |
2179 ASSERT_EQ(1u, loaded_.size()); | 2180 ASSERT_EQ(1u, loaded_.size()); |
2180 EXPECT_EQ(Extension::LOAD, loaded_[0]->location()); | 2181 EXPECT_EQ(Extension::LOAD, loaded_[0]->location()); |
(...skipping 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4290 ASSERT_FALSE(AddPendingSyncInstall()); | 4291 ASSERT_FALSE(AddPendingSyncInstall()); |
4291 | 4292 |
4292 // Wait for the external source to install. | 4293 // Wait for the external source to install. |
4293 WaitForCrxInstall(crx_path_, INSTALL_NEW); | 4294 WaitForCrxInstall(crx_path_, INSTALL_NEW); |
4294 ASSERT_TRUE(IsCrxInstalled()); | 4295 ASSERT_TRUE(IsCrxInstalled()); |
4295 | 4296 |
4296 // Now that the extension is installed, sync request should fail | 4297 // Now that the extension is installed, sync request should fail |
4297 // because the extension is already installed. | 4298 // because the extension is already installed. |
4298 ASSERT_FALSE(AddPendingSyncInstall()); | 4299 ASSERT_FALSE(AddPendingSyncInstall()); |
4299 } | 4300 } |
OLD | NEW |