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

Unified Diff: components/sync_sessions/sync_sessions_metrics_unittest.cc

Issue 2499023004: [Sync] Introduce SyncedSessionWindow type. (Closed)
Patch Set: Address comments 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
« no previous file with comments | « components/sync_sessions/sync_sessions_metrics.cc ('k') | components/sync_sessions/synced_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync_sessions/sync_sessions_metrics_unittest.cc
diff --git a/components/sync_sessions/sync_sessions_metrics_unittest.cc b/components/sync_sessions/sync_sessions_metrics_unittest.cc
index f351d3de168dd981472dbc09fac030c3a29c0475..987e0a52c7924d4a3d703e4a502e402661c9de93 100644
--- a/components/sync_sessions/sync_sessions_metrics_unittest.cc
+++ b/components/sync_sessions/sync_sessions_metrics_unittest.cc
@@ -70,17 +70,21 @@ class SyncSessionsMetricsTest : public ::testing::Test {
if (sessions_[tabIndex]->windows.find(windowIndex) ==
sessions_[tabIndex]->windows.end()) {
sessions_[tabIndex]->windows[windowIndex] =
- base::MakeUnique<SessionWindow>();
+ base::MakeUnique<SyncedSessionWindow>();
}
sessions_[tabIndex]->modified_time =
std::max(sessions_[tabIndex]->modified_time, timestamp);
- sessions_[tabIndex]->windows[windowIndex]->timestamp = std::max(
- sessions_[tabIndex]->windows[windowIndex]->timestamp, timestamp);
- sessions_[tabIndex]->windows[windowIndex]->tabs.push_back(
+ sessions_[tabIndex]->windows[windowIndex]->wrapped_window.timestamp =
+ std::max(
+ sessions_[tabIndex]->windows[windowIndex]->wrapped_window.timestamp,
+ timestamp);
+ sessions_[tabIndex]->windows[windowIndex]->wrapped_window.tabs.push_back(
base::MakeUnique<SessionTab>());
- sessions_[tabIndex]->windows[windowIndex]->tabs.back()->timestamp =
- timestamp;
+ sessions_[tabIndex]
+ ->windows[windowIndex]
+ ->wrapped_window.tabs.back()
+ ->timestamp = timestamp;
}
// Removes the last tab at the given indexes. The idexes provided should be
@@ -89,9 +93,11 @@ class SyncSessionsMetricsTest : public ::testing::Test {
void PopTab(size_t tabIndex, int windowIndex, Time timestamp) {
sessions_[tabIndex]->modified_time =
std::max(sessions_[tabIndex]->modified_time, timestamp);
- sessions_[tabIndex]->windows[windowIndex]->timestamp = std::max(
- sessions_[tabIndex]->windows[windowIndex]->timestamp, timestamp);
- sessions_[tabIndex]->windows[windowIndex]->tabs.pop_back();
+ sessions_[tabIndex]->windows[windowIndex]->wrapped_window.timestamp =
+ std::max(
+ sessions_[tabIndex]->windows[windowIndex]->wrapped_window.timestamp,
+ timestamp);
+ sessions_[tabIndex]->windows[windowIndex]->wrapped_window.tabs.pop_back();
}
// Runs MaxTabTimestamp on the current sessions data.
« no previous file with comments | « components/sync_sessions/sync_sessions_metrics.cc ('k') | components/sync_sessions/synced_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698