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

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

Issue 11958029: [Sync] Add support for proxy types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switch to ProxyTypes Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « sync/syncable/model_type.cc ('k') | sync/syncable/syncable_unittest.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "sync/internal_api/public/base/model_type.h" 5 #include "sync/internal_api/public/base/model_type.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/test/values_test_util.h" 10 #include "base/test/values_test_util.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 EXPECT_FALSE(IsRealDataType(MODEL_TYPE_COUNT)); 66 EXPECT_FALSE(IsRealDataType(MODEL_TYPE_COUNT));
67 EXPECT_FALSE(IsRealDataType(TOP_LEVEL_FOLDER)); 67 EXPECT_FALSE(IsRealDataType(TOP_LEVEL_FOLDER));
68 EXPECT_TRUE(IsRealDataType(FIRST_REAL_MODEL_TYPE)); 68 EXPECT_TRUE(IsRealDataType(FIRST_REAL_MODEL_TYPE));
69 EXPECT_TRUE(IsRealDataType(BOOKMARKS)); 69 EXPECT_TRUE(IsRealDataType(BOOKMARKS));
70 EXPECT_TRUE(IsRealDataType(APPS)); 70 EXPECT_TRUE(IsRealDataType(APPS));
71 } 71 }
72 72
73 // Make sure we can convert ModelTypes to and from specifics field 73 // Make sure we can convert ModelTypes to and from specifics field
74 // numbers. 74 // numbers.
75 TEST_F(ModelTypeTest, ModelTypeToFromSpecificsFieldNumber) { 75 TEST_F(ModelTypeTest, ModelTypeToFromSpecificsFieldNumber) {
76 for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) { 76 ModelTypeSet protocol_types = ProtocolTypes();
77 ModelType model_type = ModelTypeFromInt(i); 77 for (ModelTypeSet::Iterator iter = protocol_types.First(); iter.Good();
78 int field_number = GetSpecificsFieldNumberFromModelType(model_type); 78 iter.Inc()) {
79 EXPECT_EQ(model_type, 79 int field_number = GetSpecificsFieldNumberFromModelType(iter.Get());
80 EXPECT_EQ(iter.Get(),
80 GetModelTypeFromSpecificsFieldNumber(field_number)); 81 GetModelTypeFromSpecificsFieldNumber(field_number));
81 } 82 }
82 } 83 }
83 84
84 TEST_F(ModelTypeTest, ModelTypeOfInvalidSpecificsFieldNumber) { 85 TEST_F(ModelTypeTest, ModelTypeOfInvalidSpecificsFieldNumber) {
85 EXPECT_EQ(UNSPECIFIED, GetModelTypeFromSpecificsFieldNumber(0)); 86 EXPECT_EQ(UNSPECIFIED, GetModelTypeFromSpecificsFieldNumber(0));
86 } 87 }
87 88
88 } // namespace 89 } // namespace
89 } // namespace syncer 90 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/syncable/model_type.cc ('k') | sync/syncable/syncable_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698