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

Side by Side Diff: chrome/browser/ui/tab_modal_confirm_dialog_browsertest.cc

Issue 11361046: Remove TabContents from TabModalConfirmDialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: missing include Created 8 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 | Annotate | Revision Log
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 #include "chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h" 5 #include "chrome/browser/ui/tab_modal_confirm_dialog_browsertest.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/lifetime/application_lifetime.h" 9 #include "chrome/browser/lifetime/application_lifetime.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 24 matching lines...) Expand all
35 }; 35 };
36 36
37 TabModalConfirmDialogTest::TabModalConfirmDialogTest() 37 TabModalConfirmDialogTest::TabModalConfirmDialogTest()
38 : delegate_(NULL), 38 : delegate_(NULL),
39 dialog_(NULL) {} 39 dialog_(NULL) {}
40 40
41 void TabModalConfirmDialogTest::SetUpOnMainThread() { 41 void TabModalConfirmDialogTest::SetUpOnMainThread() {
42 delegate_ = new MockTabModalConfirmDialogDelegate( 42 delegate_ = new MockTabModalConfirmDialogDelegate(
43 chrome::GetActiveWebContents(browser())); 43 chrome::GetActiveWebContents(browser()));
44 dialog_ = TabModalConfirmDialog::Create( 44 dialog_ = TabModalConfirmDialog::Create(
45 delegate_, chrome::GetActiveTabContents(browser())); 45 delegate_, chrome::GetActiveWebContents(browser()));
46 content::RunAllPendingInMessageLoop(); 46 content::RunAllPendingInMessageLoop();
47 } 47 }
48 48
49 void TabModalConfirmDialogTest::CleanUpOnMainThread() { 49 void TabModalConfirmDialogTest::CleanUpOnMainThread() {
50 content::RunAllPendingInMessageLoop(); 50 content::RunAllPendingInMessageLoop();
51 ::testing::Mock::VerifyAndClearExpectations(delegate_); 51 ::testing::Mock::VerifyAndClearExpectations(delegate_);
52 } 52 }
53 53
54 IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, Accept) { 54 IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, Accept) {
55 EXPECT_CALL(*delegate_, OnAccepted()); 55 EXPECT_CALL(*delegate_, OnAccepted());
56 dialog_->AcceptTabModalDialog(); 56 dialog_->AcceptTabModalDialog();
57 } 57 }
58 58
59 IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, Cancel) { 59 IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, Cancel) {
60 EXPECT_CALL(*delegate_, OnCanceled()); 60 EXPECT_CALL(*delegate_, OnCanceled());
61 dialog_->CancelTabModalDialog(); 61 dialog_->CancelTabModalDialog();
62 } 62 }
63 63
64 IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, CancelSelf) { 64 IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, CancelSelf) {
65 EXPECT_CALL(*delegate_, OnCanceled()); 65 EXPECT_CALL(*delegate_, OnCanceled());
66 delegate_->Cancel(); 66 delegate_->Cancel();
67 } 67 }
68 68
69 IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, Quit) { 69 IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, Quit) {
70 EXPECT_CALL(*delegate_, OnCanceled()); 70 EXPECT_CALL(*delegate_, OnCanceled());
71 MessageLoopForUI::current()->PostTask(FROM_HERE, 71 MessageLoopForUI::current()->PostTask(FROM_HERE,
72 base::Bind(&browser::AttemptExit)); 72 base::Bind(&browser::AttemptExit));
73 content::RunMessageLoop(); 73 content::RunMessageLoop();
74 } 74 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tab_modal_confirm_dialog.h ('k') | chrome/browser/ui/views/external_tab_container_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698