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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller_browsertest.mm

Issue 662073002: Fix crash when user closes window prior to the "Confirm Install" prompt showing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/install_prompt_navigator
Patch Set: Created 6 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #import "chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.h " 5 #import "chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.h "
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/threading/sequenced_worker_pool.h" 8 #include "base/threading/sequenced_worker_pool.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #import "chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils. h" 10 #import "chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils. h"
11 #import "chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h" 11 #import "chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h"
12 #include "chrome/test/base/in_process_browser_test.h" 12 #include "chrome/test/base/in_process_browser_test.h"
13 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
14 #include "content/public/test/test_utils.h" 14 #include "content/public/test/test_utils.h"
15 #include "extensions/common/extension.h" 15 #include "extensions/common/extension.h"
16 16
17 namespace { 17 namespace {
18 18
19 // Similar to ShowExtensionInstallDialogImpl except this allows the created 19 // Similar to ShowExtensionInstallDialogImpl except this allows the created
20 // dialog controller to be captured and manipulated for tests. 20 // dialog controller to be captured and manipulated for tests.
21 void TestingShowAppListInstallDialogController( 21 void TestingShowAppListInstallDialogController(
22 WindowedInstallDialogController** controller, 22 WindowedInstallDialogController** controller,
23 const ExtensionInstallPrompt::ShowParams& show_params, 23 ExtensionInstallPromptShowParams* show_params,
24 ExtensionInstallPrompt::Delegate* delegate, 24 ExtensionInstallPrompt::Delegate* delegate,
25 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt) { 25 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt) {
26 *controller = 26 *controller =
27 new WindowedInstallDialogController(show_params, delegate, prompt); 27 new WindowedInstallDialogController(show_params, delegate, prompt);
28 } 28 }
29 29
30 typedef InProcessBrowserTest WindowedInstallDialogControllerBrowserTest; 30 typedef InProcessBrowserTest WindowedInstallDialogControllerBrowserTest;
31 31
32 } // namespace 32 } // namespace
33 33
(...skipping 25 matching lines...) Expand all
59 EXPECT_EQ(0, delegate.abort_count()); 59 EXPECT_EQ(0, delegate.abort_count());
60 60
61 // Press cancel to close the window. 61 // Press cancel to close the window.
62 [[controller->GetViewController() cancelButton] performClick:nil]; 62 [[controller->GetViewController() cancelButton] performClick:nil];
63 EXPECT_FALSE([window delegate]); 63 EXPECT_FALSE([window delegate]);
64 EXPECT_EQ(1, delegate.abort_count()); 64 EXPECT_EQ(1, delegate.abort_count());
65 65
66 // Ensure the window is closed. 66 // Ensure the window is closed.
67 EXPECT_FALSE([window isVisible]); 67 EXPECT_FALSE([window isVisible]);
68 } 68 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698