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

Side by Side Diff: chrome/browser/app_modal_dialog_queue_unittest.cc

Issue 27080: AppModalDialogQueue shouldn't depend on views. (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 11 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
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/basictypes.h"
6 #include "chrome/browser/app_modal_dialog_delegate.h"
7 #include "chrome/browser/app_modal_dialog_queue.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace {
11
12 class TestModalDialogDelegate : public AppModalDialogDelegate {
13 public:
14 TestModalDialogDelegate() {}
15 virtual ~TestModalDialogDelegate() {}
16
17 // Overridden from AppModalDialogDelegate:
18 virtual void ShowModalDialog() {}
19 virtual void ActivateModalDialog() {}
20 virtual AppModalDialogDelegateTesting* GetTestingInterface() { return NULL; }
21
22 private:
23 DISALLOW_COPY_AND_ASSIGN(TestModalDialogDelegate);
24 };
25
26 } // namespace
27
28 TEST(AppModalDialogQueueTest, MultipleDialogTest) {
29 TestModalDialogDelegate modal_dialog1, modal_dialog2;
30 AppModalDialogQueue::AddDialog(&modal_dialog1);
31 AppModalDialogQueue::AddDialog(&modal_dialog2);
32
33 EXPECT_TRUE(AppModalDialogQueue::HasActiveDialog());
34 EXPECT_EQ(&modal_dialog1, AppModalDialogQueue::active_dialog());
35
36 AppModalDialogQueue::ShowNextDialog();
37
38 EXPECT_TRUE(AppModalDialogQueue::HasActiveDialog());
39 EXPECT_EQ(&modal_dialog2, AppModalDialogQueue::active_dialog());
40
41 AppModalDialogQueue::ShowNextDialog();
42
43 EXPECT_FALSE(AppModalDialogQueue::HasActiveDialog());
44 EXPECT_EQ(NULL, AppModalDialogQueue::active_dialog());
45 }
OLDNEW
« no previous file with comments | « chrome/browser/app_modal_dialog_queue.cc ('k') | chrome/browser/automation/automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698