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

Side by Side Diff: chrome/common/safe_browsing/file_type_policies_unittest.cc

Issue 1986403002: Component updater for FileTypePolicies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@replace_download_ext
Patch Set: Fix test's enum check Created 4 years, 6 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
« no previous file with comments | « chrome/common/safe_browsing/file_type_policies.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/safe_browsing/file_type_policies.h" 5 #include "chrome/common/safe_browsing/file_type_policies.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 base::AutoLock lock(policies_.lock_); 200 base::AutoLock lock(policies_.lock_);
201 // Make a minimum viable config 201 // Make a minimum viable config
202 DownloadFileTypeConfig cfg; 202 DownloadFileTypeConfig cfg;
203 cfg.mutable_default_file_type()->add_platform_settings(); 203 cfg.mutable_default_file_type()->add_platform_settings();
204 cfg.add_file_types()->add_platform_settings(); 204 cfg.add_file_types()->add_platform_settings();
205 cfg.set_version_id(2); 205 cfg.set_version_id(2);
206 EXPECT_EQ(FileTypePolicies::UpdateResult::SUCCESS, 206 EXPECT_EQ(FileTypePolicies::UpdateResult::SUCCESS,
207 policies_.PopulateFromBinaryPb(cfg.SerializeAsString())); 207 policies_.PopulateFromBinaryPb(cfg.SerializeAsString()));
208 208
209 // Can't update to the same version 209 // Can't update to the same version
210 EXPECT_EQ(FileTypePolicies::UpdateResult::FAILED_VERSION_CHECK, 210 EXPECT_EQ(FileTypePolicies::UpdateResult::SKIPPED_VERSION_CHECK_EQUAL,
211 policies_.PopulateFromBinaryPb(cfg.SerializeAsString())); 211 policies_.PopulateFromBinaryPb(cfg.SerializeAsString()));
212 212
213 // Can't go backward 213 // Can't go backward
214 cfg.set_version_id(1); 214 cfg.set_version_id(1);
215 EXPECT_EQ(FileTypePolicies::UpdateResult::FAILED_VERSION_CHECK, 215 EXPECT_EQ(FileTypePolicies::UpdateResult::FAILED_VERSION_CHECK,
216 policies_.PopulateFromBinaryPb(cfg.SerializeAsString())); 216 policies_.PopulateFromBinaryPb(cfg.SerializeAsString()));
217 } 217 }
218 } // namespace safe_browsing 218 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/common/safe_browsing/file_type_policies.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698