BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / sync / test / integration / sync_app_list_helper.h
blob9e4186a7ed976e3a9d9b982cf5a6818ced40e7ce
1 // Copyright 2013 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_SYNC_APP_LIST_HELPER_H_
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_APP_LIST_HELPER_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/memory/singleton.h"
12 #include "sync/api/string_ordinal.h"
14 class Profile;
15 class SyncTest;
17 namespace app_list {
18 class AppListItem;
21 class SyncAppListHelper {
22 public:
23 // Singleton implementation.
24 static SyncAppListHelper* GetInstance();
26 // Initializes the profiles in |test| and registers them with
27 // internal data structures.
28 void SetupIfNecessary(SyncTest* test);
30 // Returns true iff all existing profiles have the same app list entries
31 // as the verifier.
32 bool AllProfilesHaveSameAppListAsVerifier();
34 // Moves an app in |profile|.
35 void MoveApp(Profile* profile, size_t from, size_t to);
37 // Moves an app in |profile| to |folder_id|.
38 void MoveAppToFolder(Profile* profile,
39 size_t index,
40 const std::string& folder_id);
42 // Moves an app in |profile| from |folder_id| to the top level list of apps.
43 void MoveAppFromFolder(Profile* profile,
44 size_t index_in_folder,
45 const std::string& folder_id);
47 // Copies ordinals for item matching |id| from |profile1| to test_->verifier.
48 void CopyOrdinalsToVerifier(Profile* profile1, const std::string& id);
50 // Helper function for debugging, used to log the app lists on test failures.
51 void PrintAppList(Profile* profile);
53 private:
54 friend struct base::DefaultSingletonTraits<SyncAppListHelper>;
56 SyncAppListHelper();
57 ~SyncAppListHelper();
59 // Returns true iff |profile| has the same app list as |test_|->verifier()
60 // and the app list entries all have the same state.
61 bool AppListMatchesVerifier(Profile* profile);
63 // Helper function for debugging, logs info for an item, including the
64 // contents of any folder items.
65 void PrintItem(Profile* profile,
66 app_list::AppListItem* item,
67 const std::string& label);
69 SyncTest* test_;
70 bool setup_completed_;
72 DISALLOW_COPY_AND_ASSIGN(SyncAppListHelper);
75 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_APP_LIST_HELPER_H_