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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_modal_dialog_queue_unittest.cc
===================================================================
--- chrome/browser/app_modal_dialog_queue_unittest.cc (revision 0)
+++ chrome/browser/app_modal_dialog_queue_unittest.cc (revision 0)
@@ -0,0 +1,45 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/basictypes.h"
+#include "chrome/browser/app_modal_dialog_delegate.h"
+#include "chrome/browser/app_modal_dialog_queue.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+class TestModalDialogDelegate : public AppModalDialogDelegate {
+ public:
+ TestModalDialogDelegate() {}
+ virtual ~TestModalDialogDelegate() {}
+
+ // Overridden from AppModalDialogDelegate:
+ virtual void ShowModalDialog() {}
+ virtual void ActivateModalDialog() {}
+ virtual AppModalDialogDelegateTesting* GetTestingInterface() { return NULL; }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TestModalDialogDelegate);
+};
+
+} // namespace
+
+TEST(AppModalDialogQueueTest, MultipleDialogTest) {
+ TestModalDialogDelegate modal_dialog1, modal_dialog2;
+ AppModalDialogQueue::AddDialog(&modal_dialog1);
+ AppModalDialogQueue::AddDialog(&modal_dialog2);
+
+ EXPECT_TRUE(AppModalDialogQueue::HasActiveDialog());
+ EXPECT_EQ(&modal_dialog1, AppModalDialogQueue::active_dialog());
+
+ AppModalDialogQueue::ShowNextDialog();
+
+ EXPECT_TRUE(AppModalDialogQueue::HasActiveDialog());
+ EXPECT_EQ(&modal_dialog2, AppModalDialogQueue::active_dialog());
+
+ AppModalDialogQueue::ShowNextDialog();
+
+ EXPECT_FALSE(AppModalDialogQueue::HasActiveDialog());
+ EXPECT_EQ(NULL, AppModalDialogQueue::active_dialog());
+}
« 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