OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // This has to be included first. | 5 // This has to be included first. |
6 // See http://code.google.com/p/googletest/issues/detail?id=371 | 6 // See http://code.google.com/p/googletest/issues/detail?id=371 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 ASSERT_NO_FATAL_FAILURE( | 368 ASSERT_NO_FATAL_FAILURE( |
369 ReadTestJpegImage(default_jpeg_file, image_data_1280x720_default_.get())); | 369 ReadTestJpegImage(default_jpeg_file, image_data_1280x720_default_.get())); |
370 | 370 |
371 image_data_invalid_.reset(new TestImageFile("failure.jpg")); | 371 image_data_invalid_.reset(new TestImageFile("failure.jpg")); |
372 image_data_invalid_->data_str.resize(100, 0); | 372 image_data_invalid_->data_str.resize(100, 0); |
373 image_data_invalid_->visible_size.SetSize(1280, 720); | 373 image_data_invalid_->visible_size.SetSize(1280, 720); |
374 image_data_invalid_->output_size = media::VideoFrame::AllocationSize( | 374 image_data_invalid_->output_size = media::VideoFrame::AllocationSize( |
375 media::PIXEL_FORMAT_I420, image_data_invalid_->visible_size); | 375 media::PIXEL_FORMAT_I420, image_data_invalid_->visible_size); |
376 | 376 |
377 // |user_jpeg_filenames_| may include many files and use ';' as delimiter. | 377 // |user_jpeg_filenames_| may include many files and use ';' as delimiter. |
378 std::vector<base::FilePath::StringType> filenames; | 378 std::vector<base::FilePath::StringType> filenames = base::SplitString( |
379 base::SplitString(user_jpeg_filenames_, ';', &filenames); | 379 user_jpeg_filenames_, base::FilePath::StringType(1, ';'), |
| 380 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
380 for (const auto& filename : filenames) { | 381 for (const auto& filename : filenames) { |
381 base::FilePath input_file = media::GetTestDataFilePath(filename); | 382 base::FilePath input_file = media::GetTestDataFilePath(filename); |
382 TestImageFile* image_data = new TestImageFile(filename); | 383 TestImageFile* image_data = new TestImageFile(filename); |
383 ASSERT_NO_FATAL_FAILURE(ReadTestJpegImage(input_file, image_data)); | 384 ASSERT_NO_FATAL_FAILURE(ReadTestJpegImage(input_file, image_data)); |
384 image_data_user_.push_back(image_data); | 385 image_data_user_.push_back(image_data); |
385 } | 386 } |
386 } | 387 } |
387 | 388 |
388 void JpegDecodeAcceleratorTestEnvironment::TearDown() { | 389 void JpegDecodeAcceleratorTestEnvironment::TearDown() { |
389 base::DeleteFile(test_1280x720_jpeg_file_, false); | 390 base::DeleteFile(test_1280x720_jpeg_file_, false); |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 #endif | 573 #endif |
573 | 574 |
574 content::g_env = | 575 content::g_env = |
575 reinterpret_cast<content::JpegDecodeAcceleratorTestEnvironment*>( | 576 reinterpret_cast<content::JpegDecodeAcceleratorTestEnvironment*>( |
576 testing::AddGlobalTestEnvironment( | 577 testing::AddGlobalTestEnvironment( |
577 new content::JpegDecodeAcceleratorTestEnvironment( | 578 new content::JpegDecodeAcceleratorTestEnvironment( |
578 jpeg_filenames))); | 579 jpeg_filenames))); |
579 | 580 |
580 return RUN_ALL_TESTS(); | 581 return RUN_ALL_TESTS(); |
581 } | 582 } |
OLD | NEW |