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

Unified Diff: chrome/test/live_sync/two_client_live_sessions_sync_test.cc

Issue 4158009: Session sync integration tests. Left out many client for now, since even... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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
« no previous file with comments | « chrome/test/live_sync/single_client_live_sessions_sync_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/live_sync/two_client_live_sessions_sync_test.cc
===================================================================
--- chrome/test/live_sync/two_client_live_sessions_sync_test.cc (revision 0)
+++ chrome/test/live_sync/two_client_live_sessions_sync_test.cc (revision 0)
@@ -0,0 +1,62 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/test/live_sync/live_sessions_sync_test.h"
+
+// @TODO(zea): Test each individual session command we care about separately.
+// (as well as multi-window). We're currently only checking basic single-window/
+// single-tab functionality.
+
+IN_PROC_BROWSER_TEST_F(TwoClientLiveSessionsSyncTest, SingleClientChanged) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+
+ ASSERT_TRUE(CheckInitialState(0));
+ ASSERT_TRUE(CheckInitialState(1));
+
+ std::vector<SessionWindow*>* client0_windows =
+ InitializeNewWindowWithTab(0, GURL("about:bubba"));
+ ASSERT_TRUE(client0_windows);
+
+ GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1));
+
+ // Get foreign session data from client 1.
+ ScopedVector<ForeignSession> sessions1;
+ ASSERT_TRUE(GetSessionData(1, &sessions1.get()));
+
+ // Verify client 1's foreign session matches client 0 current window.
+ ASSERT_EQ(1U, sessions1.size());
+ ASSERT_TRUE(WindowsMatch(sessions1[0]->windows, *client0_windows));
+}
+
+IN_PROC_BROWSER_TEST_F(TwoClientLiveSessionsSyncTest, BothChanged) {
+ ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
+
+ ASSERT_TRUE(CheckInitialState(0));
+ ASSERT_TRUE(CheckInitialState(1));
+
+ // Open tabs on both clients and retain window information.
+ std::vector<SessionWindow*>* client0_windows =
+ InitializeNewWindowWithTab(0, GURL("about:bubba0"));
+ ASSERT_TRUE(client0_windows);
+ std::vector<SessionWindow*>* client1_windows =
+ InitializeNewWindowWithTab(1, GURL("about:bubba1"));
+ ASSERT_TRUE(client1_windows);
+
+ // Wait for sync.
+ ASSERT_TRUE(AwaitQuiescence());
+
+ // Get foreign session data from client 0 and 1.
+ ScopedVector<ForeignSession> sessions0;
+ ScopedVector<ForeignSession> sessions1;
+ ASSERT_TRUE(GetSessionData(0, &sessions0.get()));
+ ASSERT_TRUE(GetSessionData(1, &sessions1.get()));
+
+ // Verify client 1's foreign session matches client 0's current window and
+ // vice versa.
+ ASSERT_EQ(1U, sessions0.size());
+ ASSERT_EQ(1U, sessions1.size());
+ ASSERT_TRUE(WindowsMatch(sessions1[0]->windows, *client0_windows));
+ ASSERT_TRUE(WindowsMatch(sessions0[0]->windows, *client1_windows));
+}
+
Property changes on: chrome/test/live_sync/two_client_live_sessions_sync_test.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/test/live_sync/single_client_live_sessions_sync_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698