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

Side by Side Diff: sync/syncable/directory_unittest.cc

Issue 1393633003: Sync: fix for the code that checks whether the initial download has completed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR feedback Created 5 years, 2 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 | « sync/syncable/directory.cc ('k') | sync/test/engine/mock_connection_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "sync/syncable/directory_unittest.h" 5 #include "sync/syncable/directory_unittest.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/test/values_test_util.h" 9 #include "base/test/values_test_util.h"
10 #include "sync/internal_api/public/base/attachment_id_proto.h" 10 #include "sync/internal_api/public/base/attachment_id_proto.h"
(...skipping 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after
2103 item.GetServerSpecifics())); 2103 item.GetServerSpecifics()));
2104 2104
2105 // Verify sharing with BASE_SERVER_SPECIFICS. 2105 // Verify sharing with BASE_SERVER_SPECIFICS.
2106 EXPECT_FALSE(EntitySpecificsValuesAreSame(item.GetServerSpecifics(), 2106 EXPECT_FALSE(EntitySpecificsValuesAreSame(item.GetServerSpecifics(),
2107 item.GetBaseServerSpecifics())); 2107 item.GetBaseServerSpecifics()));
2108 item.PutBaseServerSpecifics(specifics3); 2108 item.PutBaseServerSpecifics(specifics3);
2109 EXPECT_TRUE(EntitySpecificsValuesAreSame(item.GetServerSpecifics(), 2109 EXPECT_TRUE(EntitySpecificsValuesAreSame(item.GetServerSpecifics(),
2110 item.GetBaseServerSpecifics())); 2110 item.GetBaseServerSpecifics()));
2111 } 2111 }
2112 2112
2113 // Tests checking and marking a type as having its initial sync completed.
2114 TEST_F(SyncableDirectoryTest, InitialSyncEndedForType) {
2115 // Not completed if there is no root node.
2116 EXPECT_FALSE(dir()->InitialSyncEndedForType(PREFERENCES));
2117
2118 WriteTransaction trans(FROM_HERE, UNITTEST, dir().get());
2119 // Create the root node.
2120 ModelNeutralMutableEntry entry(&trans, syncable::CREATE_NEW_TYPE_ROOT,
2121 PREFERENCES);
2122 DCHECK(entry.good());
2123
2124 entry.PutServerIsDir(true);
2125 entry.PutUniqueServerTag(ModelTypeToRootTag(PREFERENCES));
2126
2127 // Should still be marked as incomplete.
2128 EXPECT_FALSE(dir()->InitialSyncEndedForType(&trans, PREFERENCES));
2129
2130 // Mark as complete and verify.
2131 dir()->MarkInitialSyncEndedForType(&trans, PREFERENCES);
2132 EXPECT_TRUE(dir()->InitialSyncEndedForType(&trans, PREFERENCES));
2133 }
2134
2113 } // namespace syncable 2135 } // namespace syncable
2114 2136
2115 } // namespace syncer 2137 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/syncable/directory.cc ('k') | sync/test/engine/mock_connection_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698