Add ICU message format support
[chromium-blink-merge.git] / chrome / browser / sync / abstract_profile_sync_service_test.h
blob78c63f88364787abd343aba38969e95e4f50016b
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.
5 #ifndef CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_
6 #define CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_
8 #include <string>
10 #include "base/callback.h"
11 #include "base/compiler_specific.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/message_loop/message_loop.h"
14 #include "chrome/browser/sync/profile_sync_components_factory_mock.h"
15 #include "content/public/test/test_browser_thread_bundle.h"
16 #include "sync/internal_api/public/base/model_type.h"
17 #include "sync/internal_api/public/change_record.h"
18 #include "testing/gtest/include/gtest/gtest.h"
20 class ProfileSyncService;
21 class TestProfileSyncService;
23 namespace syncer {
24 struct UserShare;
25 } // namespace syncer
27 class ProfileSyncServiceTestHelper {
28 public:
29 static syncer::ImmutableChangeRecordList MakeSingletonChangeRecordList(
30 int64 node_id, syncer::ChangeRecord::Action action);
32 // Deletions must provide an EntitySpecifics for the deleted data.
33 static syncer::ImmutableChangeRecordList
34 MakeSingletonDeletionChangeRecordList(
35 int64 node_id,
36 const sync_pb::EntitySpecifics& specifics);
39 class AbstractProfileSyncServiceTest : public testing::Test {
40 public:
41 AbstractProfileSyncServiceTest();
42 ~AbstractProfileSyncServiceTest() override;
44 void SetUp() override;
46 void TearDown() override;
48 bool CreateRoot(syncer::ModelType model_type);
50 protected:
51 content::TestBrowserThreadBundle thread_bundle_;
52 TestProfileSyncService* sync_service_;
55 class CreateRootHelper {
56 public:
57 CreateRootHelper(AbstractProfileSyncServiceTest* test,
58 syncer::ModelType model_type);
59 virtual ~CreateRootHelper();
61 const base::Closure& callback() const;
62 bool success();
64 private:
65 void CreateRootCallback();
67 base::Closure callback_;
68 AbstractProfileSyncServiceTest* test_;
69 syncer::ModelType model_type_;
70 bool success_;
73 #endif // CHROME_BROWSER_SYNC_ABSTRACT_PROFILE_SYNC_SERVICE_TEST_H_