Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(751)

Unified Diff: chrome/browser/sync/test/integration/typed_urls_helper.cc

Issue 2379433002: [Sync] Refactoring of sync integration test checkers to remove boilerplate await methods. (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/test/integration/typed_urls_helper.cc
diff --git a/chrome/browser/sync/test/integration/typed_urls_helper.cc b/chrome/browser/sync/test/integration/typed_urls_helper.cc
index 24c8c77a2c1cb5f3f4b8a948631819fc7c40ff0d..b0b4c4f8ee98e3ae029dae54c67dbdf5b2226aa5 100644
--- a/chrome/browser/sync/test/integration/typed_urls_helper.cc
+++ b/chrome/browser/sync/test/integration/typed_urls_helper.cc
@@ -6,6 +6,8 @@
#include <stddef.h>
+#include <memory>
+
#include "base/compiler_specific.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/waitable_event.h"
@@ -13,7 +15,6 @@
#include "base/time/time.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/sync/test/integration/multi_client_status_change_checker.h"
#include "chrome/browser/sync/test/integration/sync_datatype_helper.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "components/history/core/browser/history_backend.h"
@@ -162,15 +163,11 @@ void AddToHistory(history::HistoryService* service,
ui::PageTransition transition,
history::VisitSource source,
const base::Time& timestamp) {
- service->AddPage(url,
- timestamp,
- NULL, // scope
- 1234, // nav_entry_id
+ service->AddPage(url, timestamp,
+ NULL, // scope
+ 1234, // nav_entry_id
GURL(), // referrer
- history::RedirectList(),
- transition,
- source,
- false);
+ history::RedirectList(), transition, source, false);
}
history::URLRows GetTypedUrlsFromHistoryService(
@@ -421,39 +418,16 @@ bool CheckAllProfilesHaveSameURLs() {
return true;
}
-namespace {
-
-// Helper class used in the implementation of
-// AwaitCheckAllProfilesHaveSameURLs.
-class ProfilesHaveSameURLsChecker : public MultiClientStatusChangeChecker {
- public:
- ProfilesHaveSameURLsChecker();
- ~ProfilesHaveSameURLsChecker() override;
-
- bool IsExitConditionSatisfied() override;
- std::string GetDebugMessage() const override;
-};
+} // namespace typed_urls_helper
ProfilesHaveSameURLsChecker::ProfilesHaveSameURLsChecker()
: MultiClientStatusChangeChecker(
sync_datatype_helper::test()->GetSyncServices()) {}
-ProfilesHaveSameURLsChecker::~ProfilesHaveSameURLsChecker() {}
-
bool ProfilesHaveSameURLsChecker::IsExitConditionSatisfied() {
- return CheckAllProfilesHaveSameURLs();
+ return typed_urls_helper::CheckAllProfilesHaveSameURLs();
}
std::string ProfilesHaveSameURLsChecker::GetDebugMessage() const {
return "Waiting for matching typed urls profiles";
}
-
-} // namespace
-
-bool AwaitCheckAllProfilesHaveSameURLs() {
- ProfilesHaveSameURLsChecker checker;
- checker.Wait();
- return !checker.TimedOut();
-}
-
-} // namespace typed_urls_helper

Powered by Google App Engine
This is Rietveld 408576698