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

Side by Side Diff: ui/message_center/cocoa/popup_controller_unittest.mm

Issue 101473003: Do not allow creating dummy notifier id from production, for safety. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 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) 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_controller.h" 5 #import "ui/message_center/cocoa/popup_controller.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/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #import "ui/base/test/ui_cocoa_test_helper.h" 11 #import "ui/base/test/ui_cocoa_test_helper.h"
12 #include "ui/message_center/notification.h" 12 #include "ui/message_center/notification.h"
13 13
14 namespace message_center {
15
14 class PopupControllerTest : public ui::CocoaTest { 16 class PopupControllerTest : public ui::CocoaTest {
15 }; 17 };
16 18
17 TEST_F(PopupControllerTest, Creation) { 19 TEST_F(PopupControllerTest, Creation) {
18 scoped_ptr<message_center::Notification> notification( 20 scoped_ptr<message_center::Notification> notification(
19 new message_center::Notification( 21 new message_center::Notification(
20 message_center::NOTIFICATION_TYPE_SIMPLE, 22 message_center::NOTIFICATION_TYPE_SIMPLE,
21 "", 23 "",
22 ASCIIToUTF16("Added to circles"), 24 ASCIIToUTF16("Added to circles"),
23 ASCIIToUTF16("Jonathan and 5 others"), 25 ASCIIToUTF16("Jonathan and 5 others"),
(...skipping 10 matching lines...) Expand all
34 // Add an extra ref count for scoped_nsobject since MCPopupController will 36 // Add an extra ref count for scoped_nsobject since MCPopupController will
35 // release itself when it is being closed. 37 // release itself when it is being closed.
36 [controller retain]; 38 [controller retain];
37 39
38 EXPECT_TRUE([controller window]); 40 EXPECT_TRUE([controller window]);
39 EXPECT_EQ(notification.get(), [controller notification]); 41 EXPECT_EQ(notification.get(), [controller notification]);
40 42
41 [controller showWindow:nil]; 43 [controller showWindow:nil];
42 [controller close]; 44 [controller close];
43 } 45 }
46
47 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/cocoa/popup_collection_unittest.mm ('k') | ui/message_center/cocoa/tray_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698