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 UserGestureIndicator::clearProcessedUserGestureInPast(); |
| 50 EXPECT_FALSE(UserGestureIndicator::processedUserGestureInPast()); |
49 | 51 |
50 { | 52 { |
51 WebScopedUserGesture indicator(token); | 53 WebScopedUserGesture indicator(token); |
52 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); | 54 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); |
53 } | 55 } |
54 | 56 |
55 { | 57 { |
56 UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture); | 58 UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture); |
57 EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture()); | 59 EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture()); |
58 token = WebUserGestureIndicator::currentUserGestureToken(); | 60 token = WebUserGestureIndicator::currentUserGestureToken(); |
| 61 EXPECT_TRUE(UserGestureIndicator::processedUserGestureInPast()); |
59 } | 62 } |
60 | 63 |
61 EXPECT_TRUE(token.hasGestures()); | 64 EXPECT_TRUE(token.hasGestures()); |
62 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); | 65 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); |
63 | 66 |
64 { | 67 { |
65 WebScopedUserGesture indicator(token); | 68 WebScopedUserGesture indicator(token); |
66 EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture()); | 69 EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture()); |
67 WebUserGestureIndicator::consumeUserGesture(); | 70 WebUserGestureIndicator::consumeUserGesture(); |
68 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); | 71 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); |
69 } | 72 } |
70 | 73 |
71 EXPECT_FALSE(token.hasGestures()); | 74 EXPECT_FALSE(token.hasGestures()); |
72 | 75 |
73 { | 76 { |
74 WebScopedUserGesture indicator(token); | 77 WebScopedUserGesture indicator(token); |
75 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); | 78 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); |
76 } | 79 } |
| 80 |
| 81 EXPECT_TRUE(UserGestureIndicator::processedUserGestureInPast()); |
77 } | 82 } |
78 | 83 |
79 } | 84 } |
OLD | NEW |