| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 std::vector<std::string> ids; | 193 std::vector<std::string> ids; |
| 194 ids.push_back(extension1->id()); | 194 ids.push_back(extension1->id()); |
| 195 | 195 |
| 196 // Start an update check and verify that the UpdateClient was sent the right | 196 // Start an update check and verify that the UpdateClient was sent the right |
| 197 // data. | 197 // data. |
| 198 update_service()->StartUpdateCheck(ids); | 198 update_service()->StartUpdateCheck(ids); |
| 199 std::vector<update_client::CrxComponent>* data = update_client()->data(); | 199 std::vector<update_client::CrxComponent>* data = update_client()->data(); |
| 200 ASSERT_NE(nullptr, data); | 200 ASSERT_NE(nullptr, data); |
| 201 ASSERT_EQ(1u, data->size()); | 201 ASSERT_EQ(1u, data->size()); |
| 202 | 202 |
| 203 ASSERT_TRUE(data->at(0).version.Equals(*extension1->version())); | 203 ASSERT_EQ(data->at(0).version, *extension1->version()); |
| 204 update_client::CrxInstaller* installer = data->at(0).installer.get(); | 204 update_client::CrxInstaller* installer = data->at(0).installer.get(); |
| 205 ASSERT_NE(installer, nullptr); | 205 ASSERT_NE(installer, nullptr); |
| 206 | 206 |
| 207 // The GetInstalledFile method is used when processing differential updates | 207 // The GetInstalledFile method is used when processing differential updates |
| 208 // to get a path to an existing file in an extension. We want to test a | 208 // to get a path to an existing file in an extension. We want to test a |
| 209 // number of scenarios to be user we handle invalid relative paths, don't | 209 // number of scenarios to be user we handle invalid relative paths, don't |
| 210 // accidentally return paths outside the extension's dir, etc. | 210 // accidentally return paths outside the extension's dir, etc. |
| 211 base::FilePath tmp; | 211 base::FilePath tmp; |
| 212 EXPECT_TRUE(installer->GetInstalledFile(foo_js.MaybeAsASCII(), &tmp)); | 212 EXPECT_TRUE(installer->GetInstalledFile(foo_js.MaybeAsASCII(), &tmp)); |
| 213 EXPECT_EQ(temp_dir.path().Append(foo_js), tmp) << tmp.value(); | 213 EXPECT_EQ(temp_dir.path().Append(foo_js), tmp) << tmp.value(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 242 std::vector<FakeExtensionSystem::InstallUpdateRequest>* requests = | 242 std::vector<FakeExtensionSystem::InstallUpdateRequest>* requests = |
| 243 extension_system()->install_requests(); | 243 extension_system()->install_requests(); |
| 244 ASSERT_EQ(1u, requests->size()); | 244 ASSERT_EQ(1u, requests->size()); |
| 245 EXPECT_EQ(requests->at(0).extension_id, extension1->id()); | 245 EXPECT_EQ(requests->at(0).extension_id, extension1->id()); |
| 246 EXPECT_NE(requests->at(0).temp_dir.value(), new_version_dir.path().value()); | 246 EXPECT_NE(requests->at(0).temp_dir.value(), new_version_dir.path().value()); |
| 247 } | 247 } |
| 248 | 248 |
| 249 } // namespace | 249 } // namespace |
| 250 | 250 |
| 251 } // namespace extensions | 251 } // namespace extensions |
| OLD | NEW |