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

Side by Side Diff: media/gpu/avda_codec_allocator_unittest.cc

Issue 2692863011: Add ContentVideoViewOverlay to AVDA. (Closed)
Patch Set: fixed avda unittest Created 3 years, 9 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 | « media/gpu/avda_codec_allocator.cc ('k') | media/gpu/avda_picture_buffer_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "media/gpu/avda_codec_allocator.h" 5 #include "media/gpu/avda_codec_allocator.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 24 matching lines...) Expand all
35 if (about_to_wait_event) 35 if (about_to_wait_event)
36 about_to_wait_event->Signal(); 36 about_to_wait_event->Signal();
37 wait_event->Wait(); 37 wait_event->Wait();
38 } 38 }
39 39
40 void SignalImmediately(base::WaitableEvent* event) { 40 void SignalImmediately(base::WaitableEvent* event) {
41 event->Signal(); 41 event->Signal();
42 } 42 }
43 } 43 }
44 44
45 class MockClient : public AVDACodecAllocatorClient { 45 class MockClient : public AVDACodecAllocatorClient,
46 public AVDASurfaceAllocatorClient {
46 public: 47 public:
47 MOCK_METHOD1(OnSurfaceAvailable, void(bool success)); 48 MOCK_METHOD1(OnSurfaceAvailable, void(bool success));
48 MOCK_METHOD0(OnSurfaceDestroyed, void()); 49 MOCK_METHOD0(OnSurfaceDestroyed, void());
49 50
50 // Gmock doesn't let us mock methods taking move-only types. 51 // Gmock doesn't let us mock methods taking move-only types.
51 MOCK_METHOD1(OnCodecConfiguredMock, void(MediaCodecBridge* media_codec)); 52 MOCK_METHOD1(OnCodecConfiguredMock, void(MediaCodecBridge* media_codec));
52 void OnCodecConfigured( 53 void OnCodecConfigured(
53 std::unique_ptr<MediaCodecBridge> media_codec) override { 54 std::unique_ptr<MediaCodecBridge> media_codec) override {
54 OnCodecConfiguredMock(media_codec.get()); 55 OnCodecConfiguredMock(media_codec.get());
55 } 56 }
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 300
300 TEST_F(AVDACodecAllocatorTest, DeallocatingIsSafeDuringSurfaceDestroyed) { 301 TEST_F(AVDACodecAllocatorTest, DeallocatingIsSafeDuringSurfaceDestroyed) {
301 allocator2_->AllocateSurface(avda1_, 1); 302 allocator2_->AllocateSurface(avda1_, 1);
302 EXPECT_CALL(*avda1_, OnSurfaceDestroyed()).WillOnce(Invoke([=]() { 303 EXPECT_CALL(*avda1_, OnSurfaceDestroyed()).WillOnce(Invoke([=]() {
303 allocator2_->DeallocateSurface(avda1_, 1); 304 allocator2_->DeallocateSurface(avda1_, 1);
304 })); 305 }));
305 allocator2_->OnSurfaceDestroyed(1); 306 allocator2_->OnSurfaceDestroyed(1);
306 } 307 }
307 308
308 } // namespace media 309 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/avda_codec_allocator.cc ('k') | media/gpu/avda_picture_buffer_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698