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

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

Issue 12066003: Remove TabStripModel wrapper use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gtk Created 7 years, 10 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 (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"
11 #include "chrome/browser/ui/browser_dialogs.h" 11 #include "chrome/browser/ui/browser_dialogs.h"
12 #include "chrome/browser/ui/browser_tabstrip.h" 12 #include "chrome/browser/ui/tabs/tab_strip_model.h"
13 #include "chrome/test/base/ui_test_utils.h" 13 #include "chrome/test/base/ui_test_utils.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 MockTabModalConfirmDialogDelegate::MockTabModalConfirmDialogDelegate( 16 MockTabModalConfirmDialogDelegate::MockTabModalConfirmDialogDelegate(
17 content::WebContents* web_contents, 17 content::WebContents* web_contents,
18 Delegate* delegate) 18 Delegate* delegate)
19 : TabModalConfirmDialogDelegate(web_contents), 19 : TabModalConfirmDialogDelegate(web_contents),
20 delegate_(delegate) { 20 delegate_(delegate) {
21 } 21 }
22 22
(...skipping 20 matching lines...) Expand all
43 43
44 TabModalConfirmDialogTest::TabModalConfirmDialogTest() 44 TabModalConfirmDialogTest::TabModalConfirmDialogTest()
45 : delegate_(NULL), 45 : delegate_(NULL),
46 dialog_(NULL), 46 dialog_(NULL),
47 accepted_count_(0), 47 accepted_count_(0),
48 canceled_count_(0) { 48 canceled_count_(0) {
49 } 49 }
50 50
51 void TabModalConfirmDialogTest::SetUpOnMainThread() { 51 void TabModalConfirmDialogTest::SetUpOnMainThread() {
52 delegate_ = new MockTabModalConfirmDialogDelegate( 52 delegate_ = new MockTabModalConfirmDialogDelegate(
53 chrome::GetActiveWebContents(browser()), this); 53 browser()->tab_strip_model()->GetActiveWebContents(), this);
54 dialog_ = TabModalConfirmDialog::Create( 54 dialog_ = TabModalConfirmDialog::Create(
55 delegate_, chrome::GetActiveWebContents(browser())); 55 delegate_, browser()->tab_strip_model()->GetActiveWebContents());
56 content::RunAllPendingInMessageLoop(); 56 content::RunAllPendingInMessageLoop();
57 } 57 }
58 58
59 void TabModalConfirmDialogTest::CleanUpOnMainThread() { 59 void TabModalConfirmDialogTest::CleanUpOnMainThread() {
60 content::RunAllPendingInMessageLoop(); 60 content::RunAllPendingInMessageLoop();
61 } 61 }
62 62
63 void TabModalConfirmDialogTest::OnAccepted() { 63 void TabModalConfirmDialogTest::OnAccepted() {
64 ++accepted_count_; 64 ++accepted_count_;
65 } 65 }
(...skipping 20 matching lines...) Expand all
86 EXPECT_EQ(1, canceled_count_); 86 EXPECT_EQ(1, canceled_count_);
87 } 87 }
88 88
89 IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, Quit) { 89 IN_PROC_BROWSER_TEST_F(TabModalConfirmDialogTest, Quit) {
90 MessageLoopForUI::current()->PostTask(FROM_HERE, 90 MessageLoopForUI::current()->PostTask(FROM_HERE,
91 base::Bind(&browser::AttemptExit)); 91 base::Bind(&browser::AttemptExit));
92 content::RunMessageLoop(); 92 content::RunMessageLoop();
93 EXPECT_EQ(0, accepted_count_); 93 EXPECT_EQ(0, accepted_count_);
94 EXPECT_EQ(1, canceled_count_); 94 EXPECT_EQ(1, canceled_count_);
95 } 95 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/login/login_prompt_browsertest.cc ('k') | chrome/browser/ui/views/web_dialog_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698