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

Unified Diff: chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.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: Review feedback 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/two_client_typed_urls_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc b/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc
index 0e0b6f542d25dc625e45ab09d3c832d33c096681..f1ee3f207d1090687a5038b88165a96ba002d632 100644
--- a/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/sync/test/integration/typed_urls_helper.h"
using typed_urls_helper::AddUrlToHistory;
+using typed_urls_helper::AddUrlToHistoryWithTransition;
using typed_urls_helper::AssertAllProfilesHaveSameURLsAsVerifier;
using typed_urls_helper::DeleteUrlFromHistory;
using typed_urls_helper::GetTypedUrlsFromClient;
@@ -176,3 +177,44 @@ IN_PROC_BROWSER_TEST_F(TwoClientTypedUrlsSyncTest,
// Both clients should have this URL added again.
AssertAllProfilesHaveSameURLsAsVerifier();
}
+
+IN_PROC_BROWSER_TEST_F(TwoClientTypedUrlsSyncTest,
+ SkipImportedVisits) {
+
+ GURL imported_url("http://imported_url.com");
+ GURL browsed_url("http://browsed_url.com");
+ GURL browsed_and_imported_url("http://browsed_and_imported_url.com");
+ ASSERT_TRUE(SetupClients());
+
+ // Create 3 items in our first client - 1 imported, one browsed, one with
+ // both imported and browsed entries.
+ AddUrlToHistoryWithTransition(0, imported_url,
+ content::PAGE_TRANSITION_TYPED,
+ history::SOURCE_FIREFOX_IMPORTED);
+ AddUrlToHistoryWithTransition(0, browsed_url,
+ content::PAGE_TRANSITION_TYPED,
+ history::SOURCE_BROWSED);
+ AddUrlToHistoryWithTransition(0, browsed_and_imported_url,
+ content::PAGE_TRANSITION_TYPED,
+ history::SOURCE_FIREFOX_IMPORTED);
+
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+ ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+ std::vector<history::URLRow> urls = GetTypedUrlsFromClient(1);
+ ASSERT_EQ(1U, urls.size());
+ ASSERT_EQ(browsed_url, urls[0].url());
+
+ // Now browse to 3rd URL - this should cause it to be synced, even though it
+ // was initially imported.
+ AddUrlToHistoryWithTransition(0, browsed_and_imported_url,
+ content::PAGE_TRANSITION_TYPED,
+ history::SOURCE_BROWSED);
+ ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+ urls = GetTypedUrlsFromClient(1);
+ ASSERT_EQ(2U, urls.size());
+
+ // Make sure the imported URL didn't make it over.
+ for (size_t i = 0; i < urls.size(); ++i) {
+ ASSERT_NE(imported_url, urls[i].url());
+ }
+}
« no previous file with comments | « chrome/browser/sync/glue/typed_url_model_associator.cc ('k') | chrome/browser/sync/test/integration/typed_urls_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698