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

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

Issue 2380673002: Clean up code to use VideoFrameMetadata::MergeMetadataFrom() when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up code to use VideoFrameMetadata::MergeMetadataFrom() when appropriate. Created 4 years, 2 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/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
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
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_ms_compositor.cc ('k') | media/renderers/skcanvas_video_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698