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

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

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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 | « media/base/video_frame_metadata.cc ('k') | media/cdm/aes_decryptor_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 <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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 base::TimeTicks ticks_value; 537 base::TimeTicks ticks_value;
538 EXPECT_TRUE(metadata.GetTimeTicks(key, &ticks_value)); 538 EXPECT_TRUE(metadata.GetTimeTicks(key, &ticks_value));
539 EXPECT_EQ(base::TimeTicks::FromInternalValue(~(0LL) + i), ticks_value); 539 EXPECT_EQ(base::TimeTicks::FromInternalValue(~(0LL) + i), ticks_value);
540 metadata.Clear(); 540 metadata.Clear();
541 541
542 EXPECT_FALSE(metadata.HasKey(key)); 542 EXPECT_FALSE(metadata.HasKey(key));
543 metadata.SetValue(key, base::Value::CreateNullValue()); 543 metadata.SetValue(key, base::Value::CreateNullValue());
544 EXPECT_TRUE(metadata.HasKey(key)); 544 EXPECT_TRUE(metadata.HasKey(key));
545 const base::Value* const null_value = metadata.GetValue(key); 545 const base::Value* const null_value = metadata.GetValue(key);
546 EXPECT_TRUE(null_value); 546 EXPECT_TRUE(null_value);
547 EXPECT_EQ(base::Value::TYPE_NULL, null_value->GetType()); 547 EXPECT_EQ(base::Value::Type::NONE, null_value->GetType());
548 metadata.Clear(); 548 metadata.Clear();
549 } 549 }
550 } 550 }
551 551
552 TEST(VideoFrameMetadata, PassMetadataViaIntermediary) { 552 TEST(VideoFrameMetadata, PassMetadataViaIntermediary) {
553 VideoFrameMetadata expected; 553 VideoFrameMetadata expected;
554 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) { 554 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) {
555 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i); 555 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i);
556 expected.SetInteger(key, i); 556 expected.SetInteger(key, i);
557 } 557 }
558 558
559 VideoFrameMetadata result; 559 VideoFrameMetadata result;
560 result.MergeMetadataFrom(&expected); 560 result.MergeMetadataFrom(&expected);
561 561
562 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) { 562 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) {
563 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i); 563 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i);
564 int value = -1; 564 int value = -1;
565 EXPECT_TRUE(result.GetInteger(key, &value)); 565 EXPECT_TRUE(result.GetInteger(key, &value));
566 EXPECT_EQ(i, value); 566 EXPECT_EQ(i, value);
567 } 567 }
568 } 568 }
569 569
570 } // namespace media 570 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_frame_metadata.cc ('k') | media/cdm/aes_decryptor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698