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

Side by Side Diff: sync/internal_api/test_user_share.cc

Issue 10534080: sync: move internal_api components used by chrome/browser into internal_api/public (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/internal_api/test_user_share.h ('k') | sync/internal_api/user_share.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "sync/internal_api/test_user_share.h"
6
7 #include "base/compiler_specific.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace browser_sync {
11
12 TestUserShare::TestUserShare() {}
13
14 TestUserShare::~TestUserShare() {
15 if (user_share_.get())
16 ADD_FAILURE() << "Should have called TestUserShare::TearDown()";
17 }
18
19 void TestUserShare::SetUp() {
20 user_share_.reset(new sync_api::UserShare());
21 dir_maker_.SetUp();
22
23 // The pointer is owned by dir_maker_, we should not be storing it in a
24 // scoped_ptr. We must be careful to ensure the scoped_ptr never deletes it.
25 user_share_->directory.reset(dir_maker_.directory());
26 }
27
28 void TestUserShare::TearDown() {
29 // Ensure the scoped_ptr doesn't delete the memory we don't own.
30 ignore_result(user_share_->directory.release());
31
32 user_share_.reset();
33 dir_maker_.TearDown();
34 }
35
36 sync_api::UserShare* TestUserShare::user_share() {
37 return user_share_.get();
38 }
39
40 } // namespace browser_sync
OLDNEW
« no previous file with comments | « sync/internal_api/test_user_share.h ('k') | sync/internal_api/user_share.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698