| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 7 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
| 10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 IN_PROC_BROWSER_TEST_F(ExtensionUninstallDialogViewBrowserTest, | 57 IN_PROC_BROWSER_TEST_F(ExtensionUninstallDialogViewBrowserTest, |
| 58 TrackParentWindowDestruction) { | 58 TrackParentWindowDestruction) { |
| 59 // Create a second browser to prevent the app from exiting when the browser is | 59 // Create a second browser to prevent the app from exiting when the browser is |
| 60 // closed. | 60 // closed. |
| 61 CreateBrowser(browser()->profile()); | 61 CreateBrowser(browser()->profile()); |
| 62 | 62 |
| 63 scoped_refptr<extensions::Extension> extension(BuildTestExtension()); | 63 scoped_refptr<extensions::Extension> extension(BuildTestExtension()); |
| 64 | 64 |
| 65 base::RunLoop run_loop; | 65 base::RunLoop run_loop; |
| 66 TestExtensionUninstallDialogDelegate delegate(run_loop.QuitClosure()); | 66 TestExtensionUninstallDialogDelegate delegate(run_loop.QuitClosure()); |
| 67 scoped_ptr<extensions::ExtensionUninstallDialog> dialog( | 67 std::unique_ptr<extensions::ExtensionUninstallDialog> dialog( |
| 68 extensions::ExtensionUninstallDialog::Create( | 68 extensions::ExtensionUninstallDialog::Create( |
| 69 browser()->profile(), browser()->window()->GetNativeWindow(), | 69 browser()->profile(), browser()->window()->GetNativeWindow(), |
| 70 &delegate)); | 70 &delegate)); |
| 71 browser()->window()->Close(); | 71 browser()->window()->Close(); |
| 72 content::RunAllPendingInMessageLoop(); | 72 content::RunAllPendingInMessageLoop(); |
| 73 | 73 |
| 74 dialog->ConfirmUninstall(extension.get(), | 74 dialog->ConfirmUninstall(extension.get(), |
| 75 extensions::UNINSTALL_REASON_FOR_TESTING, | 75 extensions::UNINSTALL_REASON_FOR_TESTING, |
| 76 extensions::UNINSTALL_SOURCE_FOR_TESTING); | 76 extensions::UNINSTALL_SOURCE_FOR_TESTING); |
| 77 run_loop.Run(); | 77 run_loop.Run(); |
| 78 EXPECT_TRUE(delegate.canceled()); | 78 EXPECT_TRUE(delegate.canceled()); |
| 79 } | 79 } |
| OLD | NEW |