OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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 "chrome/test/sync/engine/test_user_share.h" | |
6 | |
7 #include "base/compiler_specific.h" | |
8 | |
9 namespace browser_sync { | |
10 | |
11 TestUserShare::TestUserShare() {} | |
12 | |
13 TestUserShare::~TestUserShare() { | |
14 CHECK(!user_share_.dir_manager.get()); | |
15 } | |
16 | |
17 void TestUserShare::SetUp() { | |
18 setter_upper_.SetUp(); | |
19 // HACK: We have two scoped_ptrs to the same object. But we make | |
20 // sure to release one in TearDown. | |
21 user_share_.dir_manager.reset(setter_upper_.manager()); | |
22 user_share_.name = setter_upper_.name(); | |
23 } | |
24 | |
25 void TestUserShare::TearDown() { | |
26 // Make sure we don't free the manager twice. | |
27 ignore_result(user_share_.dir_manager.release()); | |
28 setter_upper_.TearDown(); | |
29 } | |
30 | |
31 sync_api::UserShare* TestUserShare::user_share() { | |
32 return &user_share_; | |
33 } | |
34 | |
35 } // namespace browser_sync | |
OLD | NEW |