Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: extensions/browser/updater/update_service_unittest.cc

Issue 1575523002: Comparison and streaming operators for base::Version (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698