| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 } | 493 } |
| 494 } | 494 } |
| 495 | 495 |
| 496 TEST(VideoFrameMetadata, PassMetadataViaIntermediary) { | 496 TEST(VideoFrameMetadata, PassMetadataViaIntermediary) { |
| 497 VideoFrameMetadata expected; | 497 VideoFrameMetadata expected; |
| 498 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) { | 498 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) { |
| 499 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i); | 499 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i); |
| 500 expected.SetInteger(key, i); | 500 expected.SetInteger(key, i); |
| 501 } | 501 } |
| 502 | 502 |
| 503 base::DictionaryValue tmp; | |
| 504 expected.MergeInternalValuesInto(&tmp); | |
| 505 EXPECT_EQ(static_cast<size_t>(VideoFrameMetadata::NUM_KEYS), tmp.size()); | |
| 506 | |
| 507 VideoFrameMetadata result; | 503 VideoFrameMetadata result; |
| 508 result.MergeInternalValuesFrom(tmp); | 504 result.MergeMetadataFrom(&expected); |
| 509 | 505 |
| 510 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) { | 506 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) { |
| 511 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i); | 507 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i); |
| 512 int value = -1; | 508 int value = -1; |
| 513 EXPECT_TRUE(result.GetInteger(key, &value)); | 509 EXPECT_TRUE(result.GetInteger(key, &value)); |
| 514 EXPECT_EQ(i, value); | 510 EXPECT_EQ(i, value); |
| 515 } | 511 } |
| 516 } | 512 } |
| 517 | 513 |
| 518 } // namespace media | 514 } // namespace media |
| OLD | NEW |