| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <stdint.h> |
| 6 |
| 5 #include "content/test/image_decoder_test.h" | 7 #include "content/test/image_decoder_test.h" |
| 6 #include "third_party/WebKit/public/web/WebImageDecoder.h" | 8 #include "third_party/WebKit/public/web/WebImageDecoder.h" |
| 7 | 9 |
| 8 class BMPImageDecoderTest : public ImageDecoderTest { | 10 class BMPImageDecoderTest : public ImageDecoderTest { |
| 9 public: | 11 public: |
| 10 BMPImageDecoderTest() : ImageDecoderTest("bmp") { } | 12 BMPImageDecoderTest() : ImageDecoderTest("bmp") { } |
| 11 | 13 |
| 12 protected: | 14 protected: |
| 13 blink::WebImageDecoder* CreateWebKitImageDecoder() const override { | 15 blink::WebImageDecoder* CreateWebKitImageDecoder() const override { |
| 14 return new blink::WebImageDecoder(blink::WebImageDecoder::TypeBMP); | 16 return new blink::WebImageDecoder(blink::WebImageDecoder::TypeBMP); |
| 15 } | 17 } |
| 16 | 18 |
| 17 // The BMPImageDecoderTest tests are really slow under Valgrind. | 19 // The BMPImageDecoderTest tests are really slow under Valgrind. |
| 18 // Thus it is split into fast and slow versions. The threshold is | 20 // Thus it is split into fast and slow versions. The threshold is |
| 19 // set to 10KB because the fast test can finish under Valgrind in | 21 // set to 10KB because the fast test can finish under Valgrind in |
| 20 // less than 30 seconds. | 22 // less than 30 seconds. |
| 21 static const int64 kThresholdSize = 10240; | 23 static const int64_t kThresholdSize = 10240; |
| 22 }; | 24 }; |
| 23 | 25 |
| 24 TEST_F(BMPImageDecoderTest, DecodingFast) { | 26 TEST_F(BMPImageDecoderTest, DecodingFast) { |
| 25 TestDecoding(TEST_SMALLER, kThresholdSize); | 27 TestDecoding(TEST_SMALLER, kThresholdSize); |
| 26 } | 28 } |
| 27 | 29 |
| 28 #if defined(THREAD_SANITIZER) | 30 #if defined(THREAD_SANITIZER) |
| 29 // BMPImageDecoderTest.DecodingSlow always times out under ThreadSanitizer v2. | 31 // BMPImageDecoderTest.DecodingSlow always times out under ThreadSanitizer v2. |
| 30 #define MAYBE_DecodingSlow DISABLED_DecodingSlow | 32 #define MAYBE_DecodingSlow DISABLED_DecodingSlow |
| 31 #else | 33 #else |
| 32 #define MAYBE_DecodingSlow DecodingSlow | 34 #define MAYBE_DecodingSlow DecodingSlow |
| 33 #endif | 35 #endif |
| 34 TEST_F(BMPImageDecoderTest, MAYBE_DecodingSlow) { | 36 TEST_F(BMPImageDecoderTest, MAYBE_DecodingSlow) { |
| 35 TestDecoding(TEST_BIGGER, kThresholdSize); | 37 TestDecoding(TEST_BIGGER, kThresholdSize); |
| 36 } | 38 } |
| OLD | NEW |