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

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

Issue 2750163003: Prevent tabs sync during browser shutdown.
Patch Set: Created 3 years, 9 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_sessions_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc b/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc
index 9ad194b0a1531920fc0eb27118cc25397bce78fd..583edc29ddb9c199106d614304a92f67bad8d7c4 100644
--- a/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc
@@ -6,14 +6,19 @@
#include "base/guid.h"
#include "base/macros.h"
+#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
+#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/sessions/session_service.h"
#include "chrome/browser/sync/test/integration/passwords_helper.h"
#include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
#include "chrome/browser/sync/test/integration/sessions_helper.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
+#include "chrome/browser/sync/test/integration/updated_progress_marker_checker.h"
#include "components/sync/engine/cycle/sync_cycle_snapshot.h"
+#include "content/public/browser/notification_service.h"
+#include "content/public/test/test_utils.h"
using sessions_helper::CheckInitialState;
using sessions_helper::DeleteForeignSession;
@@ -216,3 +221,32 @@ IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, MultipleWindowsMultipleTabs) {
WaitForForeignSessionsToSync(0, 1);
}
+
+IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest,
+ E2E_ENABLED(DoNotSyncTabsOnBrowserClose)) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+
+ ASSERT_TRUE(CheckInitialState(0));
+ ASSERT_TRUE(CheckInitialState(1));
+
+ std::vector<GURL> urls;
+ urls.push_back(GURL(kURL1));
+ urls.push_back(GURL(kURL2));
+ ASSERT_TRUE(sessions_helper::OpenMultipleTabs(0, urls));
+
+ // Retain the window information on client 0.
+ ScopedWindowMap client0_windows;
+ ASSERT_TRUE(GetLocalWindows(0, &client0_windows));
+ std::vector<ScopedWindowMap> expected_windows(1);
+ expected_windows[0] = std::move(client0_windows);
+
+ // Check the foreign windows on client 1.
+ ASSERT_TRUE(ForeignSessionsMatchChecker(1, expected_windows).Wait());
+
+ // Close browser window on client 0.
+ CloseBrowserWindowAtIndex(0);
+ ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1)));
+
+ // Foreign windows on client 1 shouldn't be changed.
+ ASSERT_TRUE(ForeignSessionsMatchChecker(1, expected_windows).Wait());
+}
« no previous file with comments | « chrome/browser/sync/test/integration/sync_test.cc ('k') | components/sync_sessions/local_session_event_router.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698