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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/autofill_section_view_unittest.mm

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/ui/cocoa/autofill/autofill_section_view.h" 5 #import "chrome/browser/ui/cocoa/autofill/autofill_section_view.h"
6 6
7 #include <memory>
8
7 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
8 #include "base/memory/scoped_ptr.h"
9 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
10 #include "testing/gtest_mac.h" 11 #include "testing/gtest_mac.h"
11 #include "testing/platform_test.h" 12 #include "testing/platform_test.h"
12 #include "ui/events/test/cocoa_test_event_utils.h" 13 #include "ui/events/test/cocoa_test_event_utils.h"
13 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" 14 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
14 #import "ui/gfx/test/ui_cocoa_test_helper.h" 15 #import "ui/gfx/test/ui_cocoa_test_helper.h"
15 16
16 namespace { 17 namespace {
17 18
18 class AutofillSectionViewTest : public ui::CocoaTest { 19 class AutofillSectionViewTest : public ui::CocoaTest {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 for (NSInteger y = 0; y < NSHeight(bounds); ++y) { 71 for (NSInteger y = 0; y < NSHeight(bounds); ++y) {
71 for (NSInteger x = 0; x < NSWidth(bounds); ++x) { 72 for (NSInteger x = 0; x < NSWidth(bounds); ++x) {
72 ASSERT_NSEQ(color, [bitmap_ colorAtX:x y:y]); 73 ASSERT_NSEQ(color, [bitmap_ colorAtX:x y:y]);
73 } 74 }
74 } 75 }
75 } 76 }
76 77
77 protected: 78 protected:
78 base::scoped_nsobject<AutofillSectionView> view_; 79 base::scoped_nsobject<AutofillSectionView> view_;
79 base::scoped_nsobject<NSBitmapImageRep> bitmap_; 80 base::scoped_nsobject<NSBitmapImageRep> bitmap_;
80 scoped_ptr<gfx::ScopedNSGraphicsContextSaveGState> saved_context_; 81 std::unique_ptr<gfx::ScopedNSGraphicsContextSaveGState> saved_context_;
81 NSGraphicsContext* context_; 82 NSGraphicsContext* context_;
82 }; 83 };
83 84
84 } // namespace 85 } // namespace
85 86
86 // A simple delegate to intercept and register performClick: invocation. 87 // A simple delegate to intercept and register performClick: invocation.
87 @interface AutofillClickTestDelegate : NSControl { 88 @interface AutofillClickTestDelegate : NSControl {
88 @private 89 @private
89 BOOL didFire_; 90 BOOL didFire_;
90 } 91 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 base::scoped_nsobject<AutofillClickTestDelegate> delegate( 156 base::scoped_nsobject<AutofillClickTestDelegate> delegate(
156 [[AutofillClickTestDelegate alloc] init]); 157 [[AutofillClickTestDelegate alloc] init]);
157 [view_ setClickTarget:delegate]; 158 [view_ setClickTarget:delegate];
158 159
159 NSEvent* down_event = 160 NSEvent* down_event =
160 cocoa_test_event_utils::LeftMouseDownAtPoint(NSMakePoint(5, 5)); 161 cocoa_test_event_utils::LeftMouseDownAtPoint(NSMakePoint(5, 5));
161 ASSERT_FALSE([delegate didFire]); 162 ASSERT_FALSE([delegate didFire]);
162 [test_window() sendEvent:down_event]; 163 [test_window() sendEvent:down_event];
163 EXPECT_TRUE([delegate didFire]); 164 EXPECT_TRUE([delegate didFire]);
164 } 165 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698