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

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

Issue 1129083003: More base::Values-related bare pointer -> scoped_ptr conversions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad merge Created 5 years, 7 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 | « ipc/ipc_message_utils.cc ('k') | tools/json_schema_compiler/test/error_generation_unittest.cc » ('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 (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/video_frame.h" 5 #include "media/base/video_frame.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/memory/aligned_memory.h" 10 #include "base/memory/aligned_memory.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 379
380 EXPECT_FALSE(metadata.HasKey(key)); 380 EXPECT_FALSE(metadata.HasKey(key));
381 metadata.SetTimeTicks(key, base::TimeTicks::FromInternalValue(~(0LL) + i)); 381 metadata.SetTimeTicks(key, base::TimeTicks::FromInternalValue(~(0LL) + i));
382 EXPECT_TRUE(metadata.HasKey(key)); 382 EXPECT_TRUE(metadata.HasKey(key));
383 base::TimeTicks ticks_value; 383 base::TimeTicks ticks_value;
384 EXPECT_TRUE(metadata.GetTimeTicks(key, &ticks_value)); 384 EXPECT_TRUE(metadata.GetTimeTicks(key, &ticks_value));
385 EXPECT_EQ(base::TimeTicks::FromInternalValue(~(0LL) + i), ticks_value); 385 EXPECT_EQ(base::TimeTicks::FromInternalValue(~(0LL) + i), ticks_value);
386 metadata.Clear(); 386 metadata.Clear();
387 387
388 EXPECT_FALSE(metadata.HasKey(key)); 388 EXPECT_FALSE(metadata.HasKey(key));
389 metadata.SetValue(key, 389 metadata.SetValue(key, base::Value::CreateNullValue());
390 scoped_ptr<base::Value>(base::Value::CreateNullValue()));
391 EXPECT_TRUE(metadata.HasKey(key)); 390 EXPECT_TRUE(metadata.HasKey(key));
392 const base::Value* const null_value = metadata.GetValue(key); 391 const base::Value* const null_value = metadata.GetValue(key);
393 EXPECT_TRUE(null_value); 392 EXPECT_TRUE(null_value);
394 EXPECT_EQ(base::Value::TYPE_NULL, null_value->GetType()); 393 EXPECT_EQ(base::Value::TYPE_NULL, null_value->GetType());
395 metadata.Clear(); 394 metadata.Clear();
396 } 395 }
397 } 396 }
398 397
399 TEST(VideoFrameMetadata, PassMetadataViaIntermediary) { 398 TEST(VideoFrameMetadata, PassMetadataViaIntermediary) {
400 VideoFrameMetadata expected; 399 VideoFrameMetadata expected;
(...skipping 11 matching lines...) Expand all
412 411
413 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) { 412 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) {
414 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i); 413 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i);
415 int value = -1; 414 int value = -1;
416 EXPECT_TRUE(result.GetInteger(key, &value)); 415 EXPECT_TRUE(result.GetInteger(key, &value));
417 EXPECT_EQ(i, value); 416 EXPECT_EQ(i, value);
418 } 417 }
419 } 418 }
420 419
421 } // namespace media 420 } // namespace media
OLDNEW
« no previous file with comments | « ipc/ipc_message_utils.cc ('k') | tools/json_schema_compiler/test/error_generation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698