| OLD | NEW |
| 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 372 |
| 373 EXPECT_FALSE(metadata.HasKey(key)); | 373 EXPECT_FALSE(metadata.HasKey(key)); |
| 374 metadata.SetString(key, base::StringPrintf("\xfe%d\xff", i)); | 374 metadata.SetString(key, base::StringPrintf("\xfe%d\xff", i)); |
| 375 EXPECT_TRUE(metadata.HasKey(key)); | 375 EXPECT_TRUE(metadata.HasKey(key)); |
| 376 std::string string_value; | 376 std::string string_value; |
| 377 EXPECT_TRUE(metadata.GetString(key, &string_value)); | 377 EXPECT_TRUE(metadata.GetString(key, &string_value)); |
| 378 EXPECT_EQ(base::StringPrintf("\xfe%d\xff", i), string_value); | 378 EXPECT_EQ(base::StringPrintf("\xfe%d\xff", i), string_value); |
| 379 metadata.Clear(); | 379 metadata.Clear(); |
| 380 | 380 |
| 381 EXPECT_FALSE(metadata.HasKey(key)); | 381 EXPECT_FALSE(metadata.HasKey(key)); |
| 382 metadata.SetTimeDelta(key, base::TimeDelta::FromInternalValue(42 + i)); |
| 383 EXPECT_TRUE(metadata.HasKey(key)); |
| 384 base::TimeDelta delta_value; |
| 385 EXPECT_TRUE(metadata.GetTimeDelta(key, &delta_value)); |
| 386 EXPECT_EQ(base::TimeDelta::FromInternalValue(42 + i), delta_value); |
| 387 metadata.Clear(); |
| 388 |
| 389 EXPECT_FALSE(metadata.HasKey(key)); |
| 382 metadata.SetTimeTicks(key, base::TimeTicks::FromInternalValue(~(0LL) + i)); | 390 metadata.SetTimeTicks(key, base::TimeTicks::FromInternalValue(~(0LL) + i)); |
| 383 EXPECT_TRUE(metadata.HasKey(key)); | 391 EXPECT_TRUE(metadata.HasKey(key)); |
| 384 base::TimeTicks ticks_value; | 392 base::TimeTicks ticks_value; |
| 385 EXPECT_TRUE(metadata.GetTimeTicks(key, &ticks_value)); | 393 EXPECT_TRUE(metadata.GetTimeTicks(key, &ticks_value)); |
| 386 EXPECT_EQ(base::TimeTicks::FromInternalValue(~(0LL) + i), ticks_value); | 394 EXPECT_EQ(base::TimeTicks::FromInternalValue(~(0LL) + i), ticks_value); |
| 387 metadata.Clear(); | 395 metadata.Clear(); |
| 388 | 396 |
| 389 EXPECT_FALSE(metadata.HasKey(key)); | 397 EXPECT_FALSE(metadata.HasKey(key)); |
| 390 metadata.SetValue(key, base::Value::CreateNullValue()); | 398 metadata.SetValue(key, base::Value::CreateNullValue()); |
| 391 EXPECT_TRUE(metadata.HasKey(key)); | 399 EXPECT_TRUE(metadata.HasKey(key)); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 412 | 420 |
| 413 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) { | 421 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) { |
| 414 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i); | 422 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i); |
| 415 int value = -1; | 423 int value = -1; |
| 416 EXPECT_TRUE(result.GetInteger(key, &value)); | 424 EXPECT_TRUE(result.GetInteger(key, &value)); |
| 417 EXPECT_EQ(i, value); | 425 EXPECT_EQ(i, value); |
| 418 } | 426 } |
| 419 } | 427 } |
| 420 | 428 |
| 421 } // namespace media | 429 } // namespace media |
| OLD | NEW |