| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #import "base/memory/scoped_nsobject.h" | 7 #import "base/mac/scoped_nsobject.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/download/download_shelf.h" | 9 #include "chrome/browser/download/download_shelf.h" |
| 10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
| 11 #import "chrome/browser/ui/cocoa/download/download_item_controller.h" | 11 #import "chrome/browser/ui/cocoa/download/download_item_controller.h" |
| 12 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" | 12 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" |
| 13 #import "chrome/browser/ui/cocoa/view_resizer_pong.h" | 13 #import "chrome/browser/ui/cocoa/view_resizer_pong.h" |
| 14 #include "content/public/test/mock_download_item.h" | 14 #include "content/public/test/mock_download_item.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "testing/platform_test.h" | 16 #include "testing/platform_test.h" |
| 17 #import "third_party/ocmock/OCMock/OCMock.h" | 17 #import "third_party/ocmock/OCMock/OCMock.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 if (shelf_.get()) { | 103 if (shelf_.get()) { |
| 104 [shelf_ exiting]; | 104 [shelf_ exiting]; |
| 105 shelf_.reset(); | 105 shelf_.reset(); |
| 106 } | 106 } |
| 107 CocoaProfileTest::TearDown(); | 107 CocoaProfileTest::TearDown(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 protected: | 110 protected: |
| 111 id CreateItemController(); | 111 id CreateItemController(); |
| 112 | 112 |
| 113 scoped_nsobject<CountingDownloadShelfController> shelf_; | 113 base::scoped_nsobject<CountingDownloadShelfController> shelf_; |
| 114 scoped_nsobject<ViewResizerPong> resize_delegate_; | 114 base::scoped_nsobject<ViewResizerPong> resize_delegate_; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 id DownloadShelfControllerTest::CreateItemController() { | 117 id DownloadShelfControllerTest::CreateItemController() { |
| 118 scoped_ptr<content::MockDownloadItem> download( | 118 scoped_ptr<content::MockDownloadItem> download( |
| 119 new ::testing::NiceMock<content::MockDownloadItem>); | 119 new ::testing::NiceMock<content::MockDownloadItem>); |
| 120 ON_CALL(*download.get(), GetOpened()) | 120 ON_CALL(*download.get(), GetOpened()) |
| 121 .WillByDefault(Return(false)); | 121 .WillByDefault(Return(false)); |
| 122 ON_CALL(*download.get(), GetState()) | 122 ON_CALL(*download.get(), GetState()) |
| 123 .WillByDefault(Return(content::DownloadItem::IN_PROGRESS)); | 123 .WillByDefault(Return(content::DownloadItem::IN_PROGRESS)); |
| 124 | 124 |
| 125 scoped_nsobject<WrappedMockDownloadItem> wrappedMockDownload( | 125 base::scoped_nsobject<WrappedMockDownloadItem> wrappedMockDownload( |
| 126 [[WrappedMockDownloadItem alloc] initWithMockDownload:download.Pass()]); | 126 [[WrappedMockDownloadItem alloc] initWithMockDownload:download.Pass()]); |
| 127 | 127 |
| 128 id item_controller = | 128 id item_controller = |
| 129 [OCMockObject mockForClass:[DownloadItemController class]]; | 129 [OCMockObject mockForClass:[DownloadItemController class]]; |
| 130 scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:NSZeroRect]); | 130 base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:NSZeroRect]); |
| 131 [[[item_controller stub] andCall:@selector(download) | 131 [[[item_controller stub] andCall:@selector(download) |
| 132 onObject:wrappedMockDownload.get()] download]; | 132 onObject:wrappedMockDownload.get()] download]; |
| 133 [[item_controller stub] updateVisibility:[OCMArg any]]; | 133 [[item_controller stub] updateVisibility:[OCMArg any]]; |
| 134 [[[item_controller stub] | 134 [[[item_controller stub] |
| 135 andReturnValue:[NSValue valueWithSize:NSMakeSize(10,10)]] preferredSize]; | 135 andReturnValue:[NSValue valueWithSize:NSMakeSize(10,10)]] preferredSize]; |
| 136 [[[item_controller stub] andReturn:view.get()] view]; | 136 [[[item_controller stub] andReturn:view.get()] view]; |
| 137 [[[item_controller stub] | 137 [[[item_controller stub] |
| 138 andReturn:wrappedMockDownload.get()] wrappedMockDownload]; | 138 andReturn:wrappedMockDownload.get()] wrappedMockDownload]; |
| 139 return [item_controller retain]; | 139 return [item_controller retain]; |
| 140 } | 140 } |
| 141 | 141 |
| 142 TEST_VIEW(DownloadShelfControllerTest, [shelf_ view]); | 142 TEST_VIEW(DownloadShelfControllerTest, [shelf_ view]); |
| 143 | 143 |
| 144 // Removing the last download from the shelf should cause it to close | 144 // Removing the last download from the shelf should cause it to close |
| 145 // immediately. | 145 // immediately. |
| 146 TEST_F(DownloadShelfControllerTest, AddAndRemoveDownload) { | 146 TEST_F(DownloadShelfControllerTest, AddAndRemoveDownload) { |
| 147 scoped_nsobject<DownloadItemController> item(CreateItemController()); | 147 base::scoped_nsobject<DownloadItemController> item(CreateItemController()); |
| 148 [shelf_ showDownloadShelf:YES | 148 [shelf_ showDownloadShelf:YES |
| 149 isUserAction:NO]; | 149 isUserAction:NO]; |
| 150 EXPECT_TRUE([shelf_ isVisible]); | 150 EXPECT_TRUE([shelf_ isVisible]); |
| 151 EXPECT_TRUE([shelf_ bridge]->IsShowing()); | 151 EXPECT_TRUE([shelf_ bridge]->IsShowing()); |
| 152 [shelf_ add:item]; | 152 [shelf_ add:item]; |
| 153 [shelf_ remove:item]; | 153 [shelf_ remove:item]; |
| 154 EXPECT_FALSE([shelf_ isVisible]); | 154 EXPECT_FALSE([shelf_ isVisible]); |
| 155 EXPECT_FALSE([shelf_ bridge]->IsShowing()); | 155 EXPECT_FALSE([shelf_ bridge]->IsShowing()); |
| 156 // The shelf should be closed without scheduling an autoClose. | 156 // The shelf should be closed without scheduling an autoClose. |
| 157 EXPECT_EQ(0, shelf_.get()->scheduleAutoCloseCount_); | 157 EXPECT_EQ(0, shelf_.get()->scheduleAutoCloseCount_); |
| 158 } | 158 } |
| 159 | 159 |
| 160 // Test that the shelf doesn't close automatically after a removal if there are | 160 // Test that the shelf doesn't close automatically after a removal if there are |
| 161 // active download items still on the shelf. | 161 // active download items still on the shelf. |
| 162 TEST_F(DownloadShelfControllerTest, AddAndRemoveWithActiveItem) { | 162 TEST_F(DownloadShelfControllerTest, AddAndRemoveWithActiveItem) { |
| 163 scoped_nsobject<DownloadItemController> item1(CreateItemController()); | 163 base::scoped_nsobject<DownloadItemController> item1(CreateItemController()); |
| 164 scoped_nsobject<DownloadItemController> item2(CreateItemController()); | 164 base::scoped_nsobject<DownloadItemController> item2(CreateItemController()); |
| 165 [shelf_ showDownloadShelf:YES | 165 [shelf_ showDownloadShelf:YES |
| 166 isUserAction:NO]; | 166 isUserAction:NO]; |
| 167 EXPECT_TRUE([shelf_ isVisible]); | 167 EXPECT_TRUE([shelf_ isVisible]); |
| 168 [shelf_ add:item1.get()]; | 168 [shelf_ add:item1.get()]; |
| 169 [shelf_ add:item2.get()]; | 169 [shelf_ add:item2.get()]; |
| 170 [shelf_ remove:item1.get()]; | 170 [shelf_ remove:item1.get()]; |
| 171 EXPECT_TRUE([shelf_ isVisible]); | 171 EXPECT_TRUE([shelf_ isVisible]); |
| 172 [shelf_ remove:item2.get()]; | 172 [shelf_ remove:item2.get()]; |
| 173 EXPECT_FALSE([shelf_ isVisible]); | 173 EXPECT_FALSE([shelf_ isVisible]); |
| 174 EXPECT_EQ(0, shelf_.get()->scheduleAutoCloseCount_); | 174 EXPECT_EQ(0, shelf_.get()->scheduleAutoCloseCount_); |
| 175 } | 175 } |
| 176 | 176 |
| 177 // DownloadShelf::Unhide() should cause the shelf to be displayed if there are | 177 // DownloadShelf::Unhide() should cause the shelf to be displayed if there are |
| 178 // active downloads on it. | 178 // active downloads on it. |
| 179 TEST_F(DownloadShelfControllerTest, HideAndUnhide) { | 179 TEST_F(DownloadShelfControllerTest, HideAndUnhide) { |
| 180 scoped_nsobject<DownloadItemController> item(CreateItemController()); | 180 base::scoped_nsobject<DownloadItemController> item(CreateItemController()); |
| 181 [shelf_ showDownloadShelf:YES | 181 [shelf_ showDownloadShelf:YES |
| 182 isUserAction:NO]; | 182 isUserAction:NO]; |
| 183 EXPECT_TRUE([shelf_ isVisible]); | 183 EXPECT_TRUE([shelf_ isVisible]); |
| 184 [shelf_ add:item.get()]; | 184 [shelf_ add:item.get()]; |
| 185 [shelf_ bridge]->Hide(); | 185 [shelf_ bridge]->Hide(); |
| 186 EXPECT_FALSE([shelf_ isVisible]); | 186 EXPECT_FALSE([shelf_ isVisible]); |
| 187 [shelf_ bridge]->Unhide(); | 187 [shelf_ bridge]->Unhide(); |
| 188 EXPECT_TRUE([shelf_ isVisible]); | 188 EXPECT_TRUE([shelf_ isVisible]); |
| 189 [shelf_ remove:item.get()]; | 189 [shelf_ remove:item.get()]; |
| 190 EXPECT_FALSE([shelf_ isVisible]); | 190 EXPECT_FALSE([shelf_ isVisible]); |
| 191 } | 191 } |
| 192 | 192 |
| 193 // DownloadShelf::Unhide() shouldn't cause the shelf to be displayed if all | 193 // DownloadShelf::Unhide() shouldn't cause the shelf to be displayed if all |
| 194 // active downloads are removed from the shelf while the shelf was hidden. | 194 // active downloads are removed from the shelf while the shelf was hidden. |
| 195 TEST_F(DownloadShelfControllerTest, HideAutocloseUnhide) { | 195 TEST_F(DownloadShelfControllerTest, HideAutocloseUnhide) { |
| 196 scoped_nsobject<DownloadItemController> item(CreateItemController()); | 196 base::scoped_nsobject<DownloadItemController> item(CreateItemController()); |
| 197 [shelf_ showDownloadShelf:YES | 197 [shelf_ showDownloadShelf:YES |
| 198 isUserAction:NO]; | 198 isUserAction:NO]; |
| 199 EXPECT_TRUE([shelf_ isVisible]); | 199 EXPECT_TRUE([shelf_ isVisible]); |
| 200 [shelf_ add:item.get()]; | 200 [shelf_ add:item.get()]; |
| 201 [shelf_ bridge]->Hide(); | 201 [shelf_ bridge]->Hide(); |
| 202 EXPECT_FALSE([shelf_ isVisible]); | 202 EXPECT_FALSE([shelf_ isVisible]); |
| 203 [shelf_ remove:item.get()]; | 203 [shelf_ remove:item.get()]; |
| 204 EXPECT_FALSE([shelf_ isVisible]); | 204 EXPECT_FALSE([shelf_ isVisible]); |
| 205 [shelf_ bridge]->Unhide(); | 205 [shelf_ bridge]->Unhide(); |
| 206 EXPECT_FALSE([shelf_ isVisible]); | 206 EXPECT_FALSE([shelf_ isVisible]); |
| 207 } | 207 } |
| 208 | 208 |
| 209 // Test of autoclosing behavior after opening a download item. The mouse is on | 209 // Test of autoclosing behavior after opening a download item. The mouse is on |
| 210 // the download shelf at the time the autoclose is scheduled. | 210 // the download shelf at the time the autoclose is scheduled. |
| 211 TEST_F(DownloadShelfControllerTest, AutoCloseAfterOpenWithMouseInShelf) { | 211 TEST_F(DownloadShelfControllerTest, AutoCloseAfterOpenWithMouseInShelf) { |
| 212 scoped_nsobject<DownloadItemController> item(CreateItemController()); | 212 base::scoped_nsobject<DownloadItemController> item(CreateItemController()); |
| 213 [shelf_ showDownloadShelf:YES | 213 [shelf_ showDownloadShelf:YES |
| 214 isUserAction:NO]; | 214 isUserAction:NO]; |
| 215 EXPECT_TRUE([shelf_ isVisible]); | 215 EXPECT_TRUE([shelf_ isVisible]); |
| 216 [shelf_ add:item.get()]; | 216 [shelf_ add:item.get()]; |
| 217 // Expect 2 cancelAutoClose calls: From the showDownloadShelf: call and the | 217 // Expect 2 cancelAutoClose calls: From the showDownloadShelf: call and the |
| 218 // add: call. | 218 // add: call. |
| 219 EXPECT_EQ(2, shelf_.get()->cancelAutoCloseCount_); | 219 EXPECT_EQ(2, shelf_.get()->cancelAutoCloseCount_); |
| 220 shelf_.get()->cancelAutoCloseCount_ = 0; | 220 shelf_.get()->cancelAutoCloseCount_ = 0; |
| 221 | 221 |
| 222 // The mouse enters the shelf. | 222 // The mouse enters the shelf. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 239 EXPECT_EQ(0, shelf_.get()->cancelAutoCloseCount_); | 239 EXPECT_EQ(0, shelf_.get()->cancelAutoCloseCount_); |
| 240 | 240 |
| 241 // The mouse enters the shelf again. The autoClose should be cancelled. | 241 // The mouse enters the shelf again. The autoClose should be cancelled. |
| 242 [shelf_ mouseEntered:nil]; | 242 [shelf_ mouseEntered:nil]; |
| 243 EXPECT_EQ(1, shelf_.get()->scheduleAutoCloseCount_); | 243 EXPECT_EQ(1, shelf_.get()->scheduleAutoCloseCount_); |
| 244 EXPECT_EQ(1, shelf_.get()->cancelAutoCloseCount_); | 244 EXPECT_EQ(1, shelf_.get()->cancelAutoCloseCount_); |
| 245 } | 245 } |
| 246 | 246 |
| 247 // Test of autoclosing behavior after opening a download item. | 247 // Test of autoclosing behavior after opening a download item. |
| 248 TEST_F(DownloadShelfControllerTest, AutoCloseAfterOpenWithMouseOffShelf) { | 248 TEST_F(DownloadShelfControllerTest, AutoCloseAfterOpenWithMouseOffShelf) { |
| 249 scoped_nsobject<DownloadItemController> item(CreateItemController()); | 249 base::scoped_nsobject<DownloadItemController> item(CreateItemController()); |
| 250 [shelf_ showDownloadShelf:YES | 250 [shelf_ showDownloadShelf:YES |
| 251 isUserAction:NO]; | 251 isUserAction:NO]; |
| 252 EXPECT_TRUE([shelf_ isVisible]); | 252 EXPECT_TRUE([shelf_ isVisible]); |
| 253 [shelf_ add:item.get()]; | 253 [shelf_ add:item.get()]; |
| 254 | 254 |
| 255 // The download is opened. | 255 // The download is opened. |
| 256 EXPECT_CALL(*[[item wrappedMockDownload] mockDownload], GetOpened()) | 256 EXPECT_CALL(*[[item wrappedMockDownload] mockDownload], GetOpened()) |
| 257 .WillRepeatedly(Return(true)); | 257 .WillRepeatedly(Return(true)); |
| 258 [shelf_ downloadWasOpened:item.get()]; | 258 [shelf_ downloadWasOpened:item.get()]; |
| 259 | 259 |
| 260 // The shelf should be closed immediately since the mouse is not over the | 260 // The shelf should be closed immediately since the mouse is not over the |
| 261 // shelf. | 261 // shelf. |
| 262 EXPECT_FALSE([shelf_ isVisible]); | 262 EXPECT_FALSE([shelf_ isVisible]); |
| 263 } | 263 } |
| 264 | 264 |
| 265 // Test that if the shelf is closed while an autoClose is pending, the pending | 265 // Test that if the shelf is closed while an autoClose is pending, the pending |
| 266 // autoClose is cancelled. | 266 // autoClose is cancelled. |
| 267 TEST_F(DownloadShelfControllerTest, CloseWithPendingAutoClose) { | 267 TEST_F(DownloadShelfControllerTest, CloseWithPendingAutoClose) { |
| 268 scoped_nsobject<DownloadItemController> item(CreateItemController()); | 268 base::scoped_nsobject<DownloadItemController> item(CreateItemController()); |
| 269 [shelf_ showDownloadShelf:YES | 269 [shelf_ showDownloadShelf:YES |
| 270 isUserAction:NO]; | 270 isUserAction:NO]; |
| 271 EXPECT_TRUE([shelf_ isVisible]); | 271 EXPECT_TRUE([shelf_ isVisible]); |
| 272 [shelf_ add:item.get()]; | 272 [shelf_ add:item.get()]; |
| 273 // Expect 2 cancelAutoClose calls: From the showDownloadShelf: call and the | 273 // Expect 2 cancelAutoClose calls: From the showDownloadShelf: call and the |
| 274 // add: call. | 274 // add: call. |
| 275 EXPECT_EQ(2, shelf_.get()->cancelAutoCloseCount_); | 275 EXPECT_EQ(2, shelf_.get()->cancelAutoCloseCount_); |
| 276 shelf_.get()->cancelAutoCloseCount_ = 0; | 276 shelf_.get()->cancelAutoCloseCount_ = 0; |
| 277 | 277 |
| 278 // The mouse enters the shelf. | 278 // The mouse enters the shelf. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 299 // immediately. The pending autoClose should be cancelled. | 299 // immediately. The pending autoClose should be cancelled. |
| 300 [shelf_ remove:item]; | 300 [shelf_ remove:item]; |
| 301 EXPECT_EQ(1, shelf_.get()->scheduleAutoCloseCount_); | 301 EXPECT_EQ(1, shelf_.get()->scheduleAutoCloseCount_); |
| 302 EXPECT_EQ(1, shelf_.get()->cancelAutoCloseCount_); | 302 EXPECT_EQ(1, shelf_.get()->cancelAutoCloseCount_); |
| 303 EXPECT_FALSE([shelf_ isVisible]); | 303 EXPECT_FALSE([shelf_ isVisible]); |
| 304 } | 304 } |
| 305 | 305 |
| 306 // That that the shelf cancels a pending autoClose if a new download item is | 306 // That that the shelf cancels a pending autoClose if a new download item is |
| 307 // added to it. | 307 // added to it. |
| 308 TEST_F(DownloadShelfControllerTest, AddItemWithPendingAutoClose) { | 308 TEST_F(DownloadShelfControllerTest, AddItemWithPendingAutoClose) { |
| 309 scoped_nsobject<DownloadItemController> item(CreateItemController()); | 309 base::scoped_nsobject<DownloadItemController> item(CreateItemController()); |
| 310 [shelf_ showDownloadShelf:YES | 310 [shelf_ showDownloadShelf:YES |
| 311 isUserAction:NO]; | 311 isUserAction:NO]; |
| 312 EXPECT_TRUE([shelf_ isVisible]); | 312 EXPECT_TRUE([shelf_ isVisible]); |
| 313 [shelf_ add:item.get()]; | 313 [shelf_ add:item.get()]; |
| 314 // Expect 2 cancelAutoClose calls: From the showDownloadShelf: call and the | 314 // Expect 2 cancelAutoClose calls: From the showDownloadShelf: call and the |
| 315 // add: call. | 315 // add: call. |
| 316 EXPECT_EQ(2, shelf_.get()->cancelAutoCloseCount_); | 316 EXPECT_EQ(2, shelf_.get()->cancelAutoCloseCount_); |
| 317 shelf_.get()->cancelAutoCloseCount_ = 0; | 317 shelf_.get()->cancelAutoCloseCount_ = 0; |
| 318 | 318 |
| 319 // The mouse enters the shelf. | 319 // The mouse enters the shelf. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 330 EXPECT_TRUE([shelf_ isVisible]); | 330 EXPECT_TRUE([shelf_ isVisible]); |
| 331 EXPECT_EQ(0, shelf_.get()->scheduleAutoCloseCount_); | 331 EXPECT_EQ(0, shelf_.get()->scheduleAutoCloseCount_); |
| 332 EXPECT_EQ(0, shelf_.get()->cancelAutoCloseCount_); | 332 EXPECT_EQ(0, shelf_.get()->cancelAutoCloseCount_); |
| 333 | 333 |
| 334 // The mouse exits the shelf. autoClose should be scheduled now. | 334 // The mouse exits the shelf. autoClose should be scheduled now. |
| 335 [shelf_ mouseExited:nil]; | 335 [shelf_ mouseExited:nil]; |
| 336 EXPECT_EQ(1, shelf_.get()->scheduleAutoCloseCount_); | 336 EXPECT_EQ(1, shelf_.get()->scheduleAutoCloseCount_); |
| 337 EXPECT_EQ(0, shelf_.get()->cancelAutoCloseCount_); | 337 EXPECT_EQ(0, shelf_.get()->cancelAutoCloseCount_); |
| 338 | 338 |
| 339 // Add a new download item. The pending autoClose should be cancelled. | 339 // Add a new download item. The pending autoClose should be cancelled. |
| 340 scoped_nsobject<DownloadItemController> item2(CreateItemController()); | 340 base::scoped_nsobject<DownloadItemController> item2(CreateItemController()); |
| 341 [shelf_ add:item.get()]; | 341 [shelf_ add:item.get()]; |
| 342 EXPECT_EQ(1, shelf_.get()->scheduleAutoCloseCount_); | 342 EXPECT_EQ(1, shelf_.get()->scheduleAutoCloseCount_); |
| 343 EXPECT_EQ(1, shelf_.get()->cancelAutoCloseCount_); | 343 EXPECT_EQ(1, shelf_.get()->cancelAutoCloseCount_); |
| 344 EXPECT_TRUE([shelf_ isVisible]); | 344 EXPECT_TRUE([shelf_ isVisible]); |
| 345 } | 345 } |
| 346 | 346 |
| 347 // Test that pending autoClose calls are cancelled when exiting. | 347 // Test that pending autoClose calls are cancelled when exiting. |
| 348 TEST_F(DownloadShelfControllerTest, CancelAutoCloseOnExit) { | 348 TEST_F(DownloadShelfControllerTest, CancelAutoCloseOnExit) { |
| 349 scoped_nsobject<DownloadItemController> item(CreateItemController()); | 349 base::scoped_nsobject<DownloadItemController> item(CreateItemController()); |
| 350 [shelf_ showDownloadShelf:YES | 350 [shelf_ showDownloadShelf:YES |
| 351 isUserAction:NO]; | 351 isUserAction:NO]; |
| 352 EXPECT_TRUE([shelf_ isVisible]); | 352 EXPECT_TRUE([shelf_ isVisible]); |
| 353 [shelf_ add:item.get()]; | 353 [shelf_ add:item.get()]; |
| 354 EXPECT_EQ(0, shelf_.get()->scheduleAutoCloseCount_); | 354 EXPECT_EQ(0, shelf_.get()->scheduleAutoCloseCount_); |
| 355 EXPECT_EQ(2, shelf_.get()->cancelAutoCloseCount_); | 355 EXPECT_EQ(2, shelf_.get()->cancelAutoCloseCount_); |
| 356 | 356 |
| 357 [shelf_ exiting]; | 357 [shelf_ exiting]; |
| 358 EXPECT_EQ(0, shelf_.get()->scheduleAutoCloseCount_); | 358 EXPECT_EQ(0, shelf_.get()->scheduleAutoCloseCount_); |
| 359 EXPECT_EQ(3, shelf_.get()->cancelAutoCloseCount_); | 359 EXPECT_EQ(3, shelf_.get()->cancelAutoCloseCount_); |
| 360 shelf_.reset(); | 360 shelf_.reset(); |
| 361 } | 361 } |
| 362 | 362 |
| 363 } // namespace | 363 } // namespace |
| OLD | NEW |