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

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

Issue 5031001: [Mac] Removes the match preview tear image. Also removes the underlying reso... (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
« no previous file with comments | « chrome/browser/cocoa/previewable_contents_controller.mm ('k') | chrome/chrome_dll.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #import "base/scoped_nsobject.h" 7 #import "base/scoped_nsobject.h"
8 #include "chrome/browser/cocoa/browser_test_helper.h" 8 #include "chrome/browser/cocoa/browser_test_helper.h"
9 #include "chrome/browser/cocoa/cocoa_test_helper.h" 9 #include "chrome/browser/cocoa/cocoa_test_helper.h"
10 #import "chrome/browser/cocoa/previewable_contents_controller.h" 10 #import "chrome/browser/cocoa/previewable_contents_controller.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "testing/platform_test.h" 12 #include "testing/platform_test.h"
13 13
14 @interface PreviewableContentsController (ExposedForTesting)
15 - (NSButton*)closeButton;
16 @end
17
18 @implementation PreviewableContentsController (ExposedForTesting)
19 - (NSButton*)closeButton {
20 return closeButton_;
21 }
22 @end
23
24 namespace { 14 namespace {
25 15
26 class PreviewableContentsControllerTest : public CocoaTest { 16 class PreviewableContentsControllerTest : public CocoaTest {
27 public: 17 public:
28 virtual void SetUp() { 18 virtual void SetUp() {
29 CocoaTest::SetUp(); 19 CocoaTest::SetUp();
30 controller_.reset([[PreviewableContentsController alloc] init]); 20 controller_.reset([[PreviewableContentsController alloc] init]);
31 [[test_window() contentView] addSubview:[controller_ view]]; 21 [[test_window() contentView] addSubview:[controller_ view]];
32 } 22 }
33 23
34 scoped_nsobject<PreviewableContentsController> controller_; 24 scoped_nsobject<PreviewableContentsController> controller_;
35 }; 25 };
36 26
37 TEST_VIEW(PreviewableContentsControllerTest, [controller_ view]) 27 TEST_VIEW(PreviewableContentsControllerTest, [controller_ view])
38 28
39 // Adds the view to a window and displays it.
40 TEST_F(PreviewableContentsControllerTest, TestImagesLoadedProperly) {
41 EXPECT_TRUE([[[controller_ closeButton] image] isValid]);
42 }
43
44 // TODO(rohitrao): Test showing and hiding the preview. This may require 29 // TODO(rohitrao): Test showing and hiding the preview. This may require
45 // changing the interface to take in a TabContentsView* instead of a 30 // changing the interface to take in a TabContentsView* instead of a
46 // TabContents*. 31 // TabContents*.
47 32
48 } // namespace 33 } // namespace
49 34
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/previewable_contents_controller.mm ('k') | chrome/chrome_dll.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698