OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_TYPED_URLS_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_TYPED_URLS_HELPER_H_ |
6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_TYPED_URLS_HELPER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_TYPED_URLS_HELPER_H_ |
7 | 7 |
| 8 #include <string> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
| 11 #include "chrome/browser/sync/test/integration/multi_client_status_change_checke
r.h" |
10 #include "components/history/core/browser/history_types.h" | 12 #include "components/history/core/browser/history_types.h" |
11 #include "ui/base/page_transition_types.h" | 13 #include "ui/base/page_transition_types.h" |
12 | 14 |
13 namespace base { | 15 namespace base { |
14 class Time; | 16 class Time; |
15 } | 17 } |
16 | 18 |
17 namespace typed_urls_helper { | 19 namespace typed_urls_helper { |
18 | 20 |
19 // Gets the typed URLs from a specific sync profile. | 21 // Gets the typed URLs from a specific sync profile. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // Deletes a list of URLs from the history DB for a specific sync | 62 // Deletes a list of URLs from the history DB for a specific sync |
61 // profile. | 63 // profile. |
62 void DeleteUrlsFromHistory(int index, const std::vector<GURL>& urls); | 64 void DeleteUrlsFromHistory(int index, const std::vector<GURL>& urls); |
63 | 65 |
64 // Modifies an URL stored in history by setting a new title. | 66 // Modifies an URL stored in history by setting a new title. |
65 void SetPageTitle(int index, const GURL& url, const std::string& title); | 67 void SetPageTitle(int index, const GURL& url, const std::string& title); |
66 | 68 |
67 // Returns true if all clients have the same URLs. | 69 // Returns true if all clients have the same URLs. |
68 bool CheckAllProfilesHaveSameURLs(); | 70 bool CheckAllProfilesHaveSameURLs(); |
69 | 71 |
70 // Returns true if all clients have the same URLs before the timeout. | |
71 bool AwaitCheckAllProfilesHaveSameURLs(); | |
72 | |
73 // Checks that the two vectors contain the same set of URLRows (possibly in | 72 // Checks that the two vectors contain the same set of URLRows (possibly in |
74 // a different order). | 73 // a different order). |
75 bool CheckURLRowVectorsAreEqual(const history::URLRows& left, | 74 bool CheckURLRowVectorsAreEqual(const history::URLRows& left, |
76 const history::URLRows& right); | 75 const history::URLRows& right); |
77 | 76 |
78 // Checks that the passed URLRows are equivalent. | 77 // Checks that the passed URLRows are equivalent. |
79 bool CheckURLRowsAreEqual(const history::URLRow& left, | 78 bool CheckURLRowsAreEqual(const history::URLRow& left, |
80 const history::URLRow& right); | 79 const history::URLRow& right); |
81 | 80 |
82 // Returns true if two sets of visits are equivalent. | 81 // Returns true if two sets of visits are equivalent. |
83 bool AreVisitsEqual(const history::VisitVector& visit1, | 82 bool AreVisitsEqual(const history::VisitVector& visit1, |
84 const history::VisitVector& visit2); | 83 const history::VisitVector& visit2); |
85 | 84 |
86 // Returns true if there are no duplicate visit times. | 85 // Returns true if there are no duplicate visit times. |
87 bool AreVisitsUnique(const history::VisitVector& visits); | 86 bool AreVisitsUnique(const history::VisitVector& visits); |
88 | 87 |
89 // Returns a unique timestamp to use when generating page visits | 88 // Returns a unique timestamp to use when generating page visits |
90 // (HistoryService does not like having identical timestamps and will modify | 89 // (HistoryService does not like having identical timestamps and will modify |
91 // the timestamps behind the scenes if it encounters them, which leads to | 90 // the timestamps behind the scenes if it encounters them, which leads to |
92 // spurious test failures when the resulting timestamps aren't what we | 91 // spurious test failures when the resulting timestamps aren't what we |
93 // expect). | 92 // expect). |
94 base::Time GetTimestamp(); | 93 base::Time GetTimestamp(); |
95 | 94 |
96 } // namespace typed_urls_helper | 95 } // namespace typed_urls_helper |
97 | 96 |
| 97 // Checker that blocks until all clients have the same URLs. |
| 98 class ProfilesHaveSameURLsChecker : public MultiClientStatusChangeChecker { |
| 99 public: |
| 100 ProfilesHaveSameURLsChecker(); |
| 101 |
| 102 // Implementation of StatusChangeChecker. |
| 103 bool IsExitConditionSatisfied() override; |
| 104 std::string GetDebugMessage() const override; |
| 105 }; |
| 106 |
98 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_TYPED_URLS_HELPER_H_ | 107 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_TYPED_URLS_HELPER_H_ |
OLD | NEW |