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

Side by Side Diff: components/sync/engine_impl/syncer_unittest.cc

Issue 2804743004: [Sync] Restrict types to configure to only include registered types (Closed)
Patch Set: Address comments, adjust unittest. Created 3 years, 8 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 | « components/sync/engine_impl/syncer.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "components/sync/engine_impl/syncer.h" 5 #include "components/sync/engine_impl/syncer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 5004 matching lines...) Expand 10 before | Expand all | Expand 10 after
5015 EXPECT_TRUE(n1.GetIsUnappliedUpdate()); 5015 EXPECT_TRUE(n1.GetIsUnappliedUpdate());
5016 5016
5017 // The second node was not downloaded. 5017 // The second node was not downloaded.
5018 Entry n2(&trans, GET_BY_ID, node2); 5018 Entry n2(&trans, GET_BY_ID, node2);
5019 EXPECT_FALSE(n2.good()); 5019 EXPECT_FALSE(n2.good());
5020 5020
5021 // One update remains undownloaded. 5021 // One update remains undownloaded.
5022 mock_server_->ClearUpdatesQueue(); 5022 mock_server_->ClearUpdatesQueue();
5023 } 5023 }
5024 5024
5025 // Tests that, after shutdown initiated, if set of types to download includes 5025 // Tests that if type is not registered with ModelTypeRegistry (e.g. because
5026 // unregistered type, DCHECK doesn't get triggered. 5026 // type's LoadModels failed), Syncer::ConfigureSyncShare runs without triggering
5027 TEST_F(SyncerTest, ConfigureUnregisteredTypesDuringShutdown) { 5027 // DCHECK.
5028 // Signal that shutdown is initiated. 5028 TEST_F(SyncerTest, ConfigureFailedUnregisteredType) {
5029 cancelation_signal_.Signal();
5030
5031 // Simulate type being unregistered before configuration by including type 5029 // Simulate type being unregistered before configuration by including type
5032 // that isn't registered with ModelTypeRegistry. 5030 // that isn't registered with ModelTypeRegistry.
5033 SyncShareConfigureTypes(ModelTypeSet(APPS)); 5031 SyncShareConfigureTypes(ModelTypeSet(APPS));
5034 5032
5035 // No explicit verification, DCHECK shouldn't have been triggered. 5033 // No explicit verification, DCHECK shouldn't have been triggered.
5036 } 5034 }
5037 5035
5038 TEST_F(SyncerTest, GetKeySuccess) { 5036 TEST_F(SyncerTest, GetKeySuccess) {
5039 { 5037 {
5040 syncable::ReadTransaction rtrans(FROM_HERE, directory()); 5038 syncable::ReadTransaction rtrans(FROM_HERE, directory());
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
5909 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); 5907 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id);
5910 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); 5908 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count);
5911 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); 5909 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count);
5912 } else { 5910 } else {
5913 EXPECT_TRUE(final_monitor_records.empty()) 5911 EXPECT_TRUE(final_monitor_records.empty())
5914 << "Should not restore records after successful bookmark commit."; 5912 << "Should not restore records after successful bookmark commit.";
5915 } 5913 }
5916 } 5914 }
5917 5915
5918 } // namespace syncer 5916 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/engine_impl/syncer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698