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

Side by Side Diff: chrome/browser/sync/test/integration/sync_arc_package_helper.h

Issue 2174753004: arc:Integration test for Arc package Chrome sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@current
Patch Set: Modify target Created 4 years, 4 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
OLDNEW
(Empty)
1 // Copyright 2016 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 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_ARC_PACKAGE_HELPER_H_
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_ARC_PACKAGE_HELPER_H_
7
8 #include <unordered_map>
9
10 #include "base/macros.h"
11 #include "base/memory/singleton.h"
12 #include "components/arc/common/app.mojom.h"
13
14 class Profile;
15 class SyncTest;
16
17 namespace arc{
18 class FakeAppInstance;
19 }
20
21 namespace chromeos {
22 class ScopedUserManagerEnabler;
23 }
24
25 namespace arc {
26
27 class SyncArcPackageHelper {
28 public:
29 static SyncArcPackageHelper* GetInstance();
30
31 void SetupTest(SyncTest* test);
32
33 void CleanUp();
34
35 void InstallPackageWithIndex(Profile* profile, size_t id);
36
37 void UninstallPackageWithIndex(Profile* profile, size_t id);
38
39 void ClearPackages(Profile* profile);
40
41 bool AllProfilesHaveSamePackages();
42
43 bool AllProfilesHaveSamePackageDetails();
44
45 void SetupArcService(Profile* profile, size_t id);
46
47 private:
48 friend struct base::DefaultSingletonTraits<SyncArcPackageHelper>;
49
50 SyncArcPackageHelper();
51 ~SyncArcPackageHelper();
52
53 void InstallPackage(Profile* profile, const mojom::ArcPackageInfo& package);
54
55 void UninstallPackage(Profile* profile, const std::string& package_name);
56
57 // Returns true if |profile1| has the same arc packages as |profile2|.
58 bool ArcPackagesMatch(Profile* profile1, Profile* profile2);
59
60 // Returns true if |profile1| has the same arc packages and detail package
61 // informaton as |profile2|.
62 bool ArcPackageDetailsMatch(Profile* profile1, Profile* profile2);
63
64 SyncTest* test_;
65 bool setup_completed_;
66
67 std::unordered_map<Profile*, std::unique_ptr<FakeAppInstance>> instance_map_;
68
69 std::unique_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_;
70
71 DISALLOW_COPY_AND_ASSIGN(SyncArcPackageHelper);
72 };
73
74 } // namespace arc
75
76 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_ARC_PACKAGE_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698