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

Unified Diff: chrome/browser/sessions/session_restore_browsertest.cc

Issue 2200993004: Make TabRestoreService::Entry noncopyable and fix up surrounding code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tab-test-cleanup
Patch Set: Get session ID from entries, take tabs' active status directly instead of an index Created 4 years, 4 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/sessions/session_restore_browsertest.cc
diff --git a/chrome/browser/sessions/session_restore_browsertest.cc b/chrome/browser/sessions/session_restore_browsertest.cc
index 919e28343c58c8b177cdb6a345b30160f1503ce6..60b2220401db23b0838287c771430eb5189eb434 100644
--- a/chrome/browser/sessions/session_restore_browsertest.cc
+++ b/chrome/browser/sessions/session_restore_browsertest.cc
@@ -543,16 +543,16 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTest, RestoreIndividualTabFromWindow) {
ASSERT_EQ(1U, service->entries().size());
ASSERT_EQ(sessions::TabRestoreService::WINDOW,
service->entries().front()->type);
- const sessions::TabRestoreService::Window* window =
- static_cast<sessions::TabRestoreService::Window*>(
- service->entries().front());
+ auto* window = static_cast<sessions::TabRestoreService::Window*>(
+ service->entries().front().get());
EXPECT_EQ(3U, window->tabs.size());
// Find the SessionID for entry2. Since the session service was destroyed,
// there is no guarantee that the SessionID for the tab has remained the same.
base::Time timestamp;
int http_status_code = 0;
- for (const sessions::TabRestoreService::Tab& tab : window->tabs) {
+ for (const auto& tab_ptr : window->tabs) {
+ const sessions::TabRestoreService::Tab& tab = *tab_ptr;
// If this tab held url2, then restore this single tab.
if (tab.navigations[0].virtual_url() == url2) {
timestamp = tab.navigations[0].timestamp();
@@ -575,7 +575,7 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTest, RestoreIndividualTabFromWindow) {
ASSERT_EQ(sessions::TabRestoreService::WINDOW,
service->entries().front()->type);
window = static_cast<sessions::TabRestoreService::Window*>(
- service->entries().front());
+ service->entries().front().get());
EXPECT_EQ(2U, window->tabs.size());
// Make sure that the restored tab was restored with the correct
@@ -615,9 +615,8 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTest, MAYBE_WindowWithOneTab) {
// Expect the window to be converted to a tab by the TRS.
EXPECT_EQ(1U, service->entries().size());
ASSERT_EQ(sessions::TabRestoreService::TAB, service->entries().front()->type);
- const sessions::TabRestoreService::Tab* tab =
- static_cast<sessions::TabRestoreService::Tab*>(
- service->entries().front());
+ auto* tab = static_cast<const sessions::TabRestoreService::Tab*>(
+ service->entries().front().get());
// Restore the tab.
std::vector<sessions::LiveTab*> content =
« no previous file with comments | « chrome/browser/sessions/persistent_tab_restore_service_unittest.cc ('k') | chrome/browser/sessions/tab_restore_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698