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 "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history
_swiper.h" | 5 #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history
_swiper.h" |
6 | 6 |
7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #import "base/mac/sdk_forward_declarations.h" | 8 #import "base/mac/sdk_forward_declarations.h" |
9 #import "chrome/browser/ui/cocoa/test/cocoa_test_helper.h" | 9 #import "chrome/browser/ui/cocoa/test/cocoa_test_helper.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 11 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
| 12 #include "third_party/WebKit/public/platform/WebMouseWheelEvent.h" |
12 #import "third_party/ocmock/OCMock/OCMock.h" | 13 #import "third_party/ocmock/OCMock/OCMock.h" |
13 #import "third_party/ocmock/ocmock_extensions.h" | 14 #import "third_party/ocmock/ocmock_extensions.h" |
14 | 15 |
15 @interface HistorySwiper (MacHistorySwiperTest) | 16 @interface HistorySwiper (MacHistorySwiperTest) |
16 - (BOOL)systemSettingsAllowHistorySwiping:(NSEvent*)event; | 17 - (BOOL)systemSettingsAllowHistorySwiping:(NSEvent*)event; |
17 - (BOOL)browserCanNavigateInDirection: | 18 - (BOOL)browserCanNavigateInDirection: |
18 (history_swiper::NavigationDirection)forward | 19 (history_swiper::NavigationDirection)forward |
19 event:(NSEvent*)event; | 20 event:(NSEvent*)event; |
20 - (void)removeHistoryOverlay; | 21 - (void)removeHistoryOverlay; |
21 - (void)showHistoryOverlay:(history_swiper::NavigationDirection)direction; | 22 - (void)showHistoryOverlay:(history_swiper::NavigationDirection)direction; |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 | 539 |
539 scrollEvent = | 540 scrollEvent = |
540 scrollWheelEventWithPhase(NSEventPhaseChanged, NSEventPhaseNone, 0, 20); | 541 scrollWheelEventWithPhase(NSEventPhaseChanged, NSEventPhaseNone, 0, 20); |
541 [historySwiper_ handleEvent:scrollEvent]; | 542 [historySwiper_ handleEvent:scrollEvent]; |
542 [historySwiper_ handleEvent:scrollWheelEventWithPhase(NSEventPhaseEnded)]; | 543 [historySwiper_ handleEvent:scrollWheelEventWithPhase(NSEventPhaseEnded)]; |
543 sendEndGestureEventAtPoint(makePoint(0.5, 0.7)); | 544 sendEndGestureEventAtPoint(makePoint(0.5, 0.7)); |
544 | 545 |
545 // Vertical motion should never trigger a history swipe! | 546 // Vertical motion should never trigger a history swipe! |
546 EXPECT_FALSE(magic_mouse_history_swipe_); | 547 EXPECT_FALSE(magic_mouse_history_swipe_); |
547 } | 548 } |
OLD | NEW |