| OLD | NEW |
| 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/files/file_util.h" | 8 #include "base/files/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" |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 test_stream_->requested_profile, | 659 test_stream_->requested_profile, |
| 660 base::Bind(&VEAClient::HandleEncodedFrame, base::Unretained(this))); | 660 base::Bind(&VEAClient::HandleEncodedFrame, base::Unretained(this))); |
| 661 | 661 |
| 662 CHECK(validator_.get()); | 662 CHECK(validator_.get()); |
| 663 | 663 |
| 664 if (save_to_file_) { | 664 if (save_to_file_) { |
| 665 CHECK(!test_stream_->out_filename.empty()); | 665 CHECK(!test_stream_->out_filename.empty()); |
| 666 base::FilePath out_filename(test_stream_->out_filename); | 666 base::FilePath out_filename(test_stream_->out_filename); |
| 667 // This creates or truncates out_filename. | 667 // This creates or truncates out_filename. |
| 668 // Without it, AppendToFile() will not work. | 668 // Without it, AppendToFile() will not work. |
| 669 EXPECT_EQ(0, base::WriteFile(out_filename, NULL, 0)); | 669 EXPECT_EQ(0, base::WriteFile(out_filename, nullptr, 0)); |
| 670 } | 670 } |
| 671 | 671 |
| 672 // Initialize the parameters of the test streams. | 672 // Initialize the parameters of the test streams. |
| 673 UpdateTestStreamData(mid_stream_bitrate_switch, mid_stream_framerate_switch); | 673 UpdateTestStreamData(mid_stream_bitrate_switch, mid_stream_framerate_switch); |
| 674 | 674 |
| 675 thread_checker_.DetachFromThread(); | 675 thread_checker_.DetachFromThread(); |
| 676 } | 676 } |
| 677 | 677 |
| 678 VEAClient::~VEAClient() { CHECK(!has_encoder()); } | 678 VEAClient::~VEAClient() { CHECK(!has_encoder()); } |
| 679 | 679 |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 content::g_env = | 1205 content::g_env = |
| 1206 reinterpret_cast<content::VideoEncodeAcceleratorTestEnvironment*>( | 1206 reinterpret_cast<content::VideoEncodeAcceleratorTestEnvironment*>( |
| 1207 testing::AddGlobalTestEnvironment( | 1207 testing::AddGlobalTestEnvironment( |
| 1208 new content::VideoEncodeAcceleratorTestEnvironment( | 1208 new content::VideoEncodeAcceleratorTestEnvironment( |
| 1209 test_stream_data.Pass()))); | 1209 test_stream_data.Pass()))); |
| 1210 | 1210 |
| 1211 return RUN_ALL_TESTS(); | 1211 return RUN_ALL_TESTS(); |
| 1212 } | 1212 } |
| OLD | NEW |