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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/sync_arc_package_helper.h
diff --git a/chrome/browser/sync/test/integration/sync_arc_package_helper.h b/chrome/browser/sync/test/integration/sync_arc_package_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..e83d3a97a7238b8bce17c7f831e42356da4f3ba9
--- /dev/null
+++ b/chrome/browser/sync/test/integration/sync_arc_package_helper.h
@@ -0,0 +1,76 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_ARC_PACKAGE_HELPER_H_
+#define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_ARC_PACKAGE_HELPER_H_
+
+#include <unordered_map>
+
+#include "base/macros.h"
+#include "base/memory/singleton.h"
+#include "components/arc/common/app.mojom.h"
+
+class Profile;
+class SyncTest;
+
+namespace arc{
+class FakeAppInstance;
+}
+
+namespace chromeos {
+class ScopedUserManagerEnabler;
+}
+
+namespace arc {
+
+class SyncArcPackageHelper {
+ public:
+ static SyncArcPackageHelper* GetInstance();
+
+ void SetupTest(SyncTest* test);
+
+ void CleanUp();
+
+ void InstallPackageWithIndex(Profile* profile, size_t id);
+
+ void UninstallPackageWithIndex(Profile* profile, size_t id);
+
+ void ClearPackages(Profile* profile);
+
+ bool AllProfilesHaveSamePackages();
+
+ bool AllProfilesHaveSamePackageDetails();
+
+ void SetupArcService(Profile* profile, size_t id);
+
+ private:
+ friend struct base::DefaultSingletonTraits<SyncArcPackageHelper>;
+
+ SyncArcPackageHelper();
+ ~SyncArcPackageHelper();
+
+ void InstallPackage(Profile* profile, const mojom::ArcPackageInfo& package);
+
+ void UninstallPackage(Profile* profile, const std::string& package_name);
+
+ // Returns true if |profile1| has the same arc packages as |profile2|.
+ bool ArcPackagesMatch(Profile* profile1, Profile* profile2);
+
+ // Returns true if |profile1| has the same arc packages and detail package
+ // informaton as |profile2|.
+ bool ArcPackageDetailsMatch(Profile* profile1, Profile* profile2);
+
+ SyncTest* test_;
+ bool setup_completed_;
+
+ std::unordered_map<Profile*, std::unique_ptr<FakeAppInstance>> instance_map_;
+
+ std::unique_ptr<chromeos::ScopedUserManagerEnabler> user_manager_enabler_;
+
+ DISALLOW_COPY_AND_ASSIGN(SyncArcPackageHelper);
+};
+
+} // namespace arc
+
+#endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_ARC_PACKAGE_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698