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

Side by Side Diff: sync/internal_api/public/test/test_user_share.h

Issue 11360259: Sync: Add DeviceInfo's ChangeProcessor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sync_client.cc Created 8 years, 1 month 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
OLDNEW
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 // UserShare instance for unit tests that require one. 6 // 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 21 matching lines...) Expand all
32 32
33 #include "base/basictypes.h" 33 #include "base/basictypes.h"
34 #include "sync/internal_api/public/base/model_type.h" 34 #include "sync/internal_api/public/base/model_type.h"
35 #include "sync/internal_api/public/user_share.h" 35 #include "sync/internal_api/public/user_share.h"
36 36
37 namespace syncer { 37 namespace syncer {
38 38
39 class SyncEncryptionHandler; 39 class SyncEncryptionHandler;
40 class TestDirectorySetterUpper; 40 class TestDirectorySetterUpper;
41 41
42 namespace syncable {
43 class TestTransactionObserver;
44 }
45
42 class TestUserShare { 46 class TestUserShare {
43 public: 47 public:
44 TestUserShare(); 48 TestUserShare();
45 ~TestUserShare(); 49 ~TestUserShare();
46 50
47 // Sets up the UserShare instance. Clears any existing database 51 // Sets up the UserShare instance. Clears any existing database
48 // backing files that might exist on disk. 52 // backing files that might exist on disk.
49 void SetUp(); 53 void SetUp();
50 54
51 // Undo everything done by SetUp(): closes the UserShare and deletes 55 // Undo everything done by SetUp(): closes the UserShare and deletes
52 // the backing files. Before closing the directory, this will run 56 // the backing files. Before closing the directory, this will run
53 // the directory invariant checks and perform the SaveChanges action 57 // the directory invariant checks and perform the SaveChanges action
54 // on the user share's directory. 58 // on the user share's directory.
55 void TearDown(); 59 void TearDown();
56 60
57 // Non-NULL iff called between a call to SetUp() and TearDown(). 61 // Non-NULL iff called between a call to SetUp() and TearDown().
58 UserShare* user_share(); 62 UserShare* user_share();
59 63
60 // Sync's encryption handler. Used by tests to invoke the sync encryption 64 // Sync's encryption handler. Used by tests to invoke the sync encryption
61 // methods normally handled via the SyncBackendHost 65 // methods normally handled via the SyncBackendHost
62 SyncEncryptionHandler* encryption_handler(); 66 SyncEncryptionHandler* encryption_handler();
63 67
68 // Returns the directory's transaction observer. This transaction observer
69 // has methods which can be helpful when writing test assertions.
70 syncable::TestTransactionObserver* transaction_observer();
71
64 // A helper function to pretend to download this type's root node. 72 // A helper function to pretend to download this type's root node.
65 static bool CreateRoot(syncer::ModelType model_type, 73 static bool CreateRoot(syncer::ModelType model_type,
66 syncer::UserShare* service); 74 syncer::UserShare* service);
67 75
68 private: 76 private:
69 scoped_ptr<TestDirectorySetterUpper> dir_maker_; 77 scoped_ptr<TestDirectorySetterUpper> dir_maker_;
70 scoped_ptr<UserShare> user_share_; 78 scoped_ptr<UserShare> user_share_;
71 79
72 DISALLOW_COPY_AND_ASSIGN(TestUserShare); 80 DISALLOW_COPY_AND_ASSIGN(TestUserShare);
73 }; 81 };
74 82
75 } // namespace syncer 83 } // namespace syncer
76 84
77 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_TEST_USER_SHARE_H_ 85 #endif // SYNC_INTERNAL_API_PUBLIC_TEST_TEST_USER_SHARE_H_
OLDNEW
« no previous file with comments | « sync/internal_api/public/test/fake_sync_manager.h ('k') | sync/internal_api/sync_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698