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

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

Issue 1909263002: Replace safe-bool idiom with explicit WeakPtr::operator bool() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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 (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 VideoCaptureManager. 5 // Unit test for VideoCaptureManager.
6 6
7 #include "content/browser/renderer_host/media/video_capture_manager.h" 7 #include "content/browser/renderer_host/media/video_capture_manager.h"
8 8
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 void OnGotControllerCallback( 99 void OnGotControllerCallback(
100 VideoCaptureControllerID id, 100 VideoCaptureControllerID id,
101 base::Closure quit_closure, 101 base::Closure quit_closure,
102 bool expect_success, 102 bool expect_success,
103 const base::WeakPtr<VideoCaptureController>& controller) { 103 const base::WeakPtr<VideoCaptureController>& controller) {
104 if (expect_success) { 104 if (expect_success) {
105 ASSERT_TRUE(controller); 105 ASSERT_TRUE(controller);
106 ASSERT_TRUE(0 == controllers_.count(id)); 106 ASSERT_TRUE(0 == controllers_.count(id));
107 controllers_[id] = controller.get(); 107 controllers_[id] = controller.get();
108 } else { 108 } else {
109 ASSERT_TRUE(NULL == controller); 109 ASSERT_FALSE(controller);
110 } 110 }
111 quit_closure.Run(); 111 quit_closure.Run();
112 } 112 }
113 113
114 VideoCaptureControllerID StartClient(int session_id, bool expect_success) { 114 VideoCaptureControllerID StartClient(int session_id, bool expect_success) {
115 media::VideoCaptureParams params; 115 media::VideoCaptureParams params;
116 params.requested_format = media::VideoCaptureFormat( 116 params.requested_format = media::VideoCaptureFormat(
117 gfx::Size(320, 240), 30, media::PIXEL_FORMAT_I420); 117 gfx::Size(320, 240), 30, media::PIXEL_FORMAT_I420);
118 118
119 VideoCaptureControllerID client_id(next_client_id_++); 119 VideoCaptureControllerID client_id(next_client_id_++);
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 570
571 // Wait to check callbacks before removing the listener. 571 // Wait to check callbacks before removing the listener.
572 message_loop_->RunUntilIdle(); 572 message_loop_->RunUntilIdle();
573 vcm_->Unregister(); 573 vcm_->Unregister();
574 } 574 }
575 575
576 // TODO(mcasas): Add a test to check consolidation of the supported formats 576 // TODO(mcasas): Add a test to check consolidation of the supported formats
577 // provided by the device when http://crbug.com/323913 is closed. 577 // provided by the device when http://crbug.com/323913 is closed.
578 578
579 } // namespace content 579 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698