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

Side by Side Diff: media/base/test_helpers.cc

Issue 416333011: Allow setContentDecryptionModule() to get called when setting is done. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ReportCallback Created 6 years, 4 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 #include "media/base/test_helpers.h" 5 #include "media/base/test_helpers.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 std::string header; 235 std::string header;
236 int width = 0; 236 int width = 0;
237 int height = 0; 237 int height = 0;
238 bool success = pickle.ReadString(&header) && pickle.ReadInt(&width) && 238 bool success = pickle.ReadString(&header) && pickle.ReadInt(&width) &&
239 pickle.ReadInt(&height); 239 pickle.ReadInt(&height);
240 return (success && header == kFakeVideoBufferHeader && 240 return (success && header == kFakeVideoBufferHeader &&
241 width == config.coded_size().width() && 241 width == config.coded_size().width() &&
242 height == config.coded_size().height()); 242 height == config.coded_size().height());
243 } 243 }
244 244
245 MatchingCallbackVerifier::MatchingCallbackVerifier() : expecting_b_(false) {
246 }
247
248 MatchingCallbackVerifier::~MatchingCallbackVerifier() {
249 EXPECT_FALSE(expecting_b_);
250 }
251
252 void MatchingCallbackVerifier::RecordACalled() {
253 EXPECT_FALSE(expecting_b_);
254 expecting_b_ = true;
255 }
256
257 void MatchingCallbackVerifier::RecordBCalled() {
258 EXPECT_TRUE(expecting_b_);
259 expecting_b_ = false;
260 }
261
245 } // namespace media 262 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698