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

Side by Side Diff: chrome/browser/cocoa/bookmark_tree_browser_cell_unittest.mm

Issue 343042: Original discussion in CL for 337010. See http://codereview.chromium.org/337... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « chrome/browser/cocoa/bookmark_tree_browser_cell.mm ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import <Cocoa/Cocoa.h>
6
7 #include "chrome/browser/bookmarks/bookmark_model.h"
8 #import "chrome/browser/cocoa/bookmark_tree_browser_cell.h"
9 #import "chrome/browser/cocoa/cocoa_test_helper.h"
10 #include "testing/platform_test.h"
11
12 class BookmarkTreeBrowserCellTest : public PlatformTest {
13 public:
14 BookmarkTreeBrowserCellTest() {
15 // Set up our mocks.
16 GURL gurl;
17 bookmarkNodeMock_.reset(new BookmarkNode(gurl));
18 matrixMock_.reset([[NSMatrix alloc] init]);
19 targetMock_.reset([[NSObject alloc] init]);
20 }
21
22 scoped_ptr<BookmarkNode> bookmarkNodeMock_;
23 scoped_nsobject<NSMatrix> matrixMock_;
24 scoped_nsobject<NSObject> targetMock_;
25 };
26
27 TEST_F(BookmarkTreeBrowserCellTest, BasicAllocDealloc) {
28 BookmarkTreeBrowserCell* cell = [[[BookmarkTreeBrowserCell alloc]
29 initTextCell:@"TEST STRING"] autorelease];
30 [cell setMatrix:matrixMock_.get()];
31 [cell setTarget:targetMock_.get()];
32 [cell setAction:@selector(mockAction:)];
33 [cell setBookmarkNode:bookmarkNodeMock_.get()];
34
35 NSMatrix* testMatrix = [cell matrix];
36 EXPECT_EQ(testMatrix, matrixMock_.get());
37 id testTarget = [cell target];
38 EXPECT_EQ(testTarget, targetMock_.get());
39 SEL testAction = [cell action];
40 EXPECT_EQ(testAction, @selector(mockAction:));
41 const BookmarkNode* testBookmarkNode = [cell bookmarkNode];
42 EXPECT_EQ(testBookmarkNode, bookmarkNodeMock_.get());
43 }
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/bookmark_tree_browser_cell.mm ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698