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

Side by Side Diff: content/browser/renderer_host/media/video_capture_controller_unittest.cc

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mock gpu video accelerator factory Created 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Unit test for VideoCaptureController. 5 // Unit test for VideoCaptureController.
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 DoBufferDestroyed(id); 79 DoBufferDestroyed(id);
80 } 80 }
81 void OnBufferReady(VideoCaptureControllerID id, 81 void OnBufferReady(VideoCaptureControllerID id,
82 int buffer_id, 82 int buffer_id,
83 const scoped_refptr<media::VideoFrame>& frame, 83 const scoped_refptr<media::VideoFrame>& frame,
84 const base::TimeTicks& timestamp) override { 84 const base::TimeTicks& timestamp) override {
85 if (!frame->HasTextures()) { 85 if (!frame->HasTextures()) {
86 EXPECT_EQ(frame->format(), media::PIXEL_FORMAT_I420); 86 EXPECT_EQ(frame->format(), media::PIXEL_FORMAT_I420);
87 DoI420BufferReady(id, frame->coded_size()); 87 DoI420BufferReady(id, frame->coded_size());
88 base::ThreadTaskRunnerHandle::Get()->PostTask( 88 base::ThreadTaskRunnerHandle::Get()->PostTask(
89 FROM_HERE, base::Bind(&VideoCaptureController::ReturnBuffer, 89 FROM_HERE,
90 base::Unretained(controller_), id, this, 90 base::Bind(&VideoCaptureController::ReturnBuffer,
91 buffer_id, 0, resource_utilization_)); 91 base::Unretained(controller_), id, this, buffer_id, 0,
92 gpu::SyncToken(), resource_utilization_));
92 } else { 93 } else {
93 EXPECT_EQ(frame->format(), media::PIXEL_FORMAT_ARGB); 94 EXPECT_EQ(frame->format(), media::PIXEL_FORMAT_ARGB);
94 DoTextureBufferReady(id, frame->coded_size()); 95 DoTextureBufferReady(id, frame->coded_size());
95 base::ThreadTaskRunnerHandle::Get()->PostTask( 96 base::ThreadTaskRunnerHandle::Get()->PostTask(
96 FROM_HERE, base::Bind(&VideoCaptureController::ReturnBuffer, 97 FROM_HERE, base::Bind(&VideoCaptureController::ReturnBuffer,
97 base::Unretained(controller_), id, this, 98 base::Unretained(controller_), id, this,
98 buffer_id, frame->mailbox_holder(0).sync_point, 99 buffer_id, frame->mailbox_holder(0).sync_point,
100 frame->mailbox_holder(0).sync_token,
99 resource_utilization_)); 101 resource_utilization_));
100 } 102 }
101 } 103 }
102 void OnEnded(VideoCaptureControllerID id) override { 104 void OnEnded(VideoCaptureControllerID id) override {
103 DoEnded(id); 105 DoEnded(id);
104 // OnEnded() must respond by (eventually) unregistering the client. 106 // OnEnded() must respond by (eventually) unregistering the client.
105 base::ThreadTaskRunnerHandle::Get()->PostTask( 107 base::ThreadTaskRunnerHandle::Get()->PostTask(
106 FROM_HERE, 108 FROM_HERE,
107 base::Bind(base::IgnoreResult(&VideoCaptureController::RemoveClient), 109 base::Bind(base::IgnoreResult(&VideoCaptureController::RemoveClient),
108 base::Unretained(controller_), id, this)); 110 base::Unretained(controller_), id, this));
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 664
663 // Second client connects after the error state. It also should get told of 665 // Second client connects after the error state. It also should get told of
664 // the error. 666 // the error.
665 EXPECT_CALL(*client_b_, DoError(route_id)).Times(1); 667 EXPECT_CALL(*client_b_, DoError(route_id)).Times(1);
666 controller_->AddClient( 668 controller_->AddClient(
667 route_id, client_b_.get(), base::kNullProcessHandle, 200, session_200); 669 route_id, client_b_.get(), base::kNullProcessHandle, 200, session_200);
668 Mock::VerifyAndClearExpectations(client_b_.get()); 670 Mock::VerifyAndClearExpectations(client_b_.get());
669 } 671 }
670 672
671 } // namespace content 673 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698