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

Side by Side Diff: chrome/browser/download/download_shelf_unittest.cc

Issue 12995025: [Mac] DownloadShelf should be notified when autoclosing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: + NSTrackingInVisibleRect Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chrome/browser/download/download_item_model.h" 9 #include "chrome/browser/download/download_item_model.h"
10 #include "chrome/browser/download/test_download_shelf.h" 10 #include "chrome/browser/download/test_download_shelf.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 EXPECT_TRUE(shelf()->IsShowing()); 77 EXPECT_TRUE(shelf()->IsShowing());
78 shelf()->Hide(); 78 shelf()->Hide();
79 EXPECT_FALSE(shelf()->IsShowing()); 79 EXPECT_FALSE(shelf()->IsShowing());
80 shelf()->Unhide(); 80 shelf()->Unhide();
81 EXPECT_TRUE(shelf()->IsShowing()); 81 EXPECT_TRUE(shelf()->IsShowing());
82 } 82 }
83 83
84 TEST_F(DownloadShelfTest, CloseWhileHiddenPreventsShowOnUnhide) { 84 TEST_F(DownloadShelfTest, CloseWhileHiddenPreventsShowOnUnhide) {
85 shelf()->Show(); 85 shelf()->Show();
86 shelf()->Hide(); 86 shelf()->Hide();
87 shelf()->Close(); 87 shelf()->Close(DownloadShelf::AUTOMATIC);
88 shelf()->Unhide(); 88 shelf()->Unhide();
89 EXPECT_FALSE(shelf()->IsShowing()); 89 EXPECT_FALSE(shelf()->IsShowing());
90 } 90 }
91 91
92 TEST_F(DownloadShelfTest, UnhideDoesntShowIfNotShownOnHide) { 92 TEST_F(DownloadShelfTest, UnhideDoesntShowIfNotShownOnHide) {
93 shelf()->Hide(); 93 shelf()->Hide();
94 shelf()->Unhide(); 94 shelf()->Unhide();
95 EXPECT_FALSE(shelf()->IsShowing()); 95 EXPECT_FALSE(shelf()->IsShowing());
96 } 96 }
97 97
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 .WillRepeatedly(Return(false)); 176 .WillRepeatedly(Return(false));
177 ASSERT_FALSE(DownloadItemModel(download_item()) 177 ASSERT_FALSE(DownloadItemModel(download_item())
178 .ShouldRemoveFromShelfWhenComplete()); 178 .ShouldRemoveFromShelfWhenComplete());
179 179
180 base::RunLoop run_loop; 180 base::RunLoop run_loop;
181 run_loop.RunUntilIdle(); 181 run_loop.RunUntilIdle();
182 182
183 EXPECT_TRUE(shelf()->did_add_download()); 183 EXPECT_TRUE(shelf()->did_add_download());
184 EXPECT_TRUE(shelf()->IsShowing()); 184 EXPECT_TRUE(shelf()->IsShowing());
185 } 185 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_shelf.cc ('k') | chrome/browser/download/test_download_shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698