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

Unified Diff: chrome/browser/cocoa/background_gradient_view_unittest.mm

Issue 260009: Several background pattern fixes on the Mac.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/background_gradient_view.mm ('k') | chrome/browser/cocoa/browser_frame_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/background_gradient_view_unittest.mm
===================================================================
--- chrome/browser/cocoa/background_gradient_view_unittest.mm (revision 28537)
+++ chrome/browser/cocoa/background_gradient_view_unittest.mm (working copy)
@@ -10,18 +10,29 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
+// Since BackgroundGradientView doesn't do any drawing by default, we
+// create a subclass to call its draw method for us.
+@interface BackgroundGradientSubClassTest : BackgroundGradientView
+@end
+
+@implementation BackgroundGradientSubClassTest
+- (void)drawRect:(NSRect)rect {
+ [self drawBackground];
+}
+@end
+
namespace {
class BackgroundGradientViewTest : public PlatformTest {
public:
BackgroundGradientViewTest() {
NSRect frame = NSMakeRect(0, 0, 100, 30);
- view_.reset([[BackgroundGradientView alloc] initWithFrame:frame]);
+ view_.reset([[BackgroundGradientSubClassTest alloc] initWithFrame:frame]);
[cocoa_helper_.contentView() addSubview:view_.get()];
}
CocoaTestHelper cocoa_helper_; // Inits Cocoa, creates window, etc...
- scoped_nsobject<BackgroundGradientView> view_;
+ scoped_nsobject<BackgroundGradientSubClassTest> view_;
};
// Test adding/removing from the view hierarchy, mostly to ensure nothing
« no previous file with comments | « chrome/browser/cocoa/background_gradient_view.mm ('k') | chrome/browser/cocoa/browser_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698