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

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

Issue 850843003: MacViews: Remove redundant virtuals in NativeWidgetMac and co. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20141229-MacViews-bringup2
Patch Set: format Created 5 years, 11 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 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 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/base/models/simple_menu_model.h" 8 #include "ui/base/models/simple_menu_model.h"
9 #include "ui/events/event_utils.h" 9 #include "ui/events/event_utils.h"
10 #include "ui/views/test/views_test_base.h" 10 #include "ui/views/test/views_test_base.h"
11 11
12 namespace views { 12 namespace views {
13 namespace test { 13 namespace test {
14 14
15 class MenuRunnerCocoaTest : public ViewsTestBase { 15 class MenuRunnerCocoaTest : public ViewsTestBase {
16 public: 16 public:
17 MenuRunnerCocoaTest() : runner_(NULL) {} 17 MenuRunnerCocoaTest() : runner_(NULL) {}
18 virtual ~MenuRunnerCocoaTest() {} 18 ~MenuRunnerCocoaTest() override {}
19 19
20 virtual void SetUp() override { 20 void SetUp() override {
21 ViewsTestBase::SetUp(); 21 ViewsTestBase::SetUp();
22 22
23 menu_.reset(new ui::SimpleMenuModel(NULL)); 23 menu_.reset(new ui::SimpleMenuModel(NULL));
24 menu_->AddItem(0, base::ASCIIToUTF16("Menu Item")); 24 menu_->AddItem(0, base::ASCIIToUTF16("Menu Item"));
25 25
26 runner_ = new internal::MenuRunnerImplCocoa(menu_.get()); 26 runner_ = new internal::MenuRunnerImplCocoa(menu_.get());
27 EXPECT_FALSE(runner_->IsRunning()); 27 EXPECT_FALSE(runner_->IsRunning());
28 } 28 }
29 29
30 virtual void TearDown() override { 30 void TearDown() override {
31 if (runner_) { 31 if (runner_) {
32 runner_->Release(); 32 runner_->Release();
33 runner_ = NULL; 33 runner_ = NULL;
34 } 34 }
35 35
36 ViewsTestBase::TearDown(); 36 ViewsTestBase::TearDown();
37 } 37 }
38 38
39 // Runs the menu after scheduling |block| on the run loop. 39 // Runs the menu after scheduling |block| on the run loop.
40 MenuRunner::RunResult RunMenu(dispatch_block_t block) { 40 MenuRunner::RunResult RunMenu(dispatch_block_t block) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 EXPECT_EQ(base::TimeDelta(), runner_->GetClosingEventTime()); 98 EXPECT_EQ(base::TimeDelta(), runner_->GetClosingEventTime());
99 } 99 }
100 100
101 TEST_F(MenuRunnerCocoaTest, DeleteWithoutRunning) { 101 TEST_F(MenuRunnerCocoaTest, DeleteWithoutRunning) {
102 runner_->Release(); 102 runner_->Release();
103 runner_ = NULL; 103 runner_ = NULL;
104 } 104 }
105 105
106 } // namespace test 106 } // namespace test
107 } // namespace views 107 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_message_loop_mac.h ('k') | ui/views/controls/menu/menu_runner_impl_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698