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

Unified Diff: chrome/browser/sync/test/integration/sessions_helper.h

Issue 2725813003: reland of [sync] Add Sessions integration tests (Closed)
Patch Set: Switch back to WaitForURLOnServer, make everything a constant Created 3 years, 10 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/sessions_helper.h
diff --git a/chrome/browser/sync/test/integration/sessions_helper.h b/chrome/browser/sync/test/integration/sessions_helper.h
index 365bc091c121cce1178e8f8c9b133fce46b2e284..b1078b496bef734417409ef029191a7ce431fd6e 100644
--- a/chrome/browser/sync/test/integration/sessions_helper.h
+++ b/chrome/browser/sync/test/integration/sessions_helper.h
@@ -27,21 +27,10 @@ using SessionWindowMap = std::map<SessionID::id_type, sessions::SessionWindow*>;
using ScopedWindowMap =
std::map<SessionID::id_type, std::unique_ptr<sessions::SessionWindow>>;
-// Copies the local session windows of profile |index| to |local_windows|.
+// Copies the local session windows of profile at |index| to |local_windows|.
// Returns true if successful.
bool GetLocalWindows(int index, ScopedWindowMap* local_windows);
-// Creates and verifies the creation of a new window for profile |index| with
-// one tab displaying |url|. Copies the SessionWindow associated with the new
-// window to |local_windows|. Returns true if successful. This call results in
-// multiple sessions changes, and performs synchronous blocking. It is rare, but
-// possible, that multiple sync cycle commits occur as a result of this call.
-// Test cases should be written to handle this possibility, otherwise they may
-// flake.
-bool OpenTabAndGetLocalWindows(int index,
- const GURL& url,
- ScopedWindowMap* local_windows);
-
// Checks that window count and foreign session count are 0.
bool CheckInitialState(int index);
@@ -84,14 +73,40 @@ bool WindowsMatch(const SessionWindowMap& win1, const ScopedWindowMap& win2);
// with a reference SessionWindow list.
// Returns true if the session windows of the foreign session matches the
// reference.
-bool CheckForeignSessionsAgainst(
- int index,
- const std::vector<ScopedWindowMap>& windows);
+bool CheckForeignSessionsAgainst(int index,
+ const std::vector<ScopedWindowMap>& windows);
-// Open a single tab and block until the session model associator is aware
-// of it. Returns true upon success, false otherwise.
+// Open a single tab in the browser at |index| and block until the
+// session model associator is aware of it. Returns true upon success, false
+// otherwise.
bool OpenTab(int index, const GURL& url);
+// See OpenTab, except that the tab is opened in position |tab_index|.
+// If |tab_index| is -1 or greater than the number of tabs, the tab will be
+// appended to the end of the strip. i.e. if tab_index is 3 for a tab strip of
+// size 1, the new tab will be in position 1.
+bool OpenTabAtIndex(int index, int tab_index, const GURL& url);
+
+// Moves the tab in position |tab_index| in the TabStrip for browser at
+// |from_index| to the TabStrip for browser at |to_index|.
+void MoveTab(int from_index, int to_index, int tab_index);
+
+// Navigate the active tab for browser in position |index| to the given
+// url, and blocks until the session model associator is aware of it.
+// WARNING: it's dangerous to assume this will return for any arbitrary URL.
+// For URLs that don't resolve to a valid server response, this can block
+// indefinitely. Use a data uri or the embedded_test_server to ensure that this
+// doesn't happen.
+bool NavigateTab(int index, const GURL& url);
+
+// Navigate the active tab for browser in position |index| back by one;
+// if this isn't possible, does nothing
+void NavigateTabBack(int index);
+
+// Navigate the active tab for browser in position |index| forward by
+// one; if this isn't possible, does nothing
+void NavigateTabForward(int index);
+
// Open multiple tabs and block until the session model associator is aware
// of all of them. Returns true on success, false on failure.
bool OpenMultipleTabs(int index, const std::vector<GURL>& urls);

Powered by Google App Engine
This is Rietveld 408576698