| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_APPS_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_APPS_HELPER_H_ |
| 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_APPS_HELPER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_APPS_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "chrome/browser/sync/test/integration/sync_test.h" | 9 #include "chrome/browser/sync/test/integration/sync_test.h" |
| 10 #include "sync/api/string_ordinal.h" | 10 #include "sync/api/string_ordinal.h" |
| 11 | 11 |
| 12 class Profile; | 12 class Profile; |
| 13 | 13 |
| 14 namespace apps_helper { | 14 namespace apps_helper { |
| 15 | 15 |
| 16 // Returns true iff the profile with index |index| has the same apps (hosted, | 16 // Returns true iff the profile with index |index| has the same apps (hosted, |
| 17 // legacy packaged and platform) as the verifier. | 17 // legacy packaged and platform) as the verifier. |
| 18 bool HasSameAppsAsVerifier(int index) WARN_UNUSED_RESULT; | 18 bool HasSameAppsAsVerifier(int index) WARN_UNUSED_RESULT; |
| 19 | 19 |
| 20 // Returns true iff |profile1| has same apps (hosted, legacy packaged and |
| 21 // platform) as |profile2|. |
| 22 bool HasSameApps(Profile* profile1, Profile* profile2); |
| 23 |
| 20 // Returns true iff all existing profiles have the same apps (hosted, | 24 // Returns true iff all existing profiles have the same apps (hosted, |
| 21 // legacy packaged and platform) as the verifier. | 25 // legacy packaged and platform). |
| 22 bool AllProfilesHaveSameAppsAsVerifier() WARN_UNUSED_RESULT; | 26 bool AllProfilesHaveSameApps() WARN_UNUSED_RESULT; |
| 23 | 27 |
| 24 // Installs the app for the given index to |profile|, and returns the extension | 28 // Installs the app for the given index to |profile|, and returns the extension |
| 25 // ID of the new app. | 29 // ID of the new app. |
| 26 std::string InstallApp(Profile* profile, int index); | 30 std::string InstallApp(Profile* profile, int index); |
| 27 | 31 |
| 28 // Installs the platform app for the given index to |profile|, and returns the | 32 // Installs the platform app for the given index to |profile|, and returns the |
| 29 // extension ID of the new app. Indices passed to this method should be distinct | 33 // extension ID of the new app. Indices passed to this method should be distinct |
| 30 // from indices passed to InstallApp. | 34 // from indices passed to InstallApp. |
| 31 std::string InstallPlatformApp(Profile* profile, int index); | 35 std::string InstallPlatformApp(Profile* profile, int index); |
| 32 | 36 |
| 33 // Installs the app for the given index to all profiles (including the | 37 // Installs the app for the given index to all profiles (including the |
| 34 // verifier), and returns the extension ID of the new app. | 38 // verifier), and returns the extension ID of the new app. |
| 35 std::string InstallAppForAllProfiles(int index); | 39 std::string InstallAppForAllProfiles(int index); |
| 36 | 40 |
| 37 // Uninstalls the app for the given index from |profile|. Assumes that it was | 41 // Uninstalls the app for the given index from |profile|. Assumes that it was |
| 38 // previously installed. | 42 // previously installed. |
| 39 void UninstallApp(Profile* profile, int index); | 43 void UninstallApp(Profile* profile, int index); |
| 40 | 44 |
| 41 // Installs all pending synced apps for |profile|. | 45 // Installs all pending synced apps for |profile|. |
| 42 void InstallAppsPendingForSync(Profile* profile); | 46 void InstallAppsPendingForSync(Profile* profile); |
| 43 | 47 |
| 44 // Enables the app for the given index on |profile|. | 48 // Enables the app for the given index on |profile|. |
| 45 void EnableApp(Profile* profile, int index); | 49 void EnableApp(Profile* profile, int index); |
| 46 | 50 |
| 47 // Disables the app for the given index on |profile|. | 51 // Disables the app for the given index on |profile|. |
| 48 void DisableApp(Profile* profile, int index); | 52 void DisableApp(Profile* profile, int index); |
| 49 | 53 |
| 54 // Returns true if the app with index |index| is enabled on |profile|. |
| 55 bool IsAppEnabled(Profile* profile, int index); |
| 56 |
| 50 // Enables the app for the given index in incognito mode on |profile|. | 57 // Enables the app for the given index in incognito mode on |profile|. |
| 51 void IncognitoEnableApp(Profile* profile, int index); | 58 void IncognitoEnableApp(Profile* profile, int index); |
| 52 | 59 |
| 53 // Disables the app for the given index in incognito mode on |profile|. | 60 // Disables the app for the given index in incognito mode on |profile|. |
| 54 void IncognitoDisableApp(Profile* profile, int index); | 61 void IncognitoDisableApp(Profile* profile, int index); |
| 55 | 62 |
| 63 // Returns true if the app with index |index| is enabled in incognito mode on |
| 64 // |profile|. |
| 65 bool IsIncognitoEnabled(Profile* profile, int index); |
| 66 |
| 56 // Gets the page ordinal value for the application at the given index on | 67 // Gets the page ordinal value for the application at the given index on |
| 57 // |profile|. | 68 // |profile|. |
| 58 syncer::StringOrdinal GetPageOrdinalForApp(Profile* profile, int app_index); | 69 syncer::StringOrdinal GetPageOrdinalForApp(Profile* profile, int app_index); |
| 59 | 70 |
| 60 // Sets a new |page_ordinal| value for the application at the given index | 71 // Sets a new |page_ordinal| value for the application at the given index |
| 61 // on |profile|. | 72 // on |profile|. |
| 62 void SetPageOrdinalForApp( | 73 void SetPageOrdinalForApp( |
| 63 Profile* profile, int app_index, | 74 Profile* profile, int app_index, |
| 64 const syncer::StringOrdinal& page_ordinal); | 75 const syncer::StringOrdinal& page_ordinal); |
| 65 | 76 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 85 | 96 |
| 86 // Waits until all profiles have the same set of apps. In case verifier profile | 97 // Waits until all profiles have the same set of apps. In case verifier profile |
| 87 // is enabled, it waits until all profiles match the verifier. | 98 // is enabled, it waits until all profiles match the verifier. |
| 88 // | 99 // |
| 89 // Returns false on time out. | 100 // Returns false on time out. |
| 90 bool AwaitAllProfilesHaveSameApps(); | 101 bool AwaitAllProfilesHaveSameApps(); |
| 91 | 102 |
| 92 } // namespace apps_helper | 103 } // namespace apps_helper |
| 93 | 104 |
| 94 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_APPS_HELPER_H_ | 105 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_APPS_HELPER_H_ |
| OLD | NEW |