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

Unified Diff: ash/wm/overlay_event_filter_unittest.cc

Issue 461093003: Fix the bug of multiple overlays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix Created 6 years, 4 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 | « ash/wm/overlay_event_filter.cc ('k') | ash/wm/partial_screenshot_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/overlay_event_filter_unittest.cc
diff --git a/ash/wm/overlay_event_filter_unittest.cc b/ash/wm/overlay_event_filter_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..618e4d8d13aacaf44ac7e8efe5937486575747d8
--- /dev/null
+++ b/ash/wm/overlay_event_filter_unittest.cc
@@ -0,0 +1,37 @@
+// Copyright 2014 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 "ash/wm/overlay_event_filter.h"
+
+#include "ash/shell.h"
+#include "ash/test/ash_test_base.h"
+#include "ash/test/test_overlay_delegate.h"
+
+namespace ash {
+namespace test {
+
+typedef AshTestBase OverlayEventFilterTest;
+
+// Tests of the multiple overlay delegates attempt to activate, in that case
+// Cancel() of the existing delegate should be called.
+// See http://crbug.com/341958
+TEST_F(OverlayEventFilterTest, CancelAtActivating) {
+ TestOverlayDelegate d1;
+ TestOverlayDelegate d2;
+
+ Shell::GetInstance()->overlay_filter()->Activate(&d1);
+ EXPECT_EQ(0, d1.GetCancelCountAndReset());
+ EXPECT_EQ(0, d2.GetCancelCountAndReset());
+
+ Shell::GetInstance()->overlay_filter()->Activate(&d2);
+ EXPECT_EQ(1, d1.GetCancelCountAndReset());
+ EXPECT_EQ(0, d2.GetCancelCountAndReset());
+
+ Shell::GetInstance()->overlay_filter()->Cancel();
+ EXPECT_EQ(0, d1.GetCancelCountAndReset());
+ EXPECT_EQ(1, d2.GetCancelCountAndReset());
+}
+
+} // namespace test
+} // namespace ash
« no previous file with comments | « ash/wm/overlay_event_filter.cc ('k') | ash/wm/partial_screenshot_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698