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

Unified Diff: sync/engine/cleanup_disabled_types_command_unittest.cc

Issue 10541079: [Sync] Remove CleanupDisabledTypes command and move purge logic into SyncManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 8 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/engine/cleanup_disabled_types_command.cc ('k') | sync/engine/sync_scheduler_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/cleanup_disabled_types_command_unittest.cc
diff --git a/sync/engine/cleanup_disabled_types_command_unittest.cc b/sync/engine/cleanup_disabled_types_command_unittest.cc
deleted file mode 100644
index 286ca8dfc5b745c6f08621f77ab588b899f92732..0000000000000000000000000000000000000000
--- a/sync/engine/cleanup_disabled_types_command_unittest.cc
+++ /dev/null
@@ -1,75 +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 <vector>
-
-#include "sync/engine/cleanup_disabled_types_command.h"
-
-#include "sync/internal_api/public/base/model_type_test_util.h"
-#include "sync/sessions/sync_session.h"
-#include "sync/test/engine/syncer_command_test.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace syncer {
-
-namespace {
-
-using testing::_;
-
-class CleanupDisabledTypesCommandTest : public MockDirectorySyncerCommandTest {
- public:
- CleanupDisabledTypesCommandTest() {}
-
- virtual void SetUp() {
- mutable_routing_info()->clear();
- (*mutable_routing_info())[BOOKMARKS] = GROUP_PASSIVE;
- MockDirectorySyncerCommandTest::SetUp();
- }
-};
-
-// TODO(tim): Add syncer test to verify previous routing info is set.
-TEST_F(CleanupDisabledTypesCommandTest, NoPreviousRoutingInfo) {
- CleanupDisabledTypesCommand command;
- ModelTypeSet expected = ModelTypeSet::All();
- expected.Remove(BOOKMARKS);
- EXPECT_CALL(*mock_directory(),
- PurgeEntriesWithTypeIn(HasModelTypes(expected)));
- command.ExecuteImpl(session());
-}
-
-TEST_F(CleanupDisabledTypesCommandTest, NoPurge) {
- CleanupDisabledTypesCommand command;
- EXPECT_CALL(*mock_directory(), PurgeEntriesWithTypeIn(_)).Times(0);
-
- ModelSafeRoutingInfo prev(routing_info());
- session()->context()->set_previous_session_routing_info(prev);
- (*mutable_routing_info())[AUTOFILL] = GROUP_PASSIVE;
- command.ExecuteImpl(session());
-
- prev = routing_info();
- command.ExecuteImpl(session());
-}
-
-TEST_F(CleanupDisabledTypesCommandTest, TypeDisabled) {
- CleanupDisabledTypesCommand command;
-
- (*mutable_routing_info())[AUTOFILL] = GROUP_PASSIVE;
- (*mutable_routing_info())[THEMES] = GROUP_PASSIVE;
- (*mutable_routing_info())[EXTENSIONS] = GROUP_PASSIVE;
-
- ModelSafeRoutingInfo prev(routing_info());
- prev[PASSWORDS] = GROUP_PASSIVE;
- prev[PREFERENCES] = GROUP_PASSIVE;
- session()->context()->set_previous_session_routing_info(prev);
-
- const ModelTypeSet expected(PASSWORDS, PREFERENCES);
- EXPECT_CALL(*mock_directory(),
- PurgeEntriesWithTypeIn(HasModelTypes(expected)));
- command.ExecuteImpl(session());
-}
-
-} // namespace
-
-} // namespace syncer
« no previous file with comments | « sync/engine/cleanup_disabled_types_command.cc ('k') | sync/engine/sync_scheduler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698