Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: Source/web/tests/WebUserGestureTokenTest.cpp

Issue 239963005: Fixes in UserGestureIndicator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments addressed, tests fixed Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/UserGestureIndicator.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « Source/platform/UserGestureIndicator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698