|
23 | 23 |
|
24 | 24 | #include <gmock/gmock.h> |
25 | 25 | #include <gtest/gtest.h> |
26 | | -#include <gui/DisplayEventReceiver.h> |
27 | 26 | #include <log/log.h> |
28 | 27 | #include <scheduler/VsyncConfig.h> |
29 | 28 | #include <utils/Errors.h> |
@@ -112,8 +111,6 @@ class EventThreadTest : public testing::Test, public IEventThreadCallback { |
112 | 111 | void expectOnExpectedPresentTimePosted(nsecs_t expectedPresentTime); |
113 | 112 | void expectUidFrameRateMappingEventReceivedByConnection(PhysicalDisplayId expectedDisplayId, |
114 | 113 | std::vector<FrameRateOverride>); |
115 | | - void expectQueuedBufferCountReceivedByConnection( |
116 | | - ConnectionEventRecorder& connectionEventRecorder, uint32_t expectedBufferCount); |
117 | 114 |
|
118 | 115 | void onVSyncEvent(nsecs_t timestamp, nsecs_t expectedPresentationTime, |
119 | 116 | nsecs_t deadlineTimestamp) { |
@@ -147,7 +144,6 @@ class EventThreadTest : public testing::Test, public IEventThreadCallback { |
147 | 144 | sp<MockEventThreadConnection> mConnection; |
148 | 145 | sp<MockEventThreadConnection> mThrottledConnection; |
149 | 146 | std::unique_ptr<frametimeline::impl::TokenManager> mTokenManager; |
150 | | - std::vector<ConnectionEventRecorder*> mBufferStuffedConnectionRecorders; |
151 | 147 |
|
152 | 148 | std::chrono::nanoseconds mVsyncPeriod; |
153 | 149 |
|
@@ -380,14 +376,6 @@ void EventThreadTest::expectUidFrameRateMappingEventReceivedByConnection( |
380 | 376 | EXPECT_EQ(expectedDisplayId, event.header.displayId); |
381 | 377 | } |
382 | 378 |
|
383 | | -void EventThreadTest::expectQueuedBufferCountReceivedByConnection( |
384 | | - ConnectionEventRecorder& connectionEventRecorder, uint32_t expectedBufferCount) { |
385 | | - auto args = connectionEventRecorder.waitForCall(); |
386 | | - ASSERT_TRUE(args.has_value()); |
387 | | - const auto& event = std::get<0>(args.value()); |
388 | | - EXPECT_EQ(expectedBufferCount, event.vsync.vsyncData.numberQueuedBuffers); |
389 | | -} |
390 | | - |
391 | 379 | namespace { |
392 | 380 |
|
393 | 381 | using namespace testing; |
@@ -880,63 +868,6 @@ TEST_F(EventThreadTest, postHcpLevelsChanged) { |
880 | 868 | EXPECT_EQ(HDCP_V2, event.hdcpLevelsChange.maxLevel); |
881 | 869 | } |
882 | 870 |
|
883 | | -TEST_F(EventThreadTest, connectionReceivesBufferStuffing) { |
884 | | - setupEventThread(); |
885 | | - |
886 | | - // Create a connection that will experience buffer stuffing. |
887 | | - ConnectionEventRecorder stuffedConnectionEventRecorder{0}; |
888 | | - sp<MockEventThreadConnection> stuffedConnection = |
889 | | - createConnection(stuffedConnectionEventRecorder, |
890 | | - gui::ISurfaceComposer::EventRegistration::modeChanged | |
891 | | - gui::ISurfaceComposer::EventRegistration::frameRateOverride, |
892 | | - 111); |
893 | | - |
894 | | - // Add a connection and buffer count to the list of stuffed Uids that will receive |
895 | | - // data in the next vsync event. |
896 | | - BufferStuffingMap bufferStuffedUids; |
897 | | - bufferStuffedUids.try_emplace(stuffedConnection->mOwnerUid, 3); |
898 | | - mThread->addBufferStuffedUids(bufferStuffedUids); |
899 | | - mBufferStuffedConnectionRecorders.emplace_back(&stuffedConnectionEventRecorder); |
900 | | - |
901 | | - // Signal that we want the next vsync event to be posted to two connections. |
902 | | - mThread->requestNextVsync(mConnection); |
903 | | - mThread->requestNextVsync(stuffedConnection); |
904 | | - onVSyncEvent(123, 456, 789); |
905 | | - |
906 | | - // Vsync event data contains number of queued buffers. |
907 | | - expectQueuedBufferCountReceivedByConnection(mConnectionEventCallRecorder, 0); |
908 | | - expectQueuedBufferCountReceivedByConnection(stuffedConnectionEventRecorder, 3); |
909 | | -} |
910 | | - |
911 | | -TEST_F(EventThreadTest, connectionsWithSameUidReceiveBufferStuffing) { |
912 | | - setupEventThread(); |
913 | | - |
914 | | - // Create a connection with the same Uid as another connection. |
915 | | - ConnectionEventRecorder secondConnectionEventRecorder{0}; |
916 | | - sp<MockEventThreadConnection> secondConnection = |
917 | | - createConnection(secondConnectionEventRecorder, |
918 | | - gui::ISurfaceComposer::EventRegistration::modeChanged | |
919 | | - gui::ISurfaceComposer::EventRegistration::frameRateOverride, |
920 | | - mConnectionUid); |
921 | | - |
922 | | - // Add connection Uid and buffer count to the list of stuffed Uids that will receive |
923 | | - // data in the next vsync event. |
924 | | - BufferStuffingMap bufferStuffedUids; |
925 | | - bufferStuffedUids.try_emplace(mConnectionUid, 3); |
926 | | - mThread->addBufferStuffedUids(bufferStuffedUids); |
927 | | - mBufferStuffedConnectionRecorders.emplace_back(&mConnectionEventCallRecorder); |
928 | | - mBufferStuffedConnectionRecorders.emplace_back(&secondConnectionEventRecorder); |
929 | | - |
930 | | - // Signal that we want the next vsync event to be posted to two connections. |
931 | | - mThread->requestNextVsync(mConnection); |
932 | | - mThread->requestNextVsync(secondConnection); |
933 | | - onVSyncEvent(123, 456, 789); |
934 | | - |
935 | | - // Vsync event data contains number of queued buffers. |
936 | | - expectQueuedBufferCountReceivedByConnection(mConnectionEventCallRecorder, 3); |
937 | | - expectQueuedBufferCountReceivedByConnection(secondConnectionEventRecorder, 3); |
938 | | -} |
939 | | - |
940 | 871 | } // namespace |
941 | 872 | } // namespace android |
942 | 873 |
|
|
0 commit comments