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

Unified Diff: chrome/browser/sync/syncable/model_type_unittest.cc

Issue 9699057: [Sync] Move 'sync' target to sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Tim's comments Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/syncable/model_type_unittest.cc
diff --git a/chrome/browser/sync/syncable/model_type_unittest.cc b/chrome/browser/sync/syncable/model_type_unittest.cc
deleted file mode 100644
index f28867400908f71937403c0e41ba8f757400e1fe..0000000000000000000000000000000000000000
--- a/chrome/browser/sync/syncable/model_type_unittest.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/sync/syncable/model_type.h"
-
-#include <string>
-
-#include "base/memory/scoped_ptr.h"
-#include "base/test/values_test_util.h"
-#include "base/values.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace syncable {
-namespace {
-
-class ModelTypeTest : public testing::Test {};
-
-TEST_F(ModelTypeTest, ModelTypeToValue) {
- for (int i = syncable::FIRST_REAL_MODEL_TYPE;
- i < syncable::MODEL_TYPE_COUNT; ++i) {
- ModelType model_type = ModelTypeFromInt(i);
- base::ExpectStringValue(ModelTypeToString(model_type),
- ModelTypeToValue(model_type));
- }
- base::ExpectStringValue("Top-level folder",
- ModelTypeToValue(TOP_LEVEL_FOLDER));
- base::ExpectStringValue("Unspecified",
- ModelTypeToValue(UNSPECIFIED));
-}
-
-TEST_F(ModelTypeTest, ModelTypeFromValue) {
- for (int i = syncable::FIRST_REAL_MODEL_TYPE;
- i < syncable::MODEL_TYPE_COUNT; ++i) {
- ModelType model_type = ModelTypeFromInt(i);
- scoped_ptr<StringValue> value(ModelTypeToValue(model_type));
- EXPECT_EQ(model_type, ModelTypeFromValue(*value));
- }
-}
-
-TEST_F(ModelTypeTest, ModelTypeSetToValue) {
- const ModelTypeSet model_types(syncable::BOOKMARKS, syncable::APPS);
-
- scoped_ptr<ListValue> value(ModelTypeSetToValue(model_types));
- EXPECT_EQ(2u, value->GetSize());
- std::string types[2];
- EXPECT_TRUE(value->GetString(0, &types[0]));
- EXPECT_TRUE(value->GetString(1, &types[1]));
- EXPECT_EQ("Bookmarks", types[0]);
- EXPECT_EQ("Apps", types[1]);
-}
-
-TEST_F(ModelTypeTest, ModelTypeSetFromValue) {
- // Try empty set first.
- ModelTypeSet model_types;
- scoped_ptr<ListValue> value(ModelTypeSetToValue(model_types));
- EXPECT_TRUE(model_types.Equals(ModelTypeSetFromValue(*value)));
-
- // Now try with a few random types.
- model_types.Put(BOOKMARKS);
- model_types.Put(APPS);
- value.reset(ModelTypeSetToValue(model_types));
- EXPECT_TRUE(model_types.Equals(ModelTypeSetFromValue(*value)));
-}
-
-TEST_F(ModelTypeTest, IsRealDataType) {
- EXPECT_FALSE(IsRealDataType(UNSPECIFIED));
- EXPECT_FALSE(IsRealDataType(MODEL_TYPE_COUNT));
- EXPECT_FALSE(IsRealDataType(TOP_LEVEL_FOLDER));
- EXPECT_TRUE(IsRealDataType(FIRST_REAL_MODEL_TYPE));
- EXPECT_TRUE(IsRealDataType(BOOKMARKS));
- EXPECT_TRUE(IsRealDataType(APPS));
-}
-
-} // namespace
-} // namespace syncable
« no previous file with comments | « chrome/browser/sync/syncable/model_type_test_util.cc ('k') | chrome/browser/sync/syncable/on_disk_directory_backing_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698