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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLVideoElementTest.cpp

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Re-add dropped null check Created 4 years, 1 month 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/dom/DocumentUserGestureToken.h"
8 #include "core/loader/EmptyClients.h" 9 #include "core/loader/EmptyClients.h"
9 #include "core/page/NetworkStateNotifier.h" 10 #include "core/page/NetworkStateNotifier.h"
10 #include "core/testing/DummyPageHolder.h" 11 #include "core/testing/DummyPageHolder.h"
11 #include "platform/UserGestureIndicator.h" 12 #include "platform/UserGestureIndicator.h"
12 #include "platform/testing/UnitTestHelpers.h" 13 #include "platform/testing/UnitTestHelpers.h"
13 #include "public/platform/WebMediaPlayer.h" 14 #include "public/platform/WebMediaPlayer.h"
14 #include "public/platform/WebSize.h" 15 #include "public/platform/WebSize.h"
15 #include "testing/gmock/include/gmock/gmock.h" 16 #include "testing/gmock/include/gmock/gmock.h"
16 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
17 #include "wtf/PtrUtil.h" 18 #include "wtf/PtrUtil.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // On play, the strategy is set to normal. 133 // On play, the strategy is set to normal.
133 EXPECT_CALL(*player, 134 EXPECT_CALL(*player,
134 setBufferingStrategy(WebMediaPlayer::BufferingStrategy::Normal)); 135 setBufferingStrategy(WebMediaPlayer::BufferingStrategy::Normal));
135 m_video->play(); 136 m_video->play();
136 ::testing::Mock::VerifyAndClearExpectations(player); 137 ::testing::Mock::VerifyAndClearExpectations(player);
137 138
138 // On a user pause, the strategy is set to aggressive. 139 // On a user pause, the strategy is set to aggressive.
139 EXPECT_CALL(*player, setBufferingStrategy( 140 EXPECT_CALL(*player, setBufferingStrategy(
140 WebMediaPlayer::BufferingStrategy::Aggressive)); 141 WebMediaPlayer::BufferingStrategy::Aggressive));
141 { 142 {
142 UserGestureIndicator gesture(UserGestureToken::create()); 143 UserGestureIndicator gesture(
144 DocumentUserGestureToken::create(&m_video->document()));
143 m_video->pause(); 145 m_video->pause();
144 } 146 }
145 ::testing::Mock::VerifyAndClearExpectations(player); 147 ::testing::Mock::VerifyAndClearExpectations(player);
146 148
147 // On play, the strategy is set to normal. 149 // On play, the strategy is set to normal.
148 EXPECT_CALL(*player, 150 EXPECT_CALL(*player,
149 setBufferingStrategy(WebMediaPlayer::BufferingStrategy::Normal)); 151 setBufferingStrategy(WebMediaPlayer::BufferingStrategy::Normal));
150 m_video->play(); 152 m_video->play();
151 ::testing::Mock::VerifyAndClearExpectations(player); 153 ::testing::Mock::VerifyAndClearExpectations(player);
152 } 154 }
153 155
154 } // namespace blink 156 } // 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