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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLVideoElementTest.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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "core/html/HTMLVideoElement.h" 5 #include "core/html/HTMLVideoElement.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/loader/EmptyClients.h" 8 #include "core/loader/EmptyClients.h"
9 #include "core/page/NetworkStateNotifier.h" 9 #include "core/page/NetworkStateNotifier.h"
10 #include "core/testing/DummyPageHolder.h" 10 #include "core/testing/DummyPageHolder.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // On play, the strategy is set to normal. 132 // On play, the strategy is set to normal.
133 EXPECT_CALL(*player, 133 EXPECT_CALL(*player,
134 setBufferingStrategy(WebMediaPlayer::BufferingStrategy::Normal)); 134 setBufferingStrategy(WebMediaPlayer::BufferingStrategy::Normal));
135 m_video->play(); 135 m_video->play();
136 ::testing::Mock::VerifyAndClearExpectations(player); 136 ::testing::Mock::VerifyAndClearExpectations(player);
137 137
138 // On a user pause, the strategy is set to aggressive. 138 // On a user pause, the strategy is set to aggressive.
139 EXPECT_CALL(*player, setBufferingStrategy( 139 EXPECT_CALL(*player, setBufferingStrategy(
140 WebMediaPlayer::BufferingStrategy::Aggressive)); 140 WebMediaPlayer::BufferingStrategy::Aggressive));
141 { 141 {
142 UserGestureIndicator gesture(DefinitelyProcessingUserGesture); 142 UserGestureIndicator gesture(UserGestureToken::create());
143 m_video->pause(); 143 m_video->pause();
144 } 144 }
145 ::testing::Mock::VerifyAndClearExpectations(player); 145 ::testing::Mock::VerifyAndClearExpectations(player);
146 146
147 // On play, the strategy is set to normal. 147 // On play, the strategy is set to normal.
148 EXPECT_CALL(*player, 148 EXPECT_CALL(*player,
149 setBufferingStrategy(WebMediaPlayer::BufferingStrategy::Normal)); 149 setBufferingStrategy(WebMediaPlayer::BufferingStrategy::Normal));
150 m_video->play(); 150 m_video->play();
151 ::testing::Mock::VerifyAndClearExpectations(player); 151 ::testing::Mock::VerifyAndClearExpectations(player);
152 } 152 }
153 153
154 } // namespace blink 154 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/AutoplayExperimentTest.cpp ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698