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

Side by Side Diff: ui/views/controls/menu/menu_runner_cocoa_unittest.mm

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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
« no previous file with comments | « ui/views/controls/menu/menu_runner.cc ('k') | ui/views/controls/menu/menu_runner_impl.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/views/controls/menu/menu_runner_impl_cocoa.h" 5 #import "ui/views/controls/menu/menu_runner_impl_cocoa.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 runner_->Cancel(); 131 runner_->Cancel();
132 EXPECT_FALSE(runner_->IsRunning()); 132 EXPECT_FALSE(runner_->IsRunning());
133 } 133 }
134 134
135 void MenuDeleteCallback() { 135 void MenuDeleteCallback() {
136 runner_->Release(); 136 runner_->Release();
137 runner_ = nullptr; 137 runner_ = nullptr;
138 } 138 }
139 139
140 protected: 140 protected:
141 scoped_ptr<TestModel> menu_; 141 std::unique_ptr<TestModel> menu_;
142 internal::MenuRunnerImplCocoa* runner_ = nullptr; 142 internal::MenuRunnerImplCocoa* runner_ = nullptr;
143 views::Widget* parent_ = nullptr; 143 views::Widget* parent_ = nullptr;
144 NSRect last_anchor_frame_ = NSZeroRect; 144 NSRect last_anchor_frame_ = NSZeroRect;
145 145
146 private: 146 private:
147 void RunMenuWrapperCallback(const base::Closure& callback) { 147 void RunMenuWrapperCallback(const base::Closure& callback) {
148 EXPECT_TRUE(runner_->IsRunning()); 148 EXPECT_TRUE(runner_->IsRunning());
149 callback.Run(); 149 callback.Run();
150 } 150 }
151 151
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 // In RTL, Cocoa messes up the positioning unless the anchor rectangle is 239 // In RTL, Cocoa messes up the positioning unless the anchor rectangle is
240 // offset to the right of the view. The offset for the checkmark is also 240 // offset to the right of the view. The offset for the checkmark is also
241 // skipped, to give a better match to native behavior. 241 // skipped, to give a better match to native behavior.
242 base::i18n::SetICUDefaultLocale("he"); 242 base::i18n::SetICUDefaultLocale("he");
243 RunMenuAt(anchor_rect); 243 RunMenuAt(anchor_rect);
244 EXPECT_EQ(combobox_rect.right(), last_anchor_frame_.origin.x); 244 EXPECT_EQ(combobox_rect.right(), last_anchor_frame_.origin.x);
245 } 245 }
246 246
247 } // namespace test 247 } // namespace test
248 } // namespace views 248 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_runner.cc ('k') | ui/views/controls/menu/menu_runner_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698