OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |