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

Unified Diff: sync/internal_api/test/test_user_share.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/internal_api/test/test_internal_components_factory.cc ('k') | sync/internal_api/user_share.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/test/test_user_share.cc
diff --git a/sync/internal_api/test/test_user_share.cc b/sync/internal_api/test/test_user_share.cc
deleted file mode 100644
index c1e0e30ef7a395c6c1d6e9dcafe9d09e0013d1d3..0000000000000000000000000000000000000000
--- a/sync/internal_api/test/test_user_share.cc
+++ /dev/null
@@ -1,85 +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/internal_api/public/test/test_user_share.h"
-
-#include <stddef.h>
-
-#include "base/compiler_specific.h"
-#include "sync/syncable/directory.h"
-#include "sync/syncable/mutable_entry.h"
-#include "sync/syncable/syncable_read_transaction.h"
-#include "sync/syncable/syncable_write_transaction.h"
-#include "sync/test/engine/test_directory_setter_upper.h"
-#include "sync/test/engine/test_id_factory.h"
-#include "sync/test/engine/test_syncable_utils.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace syncer {
-
-TestUserShare::TestUserShare() : dir_maker_(new TestDirectorySetterUpper()) {}
-
-TestUserShare::~TestUserShare() {
- if (user_share_)
- ADD_FAILURE() << "Should have called TestUserShare::TearDown()";
-}
-
-void TestUserShare::SetUp() {
- user_share_.reset(new UserShare());
- dir_maker_->SetUp();
-
- // The pointer is owned by dir_maker_, we should not be storing it in a
- // unique_ptr. We must be careful to ensure the unique_ptr never deletes it.
- user_share_->directory.reset(dir_maker_->directory());
-}
-
-void TestUserShare::TearDown() {
- // Ensure the unique_ptr doesn't delete the memory we don't own.
- ignore_result(user_share_->directory.release());
-
- user_share_.reset();
- dir_maker_->TearDown();
-}
-
-bool TestUserShare::Reload() {
- if (!user_share_->directory->SaveChanges())
- return false;
-
- syncer::syncable::DirectoryBackingStore* saved_store =
- user_share_->directory->store_.release();
-
- // Ensure the unique_ptr doesn't delete the memory we don't own.
- ignore_result(user_share_->directory.release());
- user_share_.reset(new UserShare());
- dir_maker_->SetUpWith(saved_store);
- user_share_->directory.reset(dir_maker_->directory());
- return true;
-}
-
-UserShare* TestUserShare::user_share() {
- return user_share_.get();
-}
-
-SyncEncryptionHandler* TestUserShare::encryption_handler() {
- return dir_maker_->encryption_handler();
-}
-
-syncable::TestTransactionObserver* TestUserShare::transaction_observer() {
- return dir_maker_->transaction_observer();
-}
-
-/* static */
-bool TestUserShare::CreateRoot(ModelType model_type, UserShare* user_share) {
- syncer::syncable::Directory* directory = user_share->directory.get();
- syncable::WriteTransaction wtrans(FROM_HERE, syncable::UNITTEST, directory);
- CreateTypeRoot(&wtrans, directory, model_type);
- return true;
-}
-
-size_t TestUserShare::GetDeleteJournalSize() const {
- syncable::ReadTransaction trans(FROM_HERE, user_share_->directory.get());
- return user_share_->directory->delete_journal()->GetDeleteJournalSize(&trans);
-}
-
-} // namespace syncer
« no previous file with comments | « sync/internal_api/test/test_internal_components_factory.cc ('k') | sync/internal_api/user_share.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698