OLD | NEW |
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 <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 menu_to_close_(nil), | 38 menu_to_close_(nil), |
39 did_show_(false), | 39 did_show_(false), |
40 did_close_(false) { | 40 did_close_(false) { |
41 } | 41 } |
42 | 42 |
43 bool IsCommandIdChecked(int command_id) const override { return false; } | 43 bool IsCommandIdChecked(int command_id) const override { return false; } |
44 bool IsCommandIdEnabled(int command_id) const override { | 44 bool IsCommandIdEnabled(int command_id) const override { |
45 ++enable_count_; | 45 ++enable_count_; |
46 return true; | 46 return true; |
47 } | 47 } |
48 bool GetAcceleratorForCommandId(int command_id, | |
49 Accelerator* accelerator) const override { | |
50 return false; | |
51 } | |
52 void ExecuteCommand(int command_id, int event_flags) override { | 48 void ExecuteCommand(int command_id, int event_flags) override { |
53 ++execute_count_; | 49 ++execute_count_; |
54 } | 50 } |
55 | 51 |
56 void MenuWillShow(SimpleMenuModel* /*source*/) override { | 52 void MenuWillShow(SimpleMenuModel* /*source*/) override { |
57 EXPECT_FALSE(did_show_); | 53 EXPECT_FALSE(did_show_); |
58 EXPECT_FALSE(did_close_); | 54 EXPECT_FALSE(did_close_); |
59 did_show_ = true; | 55 did_show_ = true; |
60 NSArray* modes = [NSArray arrayWithObjects:NSEventTrackingRunLoopMode, | 56 NSArray* modes = [NSArray arrayWithObjects:NSEventTrackingRunLoopMode, |
61 NSDefaultRunLoopMode, | 57 NSDefaultRunLoopMode, |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 // Pump the task that notifies the delegate. | 388 // Pump the task that notifies the delegate. |
393 message_loop.RunUntilIdle(); | 389 message_loop.RunUntilIdle(); |
394 | 390 |
395 // Expect that the delegate got notified properly. | 391 // Expect that the delegate got notified properly. |
396 EXPECT_TRUE(delegate.did_close_); | 392 EXPECT_TRUE(delegate.did_close_); |
397 } | 393 } |
398 | 394 |
399 } // namespace | 395 } // namespace |
400 | 396 |
401 } // namespace ui | 397 } // namespace ui |
OLD | NEW |