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

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: Cleanup 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
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) {
77 ModelType model_type = ModelTypeFromInt(i); 77 ModelType model_type = ModelTypeFromInt(i);
78 if (VirtualTypes().Has(model_type))
79 continue;
78 int field_number = GetSpecificsFieldNumberFromModelType(model_type); 80 int field_number = GetSpecificsFieldNumberFromModelType(model_type);
79 EXPECT_EQ(model_type, 81 EXPECT_EQ(model_type,
80 GetModelTypeFromSpecificsFieldNumber(field_number)); 82 GetModelTypeFromSpecificsFieldNumber(field_number));
81 } 83 }
82 } 84 }
83 85
84 TEST_F(ModelTypeTest, ModelTypeOfInvalidSpecificsFieldNumber) { 86 TEST_F(ModelTypeTest, ModelTypeOfInvalidSpecificsFieldNumber) {
85 EXPECT_EQ(UNSPECIFIED, GetModelTypeFromSpecificsFieldNumber(0)); 87 EXPECT_EQ(UNSPECIFIED, GetModelTypeFromSpecificsFieldNumber(0));
86 } 88 }
87 89
88 } // namespace 90 } // namespace
89 } // namespace syncer 91 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698