| 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 #include "base/mac/foundation_util.h" | 5 #include "base/mac/foundation_util.h" |
| 6 #include "base/mac/scoped_nsobject.h" | 6 #include "base/mac/scoped_nsobject.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "skia/ext/skia_utils_mac.h" | 8 #include "skia/ext/skia_utils_mac.h" |
| 9 #import "testing/gtest_mac.h" | 9 #import "testing/gtest_mac.h" |
| 10 #include "ui/app_list/app_list_constants.h" | 10 #include "ui/app_list/app_list_constants.h" |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 | 976 |
| 977 // Test a context menu request while the item is still installing. | 977 // Test a context menu request while the item is still installing. |
| 978 item_two_model->SetMenuReadyForTesting(false); | 978 item_two_model->SetMenuReadyForTesting(false); |
| 979 menu = [page menuForEvent:mouse_at_cell_1]; | 979 menu = [page menuForEvent:mouse_at_cell_1]; |
| 980 EXPECT_EQ(nil, menu); | 980 EXPECT_EQ(nil, menu); |
| 981 | 981 |
| 982 item_two_model->SetMenuReadyForTesting(true); | 982 item_two_model->SetMenuReadyForTesting(true); |
| 983 menu = [page menuForEvent:mouse_at_cell_1]; | 983 menu = [page menuForEvent:mouse_at_cell_1]; |
| 984 EXPECT_EQ(1, [menu numberOfItems]); | 984 EXPECT_EQ(1, [menu numberOfItems]); |
| 985 EXPECT_NSEQ(@"Menu For: Item Two", [[menu itemAtIndex:0] title]); | 985 EXPECT_NSEQ(@"Menu For: Item Two", [[menu itemAtIndex:0] title]); |
| 986 |
| 987 // Test that a button being held down with the left button does not also show |
| 988 // a context menu. |
| 989 [GetItemViewAt(0) highlight:YES]; |
| 990 EXPECT_FALSE([page menuForEvent:mouse_at_cell_0]); |
| 991 [GetItemViewAt(0) highlight:NO]; |
| 992 EXPECT_TRUE([page menuForEvent:mouse_at_cell_0]); |
| 986 } | 993 } |
| 987 | 994 |
| 988 } // namespace test | 995 } // namespace test |
| 989 } // namespace app_list | 996 } // namespace app_list |
| OLD | NEW |