| 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 <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 468 |
| 469 for (size_t i = 0; i < num_concurrent_decoders; i++) { | 469 for (size_t i = 0; i < num_concurrent_decoders; i++) { |
| 470 decoder_thread.task_runner()->PostTask( | 470 decoder_thread.task_runner()->PostTask( |
| 471 FROM_HERE, base::Bind(&JpegClient::DestroyJpegDecoder, | 471 FROM_HERE, base::Bind(&JpegClient::DestroyJpegDecoder, |
| 472 base::Unretained(clients[i]))); | 472 base::Unretained(clients[i]))); |
| 473 } | 473 } |
| 474 decoder_thread.Stop(); | 474 decoder_thread.Stop(); |
| 475 } | 475 } |
| 476 | 476 |
| 477 TEST_F(JpegDecodeAcceleratorTest, SimpleDecode) { | 477 TEST_F(JpegDecodeAcceleratorTest, SimpleDecode) { |
| 478 for (const auto& image : g_env->image_data_user_) { | 478 for (auto* image : g_env->image_data_user_) { |
| 479 test_image_files_.push_back(image); | 479 test_image_files_.push_back(image); |
| 480 expected_status_.push_back(CS_DECODE_PASS); | 480 expected_status_.push_back(CS_DECODE_PASS); |
| 481 } | 481 } |
| 482 TestDecode(1); | 482 TestDecode(1); |
| 483 } | 483 } |
| 484 | 484 |
| 485 TEST_F(JpegDecodeAcceleratorTest, MultipleDecoders) { | 485 TEST_F(JpegDecodeAcceleratorTest, MultipleDecoders) { |
| 486 for (const auto& image : g_env->image_data_user_) { | 486 for (auto* image : g_env->image_data_user_) { |
| 487 test_image_files_.push_back(image); | 487 test_image_files_.push_back(image); |
| 488 expected_status_.push_back(CS_DECODE_PASS); | 488 expected_status_.push_back(CS_DECODE_PASS); |
| 489 } | 489 } |
| 490 TestDecode(3); | 490 TestDecode(3); |
| 491 } | 491 } |
| 492 | 492 |
| 493 TEST_F(JpegDecodeAcceleratorTest, InputSizeChange) { | 493 TEST_F(JpegDecodeAcceleratorTest, InputSizeChange) { |
| 494 // The size of |image_data_1280x720_black_| is smaller than | 494 // The size of |image_data_1280x720_black_| is smaller than |
| 495 // |image_data_1280x720_default_|. | 495 // |image_data_1280x720_default_|. |
| 496 test_image_files_.push_back(g_env->image_data_1280x720_black_.get()); | 496 test_image_files_.push_back(g_env->image_data_1280x720_black_.get()); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 569 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
| 570 media::VaapiWrapper::PreSandboxInitialization(); | 570 media::VaapiWrapper::PreSandboxInitialization(); |
| 571 #endif | 571 #endif |
| 572 | 572 |
| 573 media::g_env = reinterpret_cast<media::JpegDecodeAcceleratorTestEnvironment*>( | 573 media::g_env = reinterpret_cast<media::JpegDecodeAcceleratorTestEnvironment*>( |
| 574 testing::AddGlobalTestEnvironment( | 574 testing::AddGlobalTestEnvironment( |
| 575 new media::JpegDecodeAcceleratorTestEnvironment(jpeg_filenames))); | 575 new media::JpegDecodeAcceleratorTestEnvironment(jpeg_filenames))); |
| 576 | 576 |
| 577 return RUN_ALL_TESTS(); | 577 return RUN_ALL_TESTS(); |
| 578 } | 578 } |
| OLD | NEW |