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

Side by Side Diff: chrome/browser/cocoa/notifications/balloon_controller_unittest.mm

Issue 5319011: Listen for APP_TERMINATING in notification ui; close windows earlier in the p... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/scoped_nsobject.h" 5 #include "base/scoped_nsobject.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/cocoa/browser_test_helper.h" 7 #include "chrome/browser/cocoa/browser_test_helper.h"
8 #include "chrome/browser/cocoa/cocoa_test_helper.h" 8 #include "chrome/browser/cocoa/cocoa_test_helper.h"
9 #include "chrome/browser/cocoa/notifications/balloon_controller.h" 9 #include "chrome/browser/cocoa/notifications/balloon_controller.h"
10 #include "chrome/browser/notifications/balloon.h" 10 #include "chrome/browser/notifications/balloon.h"
(...skipping 14 matching lines...) Expand all
25 @end 25 @end
26 26
27 namespace { 27 namespace {
28 28
29 // Use a dummy balloon collection for testing. 29 // Use a dummy balloon collection for testing.
30 class MockBalloonCollection : public BalloonCollection { 30 class MockBalloonCollection : public BalloonCollection {
31 virtual void Add(const Notification& notification, 31 virtual void Add(const Notification& notification,
32 Profile* profile) {} 32 Profile* profile) {}
33 virtual bool RemoveById(const std::string& id) { return false; } 33 virtual bool RemoveById(const std::string& id) { return false; }
34 virtual bool RemoveBySourceOrigin(const GURL& origin) { return false; } 34 virtual bool RemoveBySourceOrigin(const GURL& origin) { return false; }
35 virtual void RemoveAll() {}
35 virtual bool HasSpace() const { return true; } 36 virtual bool HasSpace() const { return true; }
36 virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size) {}; 37 virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size) {};
37 virtual void DisplayChanged() {} 38 virtual void DisplayChanged() {}
38 virtual void OnBalloonClosed(Balloon* source) {}; 39 virtual void OnBalloonClosed(Balloon* source) {};
39 virtual const Balloons& GetActiveBalloons() { 40 virtual const Balloons& GetActiveBalloons() {
40 NOTREACHED(); 41 NOTREACHED();
41 return balloons_; 42 return balloons_;
42 } 43 }
43 private: 44 private:
44 Balloons balloons_; 45 Balloons balloons_;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 104
104 [controller showWindow:nil]; 105 [controller showWindow:nil];
105 106
106 EXPECT_TRUE([controller desiredTotalWidth] > 100); 107 EXPECT_TRUE([controller desiredTotalWidth] > 100);
107 EXPECT_TRUE([controller desiredTotalHeight] > 100); 108 EXPECT_TRUE([controller desiredTotalHeight] > 100);
108 109
109 [controller closeBalloon:YES]; 110 [controller closeBalloon:YES];
110 } 111 }
111 112
112 } 113 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698