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

Side by Side Diff: content/common/gpu/media/video_encode_accelerator_unittest.cc

Issue 141113003: Refactor base/safe_numerics.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/memory_mapped_file.h" 9 #include "base/files/memory_mapped_file.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
11 #include "base/numerics/safe_conversions.h"
11 #include "base/process/process.h" 12 #include "base/process/process.h"
12 #include "base/safe_numerics.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/string_split.h" 14 #include "base/strings/string_split.h"
15 #include "content/common/gpu/media/exynos_video_encode_accelerator.h" 15 #include "content/common/gpu/media/exynos_video_encode_accelerator.h"
16 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" 16 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h"
17 #include "media/base/bind_to_current_loop.h" 17 #include "media/base/bind_to_current_loop.h"
18 #include "media/base/bitstream_buffer.h" 18 #include "media/base/bitstream_buffer.h"
19 #include "media/filters/h264_parser.h" 19 #include "media/filters/h264_parser.h"
20 #include "media/video/video_encode_accelerator.h" 20 #include "media/video/video_encode_accelerator.h"
21 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
22 22
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 encoded_stream_size_ += payload_size; 488 encoded_stream_size_ += payload_size;
489 489
490 const uint8* stream_ptr = static_cast<const uint8*>(shm->memory()); 490 const uint8* stream_ptr = static_cast<const uint8*>(shm->memory());
491 if (payload_size > 0) 491 if (payload_size > 0)
492 validator_->ProcessStreamBuffer(stream_ptr, payload_size); 492 validator_->ProcessStreamBuffer(stream_ptr, payload_size);
493 493
494 EXPECT_EQ(key_frame, seen_keyframe_in_this_buffer_); 494 EXPECT_EQ(key_frame, seen_keyframe_in_this_buffer_);
495 seen_keyframe_in_this_buffer_ = false; 495 seen_keyframe_in_this_buffer_ = false;
496 496
497 if (save_to_file_) { 497 if (save_to_file_) {
498 int size = base::checked_numeric_cast<int>(payload_size); 498 int size = base::checked_cast<int>(payload_size);
499 EXPECT_EQ(file_util::AppendToFile( 499 EXPECT_EQ(file_util::AppendToFile(
500 base::FilePath::FromUTF8Unsafe(test_stream_.out_filename), 500 base::FilePath::FromUTF8Unsafe(test_stream_.out_filename),
501 static_cast<char*>(shm->memory()), 501 static_cast<char*>(shm->memory()),
502 size), 502 size),
503 size); 503 size);
504 } 504 }
505 505
506 FeedEncoderWithOutput(shm); 506 FeedEncoderWithOutput(shm);
507 } 507 }
508 508
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 } 762 }
763 if (it->first == "v" || it->first == "vmodule") 763 if (it->first == "v" || it->first == "vmodule")
764 continue; 764 continue;
765 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; 765 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
766 } 766 }
767 767
768 base::ShadowingAtExitManager at_exit_manager; 768 base::ShadowingAtExitManager at_exit_manager;
769 769
770 return RUN_ALL_TESTS(); 770 return RUN_ALL_TESTS();
771 } 771 }
OLDNEW
« no previous file with comments | « content/common/child_process_sandbox_support_impl_linux.cc ('k') | content/renderer/media/rtc_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698