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

Unified Diff: sync/test/engine/test_directory_setter_upper.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/test/engine/test_directory_setter_upper.h ('k') | sync/test/engine/test_id_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/test/engine/test_directory_setter_upper.cc
diff --git a/sync/test/engine/test_directory_setter_upper.cc b/sync/test/engine/test_directory_setter_upper.cc
deleted file mode 100644
index e71964e37f4726564244e5ee5470c49fefce263c..0000000000000000000000000000000000000000
--- a/sync/test/engine/test_directory_setter_upper.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 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 "sync/test/engine/test_directory_setter_upper.h"
-
-#include "base/compiler_specific.h"
-#include "base/files/file_util.h"
-#include "base/location.h"
-#include "base/strings/string_util.h"
-#include "sync/syncable/directory.h"
-#include "sync/syncable/in_memory_directory_backing_store.h"
-#include "sync/syncable/mutable_entry.h"
-#include "sync/syncable/syncable_read_transaction.h"
-#include "sync/syncable/syncable_write_transaction.h"
-#include "sync/test/test_transaction_observer.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace syncer {
-
-TestDirectorySetterUpper::TestDirectorySetterUpper() : name_("Test") {}
-
-TestDirectorySetterUpper::~TestDirectorySetterUpper() {}
-
-void TestDirectorySetterUpper::SetUp() {
- test_transaction_observer_.reset(new syncable::TestTransactionObserver());
- WeakHandle<syncable::TransactionObserver> transaction_observer =
- MakeWeakHandle(test_transaction_observer_->AsWeakPtr());
-
- directory_.reset(new syncable::Directory(
- new syncable::InMemoryDirectoryBackingStore(name_),
- MakeWeakHandle(handler_.GetWeakPtr()), base::Closure(),
- &encryption_handler_, encryption_handler_.cryptographer()));
- ASSERT_EQ(syncable::OPENED, directory_->Open(
- name_, &delegate_, transaction_observer));
-}
-
-void TestDirectorySetterUpper::SetUpWith(
- syncer::syncable::DirectoryBackingStore* directory_store) {
- CHECK(directory_store);
- test_transaction_observer_.reset(new syncable::TestTransactionObserver());
- WeakHandle<syncable::TransactionObserver> transaction_observer =
- MakeWeakHandle(test_transaction_observer_->AsWeakPtr());
-
- directory_.reset(new syncable::Directory(
- directory_store, MakeWeakHandle(handler_.GetWeakPtr()), base::Closure(),
- &encryption_handler_, encryption_handler_.cryptographer()));
- ASSERT_EQ(syncable::OPENED, directory_->Open(
- name_, &delegate_, transaction_observer));
-}
-
-void TestDirectorySetterUpper::TearDown() {
- if (!directory()->good())
- return;
-
- RunInvariantCheck();
- directory()->SaveChanges();
- RunInvariantCheck();
- directory()->SaveChanges();
-
- directory_.reset();
-}
-
-void TestDirectorySetterUpper::RunInvariantCheck() {
- // Check invariants for all items.
- syncable::ReadTransaction trans(FROM_HERE, directory());
-
- // The TestUnrecoverableErrorHandler that this directory was constructed with
- // will handle error reporting, so we can safely ignore the return value.
- directory()->FullyCheckTreeInvariants(&trans);
-}
-
-} // namespace syncer
« no previous file with comments | « sync/test/engine/test_directory_setter_upper.h ('k') | sync/test/engine/test_id_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698