Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / sync / test / integration / sync_app_list_helper.h
blob91d873409e70fe4d6e6eb22fdd0e9feef73a2353
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 class SyncAppListHelper {
18 public:
19 // Singleton implementation.
20 static SyncAppListHelper* GetInstance();
22 // Initializes the profiles in |test| and registers them with
23 // internal data structures.
24 void SetupIfNecessary(SyncTest* test);
26 // Returns true iff all existing profiles have the same app list entries
27 // as the verifier.
28 bool AllProfilesHaveSameAppListAsVerifier();
30 // Moves an app in |profile|.
31 void MoveApp(Profile* profile, size_t from, size_t to);
33 // Copies ordinals for item matching |id| from |profile1| to test_->verifier.
34 void CopyOrdinalsToVerifier(Profile* profile1, const std::string& id);
36 // Helper function for debugging, used to log the app lists on test failures.
37 void PrintAppList(Profile* profile);
39 private:
40 friend struct DefaultSingletonTraits<SyncAppListHelper>;
42 SyncAppListHelper();
43 ~SyncAppListHelper();
45 // Returns true iff |profile| has the same app list as |test_|->verifier()
46 // and the app list entries all have the same state.
47 bool AppListMatchesVerifier(Profile* profile);
49 SyncTest* test_;
50 bool setup_completed_;
52 DISALLOW_COPY_AND_ASSIGN(SyncAppListHelper);
55 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_APP_LIST_HELPER_H_