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