OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/message_center/cocoa/popup_collection.h" | 5 #import "ui/message_center/cocoa/popup_collection.h" |
6 | 6 |
7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 center_ = message_center::MessageCenter::Get(); | 28 center_ = message_center::MessageCenter::Get(); |
29 collection_.reset( | 29 collection_.reset( |
30 [[MCPopupCollection alloc] initWithMessageCenter:center_]); | 30 [[MCPopupCollection alloc] initWithMessageCenter:center_]); |
31 [collection_ setAnimationDuration:0.001]; | 31 [collection_ setAnimationDuration:0.001]; |
32 [collection_ setAnimationEndedCallback:^{ | 32 [collection_ setAnimationEndedCallback:^{ |
33 if (nested_run_loop_.get()) | 33 if (nested_run_loop_.get()) |
34 nested_run_loop_->Quit(); | 34 nested_run_loop_->Quit(); |
35 }]; | 35 }]; |
36 } | 36 } |
37 | 37 |
38 virtual void TearDown() OVERRIDE { | 38 virtual void TearDown() override { |
39 collection_.reset(); // Close all popups. | 39 collection_.reset(); // Close all popups. |
40 ui::CocoaTest::TearDown(); | 40 ui::CocoaTest::TearDown(); |
41 } | 41 } |
42 | 42 |
43 virtual ~PopupCollectionTest() { | 43 virtual ~PopupCollectionTest() { |
44 message_center::MessageCenter::Shutdown(); | 44 message_center::MessageCenter::Shutdown(); |
45 } | 45 } |
46 | 46 |
47 message_center::NotifierId DummyNotifierId() { | 47 message_center::NotifierId DummyNotifierId() { |
48 return message_center::NotifierId(); | 48 return message_center::NotifierId(); |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 // If it will be true after all animaions ends, | 444 // If it will be true after all animaions ends, |
445 // no new notification can be added and collection will be blocked. | 445 // no new notification can be added and collection will be blocked. |
446 EXPECT_FALSE([collection_ isAnimating]); | 446 EXPECT_FALSE([collection_ isAnimating]); |
447 | 447 |
448 // Release the popup collection before the animation ends. No crash should | 448 // Release the popup collection before the animation ends. No crash should |
449 // be expected. | 449 // be expected. |
450 collection_.reset(); | 450 collection_.reset(); |
451 } | 451 } |
452 | 452 |
453 } // namespace message_center | 453 } // namespace message_center |
OLD | NEW |