OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // A handy class that takes care of setting up and destroying a | 5 // A handy class that takes care of setting up and destroying a |
6 // syncer::UserShare instance for unit tests that require one. | 6 // syncer::UserShare instance for unit tests that require one. |
7 // | 7 // |
8 // The expected usage is to make this a component of your test fixture: | 8 // The expected usage is to make this a component of your test fixture: |
9 // | 9 // |
10 // class AwesomenessTest : public testing::Test { | 10 // class AwesomenessTest : public testing::Test { |
(...skipping 11 matching lines...) Expand all Loading... |
22 // Then, in your tests: | 22 // Then, in your tests: |
23 // | 23 // |
24 // TEST_F(AwesomenessTest, IsMaximal) { | 24 // TEST_F(AwesomenessTest, IsMaximal) { |
25 // syncer::ReadTransaction trans(test_user_share_.user_share()); | 25 // syncer::ReadTransaction trans(test_user_share_.user_share()); |
26 // ... | 26 // ... |
27 // } | 27 // } |
28 // | 28 // |
29 | 29 |
30 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_TEST_USER_SHARE_H_ | 30 #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_TEST_USER_SHARE_H_ |
31 #define SYNC_INTERNAL_API_PUBLIC_TEST_TEST_USER_SHARE_H_ | 31 #define SYNC_INTERNAL_API_PUBLIC_TEST_TEST_USER_SHARE_H_ |
32 #pragma once | |
33 | 32 |
34 #include "base/basictypes.h" | 33 #include "base/basictypes.h" |
35 #include "sync/internal_api/public/user_share.h" | 34 #include "sync/internal_api/public/user_share.h" |
36 | 35 |
37 namespace syncer { | 36 namespace syncer { |
38 | 37 |
39 class TestDirectorySetterUpper; | 38 class TestDirectorySetterUpper; |
40 | 39 |
41 class TestUserShare { | 40 class TestUserShare { |
42 public: | 41 public: |
(...skipping 16 matching lines...) Expand all Loading... |
59 private: | 58 private: |
60 scoped_ptr<TestDirectorySetterUpper> dir_maker_; | 59 scoped_ptr<TestDirectorySetterUpper> dir_maker_; |
61 scoped_ptr<syncer::UserShare> user_share_; | 60 scoped_ptr<syncer::UserShare> user_share_; |
62 | 61 |
63 DISALLOW_COPY_AND_ASSIGN(TestUserShare); | 62 DISALLOW_COPY_AND_ASSIGN(TestUserShare); |
64 }; | 63 }; |
65 | 64 |
66 } // namespace syncer | 65 } // namespace syncer |
67 | 66 |
68 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_TEST_USER_SHARE_H_ | 67 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_TEST_USER_SHARE_H_ |
OLD | NEW |