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

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

Issue 8370011: Now does not sync URLs that only have imported visits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improved integration test to also test case of visiting url after sync. Created 9 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 de67e74798ea6b38944d52d9becedd5838ac0a2d..d8c29bed557dc98a942a7ae469df05f46c80c719 100644
--- a/chrome/browser/sync/test/integration/typed_urls_helper.cc
+++ b/chrome/browser/sync/test/integration/typed_urls_helper.cc
@@ -66,18 +66,21 @@ void WaitForHistoryDBThread(int index) {
wait_event.Wait();
}
-// Creates a URLRow in the specified HistoryService.
+// Creates a URLRow in the specified HistoryService with the passed transition
+// type.
void AddToHistory(HistoryService* service,
const GURL& url,
+ content::PageTransition transition,
+ history::VisitSource source,
const base::Time& timestamp) {
service->AddPage(url,
timestamp,
NULL, // scope
1234, // page_id
GURL(), // referrer
- content::PAGE_TRANSITION_TYPED,
+ transition,
history::RedirectList(),
- history::SOURCE_BROWSED,
+ source,
false);
}
@@ -117,14 +120,25 @@ base::Time GetTimestamp() {
}
void AddUrlToHistory(int index, const GURL& url) {
+ AddUrlToHistoryWithTransition(index, url, content::PAGE_TRANSITION_TYPED,
+ history::SOURCE_BROWSED);
+}
+void AddUrlToHistoryWithTransition(int index,
+ const GURL& url,
+ content::PageTransition transition,
+ history::VisitSource source) {
base::Time timestamp = GetTimestamp();
AddToHistory(test()->GetProfile(index)->GetHistoryServiceWithoutCreating(),
url,
+ transition,
+ source,
timestamp);
if (test()->use_verifier())
AddToHistory(
test()->verifier()->GetHistoryService(Profile::IMPLICIT_ACCESS),
url,
+ transition,
+ source,
timestamp);
// Wait until the AddPage() request has completed so we know the change has

Powered by Google App Engine
This is Rietveld 408576698