| OLD | NEW |
| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1218 ASSERT_TRUE(folder.good()); | 1218 ASSERT_TRUE(folder.good()); |
| 1219 EXPECT_TRUE(folder.Put(PARENT_ID, trans.root_id())); | 1219 EXPECT_TRUE(folder.Put(PARENT_ID, trans.root_id())); |
| 1220 EXPECT_TRUE(folder.Put(NON_UNIQUE_NAME, "CASECHANGE")); | 1220 EXPECT_TRUE(folder.Put(NON_UNIQUE_NAME, "CASECHANGE")); |
| 1221 EXPECT_TRUE(folder.Put(IS_DEL, true)); | 1221 EXPECT_TRUE(folder.Put(IS_DEL, true)); |
| 1222 } | 1222 } |
| 1223 | 1223 |
| 1224 // Create items of each model type, and check that GetModelType and | 1224 // Create items of each model type, and check that GetModelType and |
| 1225 // GetServerModelType return the right value. | 1225 // GetServerModelType return the right value. |
| 1226 TEST_F(SyncableDirectoryTest, GetModelType) { | 1226 TEST_F(SyncableDirectoryTest, GetModelType) { |
| 1227 TestIdFactory id_factory; | 1227 TestIdFactory id_factory; |
| 1228 for (int i = 0; i < MODEL_TYPE_COUNT; ++i) { | 1228 ModelTypeSet protocol_types = ProtocolTypes(); |
| 1229 ModelType datatype = ModelTypeFromInt(i); | 1229 for (ModelTypeSet::Iterator iter = protocol_types.First(); iter.Good(); |
| 1230 iter.Inc()) { |
| 1231 ModelType datatype = iter.Get(); |
| 1230 SCOPED_TRACE(testing::Message("Testing model type ") << datatype); | 1232 SCOPED_TRACE(testing::Message("Testing model type ") << datatype); |
| 1231 switch (datatype) { | 1233 switch (datatype) { |
| 1232 case UNSPECIFIED: | 1234 case UNSPECIFIED: |
| 1233 case TOP_LEVEL_FOLDER: | 1235 case TOP_LEVEL_FOLDER: |
| 1234 continue; // Datatype isn't a function of Specifics. | 1236 continue; // Datatype isn't a function of Specifics. |
| 1235 default: | 1237 default: |
| 1236 break; | 1238 break; |
| 1237 } | 1239 } |
| 1238 sync_pb::EntitySpecifics specifics; | 1240 sync_pb::EntitySpecifics specifics; |
| 1239 AddDefaultFieldValue(datatype, &specifics); | 1241 AddDefaultFieldValue(datatype, &specifics); |
| (...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2258 EXPECT_TRUE(CreateWithDefaultTag(factory_.NewServerId(), true)); | 2260 EXPECT_TRUE(CreateWithDefaultTag(factory_.NewServerId(), true)); |
| 2259 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), true)); | 2261 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), true)); |
| 2260 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), false)); | 2262 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewServerId(), false)); |
| 2261 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), false)); | 2263 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), false)); |
| 2262 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), true)); | 2264 EXPECT_FALSE(CreateWithDefaultTag(factory_.NewLocalId(), true)); |
| 2263 } | 2265 } |
| 2264 | 2266 |
| 2265 } // namespace | 2267 } // namespace |
| 2266 } // namespace syncable | 2268 } // namespace syncable |
| 2267 } // namespace syncer | 2269 } // namespace syncer |
| OLD | NEW |