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

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

Issue 313203004: Make ExtensionInstallPrompt::Prompt ref-counted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master for CQ Created 6 years, 6 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 | Annotate | Revision Log
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 "extensions/common/extension.h" 14 #include "extensions/common/extension.h"
15 15
16 namespace { 16 namespace {
17 17
18 // Similar to ShowExtensionInstallDialogImpl except this allows the created 18 // Similar to ShowExtensionInstallDialogImpl except this allows the created
19 // dialog controller to be captured and manipulated for tests. 19 // dialog controller to be captured and manipulated for tests.
20 void TestingShowAppListInstallDialogController( 20 void TestingShowAppListInstallDialogController(
21 WindowedInstallDialogController** controller, 21 WindowedInstallDialogController** controller,
22 const ExtensionInstallPrompt::ShowParams& show_params, 22 const ExtensionInstallPrompt::ShowParams& show_params,
23 ExtensionInstallPrompt::Delegate* delegate, 23 ExtensionInstallPrompt::Delegate* delegate,
24 const ExtensionInstallPrompt::Prompt& prompt) { 24 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt) {
25 *controller = 25 *controller =
26 new WindowedInstallDialogController(show_params, delegate, prompt); 26 new WindowedInstallDialogController(show_params, delegate, prompt);
27 } 27 }
28 28
29 typedef InProcessBrowserTest WindowedInstallDialogControllerBrowserTest; 29 typedef InProcessBrowserTest WindowedInstallDialogControllerBrowserTest;
30 30
31 } // namespace 31 } // namespace
32 32
33 // Test for showing an extension install prompt with no parent WebContents. 33 // Test for showing an extension install prompt with no parent WebContents.
34 IN_PROC_BROWSER_TEST_F(WindowedInstallDialogControllerBrowserTest, 34 IN_PROC_BROWSER_TEST_F(WindowedInstallDialogControllerBrowserTest,
(...skipping 24 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