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_STATUS_CHANGE_CHECKER_H_
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_STATUS_CHANGE_CHECKER_H_
10 // Interface for a helper class that can be used to check if a desired change in
11 // the state of the sync engine has taken place. Used by the desktop sync
14 // Usage: Tests that want to use this class to wait for an arbitrary sync state
15 // must implement a concrete StatusChangeChecker object and pass it to
16 // ProfileSyncServiceHarness::AwaitStatusChange().
17 class StatusChangeChecker
{
19 explicit StatusChangeChecker(const std::string
& source
);
21 // Called every time ProfileSyncServiceHarness is notified of a change in the
22 // state of the sync engine. Returns true if the desired change has occurred.
23 virtual bool IsExitConditionSatisfied() = 0;
25 std::string
source() const { return source_
; }
28 virtual ~StatusChangeChecker();
31 // Used for logging / debugging. Can be used to hold the name of the internal
32 // function called by IsExitConditionSatisfied. Logged along with select info
33 // when ProfileSyncServiceHarness observes a change in ProfileSyncService.
37 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_STATUS_CHANGE_CHECKER_H_