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

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

Issue 2401123002: UserGestureIndicator is a mess. Clean it up. (Closed)
Patch Set: Callback cleanup, comments Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebFrameTest.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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 EXPECT_FALSE(token.hasGestures()); 42 EXPECT_FALSE(token.hasGestures());
43 UserGestureIndicator::clearProcessedUserGestureSinceLoad(); 43 UserGestureIndicator::clearProcessedUserGestureSinceLoad();
44 EXPECT_FALSE(UserGestureIndicator::processedUserGestureSinceLoad()); 44 EXPECT_FALSE(UserGestureIndicator::processedUserGestureSinceLoad());
45 45
46 { 46 {
47 WebScopedUserGesture indicator(token); 47 WebScopedUserGesture indicator(token);
48 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); 48 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture());
49 } 49 }
50 50
51 { 51 {
52 UserGestureIndicator indicator(DefinitelyProcessingNewUserGesture); 52 UserGestureIndicator indicator(
53 UserGestureToken::create(UserGestureToken::NewGesture));
53 EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture()); 54 EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture());
54 token = WebUserGestureIndicator::currentUserGestureToken(); 55 token = WebUserGestureIndicator::currentUserGestureToken();
55 EXPECT_TRUE(UserGestureIndicator::processedUserGestureSinceLoad()); 56 EXPECT_TRUE(UserGestureIndicator::processedUserGestureSinceLoad());
56 } 57 }
57 58
58 EXPECT_TRUE(token.hasGestures()); 59 EXPECT_TRUE(token.hasGestures());
59 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); 60 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture());
60 61
61 { 62 {
62 WebScopedUserGesture indicator(token); 63 WebScopedUserGesture indicator(token);
63 EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture()); 64 EXPECT_TRUE(WebUserGestureIndicator::isProcessingUserGesture());
64 WebUserGestureIndicator::consumeUserGesture(); 65 WebUserGestureIndicator::consumeUserGesture();
65 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); 66 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture());
66 } 67 }
67 68
68 EXPECT_FALSE(token.hasGestures()); 69 EXPECT_FALSE(token.hasGestures());
69 70
70 { 71 {
71 WebScopedUserGesture indicator(token); 72 WebScopedUserGesture indicator(token);
72 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture()); 73 EXPECT_FALSE(WebUserGestureIndicator::isProcessingUserGesture());
73 } 74 }
74 75
75 EXPECT_TRUE(UserGestureIndicator::processedUserGestureSinceLoad()); 76 EXPECT_TRUE(UserGestureIndicator::processedUserGestureSinceLoad());
76 } 77 }
77 78
78 } // namespace blink 79 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebFrameTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698