Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / sync / test / integration / extensions_helper.h
blobf789d0ce42cfa963087712bdad20e62585b0198d
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_TEST_INTEGRATION_EXTENSIONS_HELPER_H_
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_EXTENSIONS_HELPER_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "chrome/browser/sync/test/integration/sync_test.h"
15 class Profile;
17 namespace extensions_helper {
19 // Returns true iff profiles with indices |index1| and |index2| have the same
20 // extensions.
21 bool HasSameExtensions(int index1, int index2) WARN_UNUSED_RESULT;
23 // Returns true iff the profile with index |index| has the same extensions
24 // as the verifier.
25 bool HasSameExtensionsAsVerifier(int index) WARN_UNUSED_RESULT;
27 // Returns true iff all existing profiles have the same extensions
28 // as the verifier.
29 bool AllProfilesHaveSameExtensionsAsVerifier() WARN_UNUSED_RESULT;
31 // Returns true iff all existing profiles have the same extensions.
32 bool AllProfilesHaveSameExtensions() WARN_UNUSED_RESULT;
34 // Installs the extension for the given index to |profile|, and returns the
35 // extension ID of the new extension.
36 std::string InstallExtension(Profile* profile, int index);
38 // Installs the extension for the given index to all profiles (including the
39 // verifier), and returns the extension ID of the new extension.
40 std::string InstallExtensionForAllProfiles(int index);
42 // Uninstalls the extension for the given index from |profile|. Assumes that
43 // it was previously installed.
44 void UninstallExtension(Profile* profile, int index);
46 // Returns a vector containing the indices of all currently installed
47 // test extensions on |profile|.
48 std::vector<int> GetInstalledExtensions(Profile* profile);
50 // Installs all pending synced extensions for |profile|.
51 void InstallExtensionsPendingForSync(Profile* profile);
53 // Enables the extension for the given index on |profile|.
54 void EnableExtension(Profile* profile, int index);
56 // Disables the extension for the given index on |profile|.
57 void DisableExtension(Profile* profile, int index);
59 // Returns true if the extension with index |index| is enabled on |profile|.
60 bool IsExtensionEnabled(Profile* profile, int index);
62 // Enables the extension for the given index in incognito mode on |profile|.
63 void IncognitoEnableExtension(Profile* profile, int index);
65 // Disables the extension for the given index in incognito mode on |profile|.
66 void IncognitoDisableExtension(Profile* profile, int index);
68 // Returns true if the extension with index |index| is enabled in incognito
69 // mode on |profile|.
70 bool IsIncognitoEnabled(Profile* profile, int index);
72 // Runs the message loop until all profiles have same extensions. Returns false
73 // on timeout.
74 bool AwaitAllProfilesHaveSameExtensions();
76 } // namespace extensions_helper
78 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_EXTENSIONS_HELPER_H_