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

Unified Diff: chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm

Issue 107343008: mac: Fix a history swiper bug where the shield wouldn't disappear. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase against top of tree. Created 6 years, 12 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/ui/cocoa/history_overlay_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm b/chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm
index f92ccb92b86c0c463068a2c1c72cc56b2c1b2054..d550f81eaa8b837e9ebaef0e9359a7ead85db017 100644
--- a/chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/history_overlay_controller_unittest.mm
@@ -31,9 +31,10 @@ class HistoryOverlayControllerTest : public CocoaTest {
base::scoped_nsobject<NSView> test_view_;
};
-// Tests that the controller's view gets removed from the hierarchy when the
-// controller is deallocated.
-TEST_F(HistoryOverlayControllerTest, RemovedViewWhenDeallocated) {
+// Tests that when the controller is |-dismiss|ed, the animation runs and then
+// is removed when the animation completes. The view should be added and
+// removed at the appropriate times.
+TEST_F(HistoryOverlayControllerTest, DismissClearsAnimationsAndRemovesView) {
NSView* content_view = [test_window() contentView];
EXPECT_EQ(1u, [[content_view subviews] count]);
@@ -42,17 +43,6 @@ TEST_F(HistoryOverlayControllerTest, RemovedViewWhenDeallocated) {
[controller showPanelForView:test_view()];
EXPECT_EQ(2u, [[content_view subviews] count]);
- controller.reset();
- EXPECT_EQ(1u, [[content_view subviews] count]);
-}
-
-// Tests that when the controller is |-dismiss|ed, the animation runs and then
-// is removed when the animation completes.
-TEST_F(HistoryOverlayControllerTest, DismissClearsAnimations) {
- base::scoped_nsobject<HistoryOverlayController> controller(
- [[HistoryOverlayController alloc] initForMode:kHistoryOverlayModeBack]);
- [controller showPanelForView:test_view()];
-
scoped_ptr<base::MessagePumpNSRunLoop> message_pump(
new base::MessagePumpNSRunLoop);
@@ -87,4 +77,6 @@ TEST_F(HistoryOverlayControllerTest, DismissClearsAnimations) {
// After the animation runs, there should be no more animations.
EXPECT_FALSE([[controller view] animations]);
+
+ EXPECT_EQ(1u, [[content_view subviews] count]);
}
« no previous file with comments | « chrome/browser/ui/cocoa/history_overlay_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698