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 <inttypes.h> | 5 #include <inttypes.h> |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 0U) | 317 0U) |
318 << "Stream byte size is not a product of calculated frame byte size"; | 318 << "Stream byte size is not a product of calculated frame byte size"; |
319 CHECK_GT(test_stream->num_frames, 0UL); | 319 CHECK_GT(test_stream->num_frames, 0UL); |
320 } | 320 } |
321 | 321 |
322 // Parse |data| into its constituent parts, set the various output fields | 322 // Parse |data| into its constituent parts, set the various output fields |
323 // accordingly, read in video stream, and store them to |test_streams|. | 323 // accordingly, read in video stream, and store them to |test_streams|. |
324 static void ParseAndReadTestStreamData(const base::FilePath::StringType& data, | 324 static void ParseAndReadTestStreamData(const base::FilePath::StringType& data, |
325 ScopedVector<TestStream>* test_streams) { | 325 ScopedVector<TestStream>* test_streams) { |
326 // Split the string to individual test stream data. | 326 // Split the string to individual test stream data. |
327 std::vector<base::FilePath::StringType> test_streams_data = base::SplitString( | 327 std::vector<base::FilePath::StringType> test_streams_data; |
328 data, base::FilePath::StringType(1, ';'), | 328 base::SplitString(data, ';', &test_streams_data); |
329 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | |
330 CHECK_GE(test_streams_data.size(), 1U) << data; | 329 CHECK_GE(test_streams_data.size(), 1U) << data; |
331 | 330 |
332 // Parse each test stream data and read the input file. | 331 // Parse each test stream data and read the input file. |
333 for (size_t index = 0; index < test_streams_data.size(); ++index) { | 332 for (size_t index = 0; index < test_streams_data.size(); ++index) { |
334 std::vector<base::FilePath::StringType> fields = base::SplitString( | 333 std::vector<base::FilePath::StringType> fields; |
335 test_streams_data[index], base::FilePath::StringType(1, ':'), | 334 base::SplitString(test_streams_data[index], ':', &fields); |
336 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | |
337 CHECK_GE(fields.size(), 4U) << data; | 335 CHECK_GE(fields.size(), 4U) << data; |
338 CHECK_LE(fields.size(), 9U) << data; | 336 CHECK_LE(fields.size(), 9U) << data; |
339 TestStream* test_stream = new TestStream(); | 337 TestStream* test_stream = new TestStream(); |
340 | 338 |
341 test_stream->in_filename = fields[0]; | 339 test_stream->in_filename = fields[0]; |
342 int width, height; | 340 int width, height; |
343 CHECK(base::StringToInt(fields[1], &width)); | 341 CHECK(base::StringToInt(fields[1], &width)); |
344 CHECK(base::StringToInt(fields[2], &height)); | 342 CHECK(base::StringToInt(fields[2], &height)); |
345 test_stream->visible_size = gfx::Size(width, height); | 343 test_stream->visible_size = gfx::Size(width, height); |
346 CHECK(!test_stream->visible_size.IsEmpty()); | 344 CHECK(!test_stream->visible_size.IsEmpty()); |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1520 | 1518 |
1521 content::g_env = | 1519 content::g_env = |
1522 reinterpret_cast<content::VideoEncodeAcceleratorTestEnvironment*>( | 1520 reinterpret_cast<content::VideoEncodeAcceleratorTestEnvironment*>( |
1523 testing::AddGlobalTestEnvironment( | 1521 testing::AddGlobalTestEnvironment( |
1524 new content::VideoEncodeAcceleratorTestEnvironment( | 1522 new content::VideoEncodeAcceleratorTestEnvironment( |
1525 test_stream_data.Pass(), log_path, run_at_fps, | 1523 test_stream_data.Pass(), log_path, run_at_fps, |
1526 needs_encode_latency))); | 1524 needs_encode_latency))); |
1527 | 1525 |
1528 return RUN_ALL_TESTS(); | 1526 return RUN_ALL_TESTS(); |
1529 } | 1527 } |
OLD | NEW |