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_
10 #include "base/basictypes.h"
11 #include "base/memory/singleton.h"
12 #include "sync/api/string_ordinal.h"
17 class SyncAppListHelper
{
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
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
);
40 friend struct DefaultSingletonTraits
<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
);
50 bool setup_completed_
;
52 DISALLOW_COPY_AND_ASSIGN(SyncAppListHelper
);
55 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_SYNC_APP_LIST_HELPER_H_