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

Unified Diff: chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc

Issue 2804913002: mash: Test ChromeLauncherControllerImpl more like production use. (Closed)
Patch Set: Fix BrowserWindow leak; restore InitLauncherController; cleanup. Created 3 years, 8 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/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc
index 0a158f956834d300c3562bb39a3173327356b720..11380bcd6e7a213dd7596b72c6df601d882123c8 100644
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views_unittest.cc
@@ -196,13 +196,21 @@ TEST_F(AppInfoDialogViewsTest, UninstallingOtherAppDoesNotCloseDialog) {
// Tests that the dialog closes when the current profile is destroyed.
TEST_F(AppInfoDialogViewsTest, DestroyedProfileClosesDialog) {
ShowAppInfo(kTestExtensionId);
+
// First delete the test browser window. This ensures the test harness isn't
// surprised by it being closed in response to the profile deletion below.
- // Note the base class doesn't own the profile, so that part is skipped.
- DestroyBrowserAndProfile();
+ std::unique_ptr<Browser> browser(release_browser());
+ browser->tab_strip_model()->CloseAllTabs();
+ browser.reset();
+ std::unique_ptr<BrowserWindow> browser_window(release_browser_window());
+ browser_window->Close();
+ browser_window.reset();
+
+ // This does not actually destroy the profile; see DestroyProfile above.
+ DestroyProfile(profile());
// The following does nothing: it just ensures the Widget close is being
- // triggered by the DeleteProfile() call rather than the line above.
+ // triggered by the DeleteProfile() call rather than the code above.
base::RunLoop().RunUntilIdle();
ASSERT_TRUE(widget_);

Powered by Google App Engine
This is Rietveld 408576698