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

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

Issue 4635007: When an extension is uninstalled, close all desktop notifications from that e... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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 12 matching lines...) Expand all
23 @implementation TestBalloonController 23 @implementation TestBalloonController
24 - (void)initializeHost {} 24 - (void)initializeHost {}
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 Remove(const Notification& notification) { return false; } 33 virtual bool RemoveById(const std::string& id) { return false; }
34 virtual bool RemoveBySourceOrigin(const GURL& origin) { return false; }
34 virtual bool HasSpace() const { return true; } 35 virtual bool HasSpace() const { return true; }
35 virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size) {}; 36 virtual void ResizeBalloon(Balloon* balloon, const gfx::Size& size) {};
36 virtual void DisplayChanged() {} 37 virtual void DisplayChanged() {}
37 virtual void OnBalloonClosed(Balloon* source) {}; 38 virtual void OnBalloonClosed(Balloon* source) {};
38 virtual const Balloons& GetActiveBalloons() { 39 virtual const Balloons& GetActiveBalloons() {
39 NOTREACHED(); 40 NOTREACHED();
40 return balloons_; 41 return balloons_;
41 } 42 }
42 private: 43 private:
43 Balloons balloons_; 44 Balloons balloons_;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 103
103 [controller showWindow:nil]; 104 [controller showWindow:nil];
104 105
105 EXPECT_TRUE([controller desiredTotalWidth] > 100); 106 EXPECT_TRUE([controller desiredTotalWidth] > 100);
106 EXPECT_TRUE([controller desiredTotalHeight] > 100); 107 EXPECT_TRUE([controller desiredTotalHeight] > 100);
107 108
108 [controller closeBalloon:YES]; 109 [controller closeBalloon:YES];
109 } 110 }
110 111
111 } 112 }
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/notifications/balloon_controller.mm ('k') | chrome/browser/gtk/notifications/balloon_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698