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

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: more tests 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
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..29ff96b103c7a6b0d913c2668076b2be82b42b8b
--- /dev/null
+++ b/ash/wm/overlay_event_filter_unittest.cc
@@ -0,0 +1,34 @@
+// 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;
+
+TEST_F(OverlayEventFilterTest, CancelAtActivating) {
James Cook 2014/08/12 21:51:14 nit: A brief comment about what you are testing/wh
Jun Mukai 2014/08/12 22:51:02 Done.
+ 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

Powered by Google App Engine
This is Rietveld 408576698