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

Unified Diff: sync/protocol/proto_enum_conversions_unittest.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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
« no previous file with comments | « sync/protocol/proto_enum_conversions.cc ('k') | sync/protocol/proto_value_conversions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/protocol/proto_enum_conversions_unittest.cc
diff --git a/sync/protocol/proto_enum_conversions_unittest.cc b/sync/protocol/proto_enum_conversions_unittest.cc
deleted file mode 100644
index 247d918435588c061464f02b6ee24bed66fde966..0000000000000000000000000000000000000000
--- a/sync/protocol/proto_enum_conversions_unittest.cc
+++ /dev/null
@@ -1,101 +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.
-
-// Keep this file in sync with the .proto files in this directory.
-
-#include "sync/protocol/proto_enum_conversions.h"
-
-#include <string>
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace syncer {
-namespace {
-
-class ProtoEnumConversionsTest : public testing::Test {
-};
-
-template <class T>
-void TestEnumStringFunction(const char* (*enum_string_fn)(T),
- int enum_min, int enum_max) {
- for (int i = enum_min; i <= enum_max; ++i) {
- const std::string& str = enum_string_fn(static_cast<T>(i));
- EXPECT_FALSE(str.empty());
- }
-}
-
-TEST_F(ProtoEnumConversionsTest, GetAppListItemTypeString) {
- TestEnumStringFunction(
- GetAppListItemTypeString,
- sync_pb::AppListSpecifics::AppListItemType_MIN,
- sync_pb::AppListSpecifics::AppListItemType_MAX);
-}
-
-TEST_F(ProtoEnumConversionsTest, GetBrowserTypeString) {
- TestEnumStringFunction(
- GetBrowserTypeString,
- sync_pb::SessionWindow::BrowserType_MIN,
- sync_pb::SessionWindow::BrowserType_MAX);
-}
-
-TEST_F(ProtoEnumConversionsTest, GetPageTransitionString) {
- TestEnumStringFunction(
- GetPageTransitionString,
- sync_pb::SyncEnums::PageTransition_MIN,
- sync_pb::SyncEnums::PageTransition_MAX);
-}
-
-TEST_F(ProtoEnumConversionsTest, GetPageTransitionQualifierString) {
- TestEnumStringFunction(
- GetPageTransitionRedirectTypeString,
- sync_pb::SyncEnums::PageTransitionRedirectType_MIN,
- sync_pb::SyncEnums::PageTransitionRedirectType_MAX);
-}
-
-TEST_F(ProtoEnumConversionsTest, GetWifiCredentialSecurityClassString) {
- TestEnumStringFunction(
- GetWifiCredentialSecurityClassString,
- sync_pb::WifiCredentialSpecifics::SecurityClass_MIN,
- sync_pb::WifiCredentialSpecifics::SecurityClass_MAX);
-}
-
-TEST_F(ProtoEnumConversionsTest, GetUpdatesSourceString) {
- TestEnumStringFunction(
- GetUpdatesSourceString,
- sync_pb::GetUpdatesCallerInfo::GetUpdatesSource_MIN,
- sync_pb::GetUpdatesCallerInfo::PERIODIC);
- TestEnumStringFunction(
- GetUpdatesSourceString,
- sync_pb::GetUpdatesCallerInfo::RETRY,
- sync_pb::GetUpdatesCallerInfo::GetUpdatesSource_MAX);
-}
-
-TEST_F(ProtoEnumConversionsTest, GetResponseTypeString) {
- TestEnumStringFunction(
- GetResponseTypeString,
- sync_pb::CommitResponse::ResponseType_MIN,
- sync_pb::CommitResponse::ResponseType_MAX);
-}
-
-TEST_F(ProtoEnumConversionsTest, GetErrorTypeString) {
- // We have a gap, so we need to do two ranges.
- TestEnumStringFunction(
- GetErrorTypeString,
- sync_pb::SyncEnums::ErrorType_MIN,
- sync_pb::SyncEnums::MIGRATION_DONE);
- TestEnumStringFunction(
- GetErrorTypeString,
- sync_pb::SyncEnums::UNKNOWN,
- sync_pb::SyncEnums::ErrorType_MAX);
-}
-
-TEST_F(ProtoEnumConversionsTest, GetActionString) {
- TestEnumStringFunction(
- GetActionString,
- sync_pb::SyncEnums::Action_MIN,
- sync_pb::SyncEnums::Action_MAX);
-}
-
-} // namespace
-} // namespace syncer
« no previous file with comments | « sync/protocol/proto_enum_conversions.cc ('k') | sync/protocol/proto_value_conversions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698