Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / sync / test / integration / status_change_checker.h
blob5d34c0b480d4df5c6b89bac369e59b22dc90fd96
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_
8 #include <string>
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
12 // integration tests.
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 {
18 public:
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_; }
27 protected:
28 virtual ~StatusChangeChecker();
30 private:
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.
34 std::string source_;
37 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_STATUS_CHANGE_CHECKER_H_