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

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

Issue 2339143003: Revert of BackgroundGradientView: -drawBackground: → -drawRect: (Closed)
Patch Set: Created 4 years, 3 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
Index: chrome/browser/ui/cocoa/background_gradient_view_unittest.mm
diff --git a/chrome/browser/ui/cocoa/background_gradient_view_unittest.mm b/chrome/browser/ui/cocoa/background_gradient_view_unittest.mm
index 28f0fcce6d4a91bca36c955468dfaa5116f63ff2..3a45559d7522d1f1992fb122b3b59c9728768137 100644
--- a/chrome/browser/ui/cocoa/background_gradient_view_unittest.mm
+++ b/chrome/browser/ui/cocoa/background_gradient_view_unittest.mm
@@ -10,19 +10,32 @@
#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)dirtyRect {
+ [self drawBackground:dirtyRect];
+}
+
+@end
+
namespace {
class BackgroundGradientViewTest : public CocoaTest {
public:
BackgroundGradientViewTest() {
NSRect frame = NSMakeRect(0, 0, 100, 30);
- base::scoped_nsobject<BackgroundGradientView> view(
- [[BackgroundGradientView alloc] initWithFrame:frame]);
+ base::scoped_nsobject<BackgroundGradientSubClassTest> view(
+ [[BackgroundGradientSubClassTest alloc] initWithFrame:frame]);
view_ = view.get();
[[test_window() contentView] addSubview:view_];
}
- BackgroundGradientView* view_;
+ BackgroundGradientSubClassTest* view_;
};
TEST_VIEW(BackgroundGradientViewTest, view_)
« no previous file with comments | « chrome/browser/ui/cocoa/background_gradient_view.mm ('k') | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698