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

Side by Side Diff: chrome/browser/sessions/persistent_tab_restore_service_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: Eliminate a use-after-free, Windows build fix 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // TODO(jamescook): Why does this test run on all Aura platforms, instead of 5 // TODO(jamescook): Why does this test run on all Aura platforms, instead of
6 // only Chrome OS or Ash? 6 // only Chrome OS or Ash?
7 #if defined(USE_AURA) 7 #if defined(USE_AURA)
8 8
9 #include "components/sessions/core/persistent_tab_restore_service.h" 9 #include "components/sessions/core/persistent_tab_restore_service.h"
10 10
(...skipping 20 matching lines...) Expand all
31 Browser* app_browser = CreateBrowserForApp(app_name, profile); 31 Browser* app_browser = CreateBrowserForApp(app_name, profile);
32 app_browser->window()->Close(); 32 app_browser->window()->Close();
33 content::WindowedNotificationObserver observer( 33 content::WindowedNotificationObserver observer(
34 chrome::NOTIFICATION_BROWSER_CLOSED, 34 chrome::NOTIFICATION_BROWSER_CLOSED,
35 content::Source<Browser>(app_browser)); 35 content::Source<Browser>(app_browser));
36 observer.Wait(); 36 observer.Wait();
37 37
38 // One entry should be created. 38 // One entry should be created.
39 ASSERT_EQ(1U, trs->entries().size()); 39 ASSERT_EQ(1U, trs->entries().size());
40 const sessions::TabRestoreService::Entry* restored_entry = 40 const sessions::TabRestoreService::Entry* restored_entry =
41 trs->entries().front(); 41 trs->entries().front().get();
42 42
43 // It should be a window with an app. 43 // It should be a window with an app.
44 ASSERT_EQ(sessions::TabRestoreService::WINDOW, restored_entry->type); 44 ASSERT_EQ(sessions::TabRestoreService::WINDOW, restored_entry->type);
45 const Window* restored_window = 45 const Window* restored_window = static_cast<const Window*>(restored_entry);
46 static_cast<const Window*>(restored_entry);
47 EXPECT_EQ(app_name, restored_window->app_name); 46 EXPECT_EQ(app_name, restored_window->app_name);
48 } 47 }
49 48
50 #endif // defined(USE_AURA) 49 #endif // defined(USE_AURA)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698