OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 using namespace blink; | 40 using namespace blink; |
41 using namespace WebCore; | 41 using namespace WebCore; |
42 | 42 |
43 namespace { | 43 namespace { |
44 | 44 |
45 TEST(WebUserGestureTokenTest, Basic) | 45 TEST(WebUserGestureTokenTest, Basic) |
46 { | 46 { |
47 WebUserGestureToken token; | 47 WebUserGestureToken token; |
48 EXPECT_FALSE(token.hasGestures()); | 48 EXPECT_FALSE(token.hasGestures()); |
| 49 EXPECT_FALSE(UserGestureIndicator::processedUserGestureInPast()); |
49 | 50 |
50 { | 51 { |
51 WebScopedUserGesture indicator(token); | 52 WebScopedUserGesture indicator(token); |
52 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); | 53 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); |
53 } | 54 } |
54 | 55 |
55 { | 56 { |
56 UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture); | 57 UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture); |
57 EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture()); | 58 EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture()); |
58 token = WebUserGestureIndicator::currentUserGestureToken(); | 59 token = WebUserGestureIndicator::currentUserGestureToken(); |
| 60 EXPECT_TRUE(UserGestureIndicator::processedUserGestureInPast()); |
59 } | 61 } |
60 | 62 |
61 EXPECT_TRUE(token.hasGestures()); | 63 EXPECT_TRUE(token.hasGestures()); |
62 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); | 64 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); |
63 | 65 |
64 { | 66 { |
65 WebScopedUserGesture indicator(token); | 67 WebScopedUserGesture indicator(token); |
66 EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture()); | 68 EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture()); |
67 WebUserGestureIndicator::consumeUserGesture(); | 69 WebUserGestureIndicator::consumeUserGesture(); |
68 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); | 70 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); |
69 } | 71 } |
70 | 72 |
71 EXPECT_FALSE(token.hasGestures()); | 73 EXPECT_FALSE(token.hasGestures()); |
72 | 74 |
73 { | 75 { |
74 WebScopedUserGesture indicator(token); | 76 WebScopedUserGesture indicator(token); |
75 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); | 77 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); |
76 } | 78 } |
| 79 |
| 80 EXPECT_TRUE(UserGestureIndicator::processedUserGestureInPast()); |
| 81 UserGestureIndicator::clearProcessedUserGestureInPast(); |
| 82 EXPECT_FALSE(UserGestureIndicator::processedUserGestureInPast()); |
77 } | 83 } |
78 | 84 |
79 } | 85 } |
OLD | NEW |