summaryrefslogtreecommitdiffstats
path: root/content/renderer/bmp_image_decoder_unittest.cc
blob: 59e4680e2a33244211a7d7e0ceb828cd815d144d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <stdint.h>

#include "content/test/image_decoder_test.h"
#include "third_party/WebKit/public/web/WebImageDecoder.h"

class BMPImageDecoderTest : public ImageDecoderTest {
 public:
  BMPImageDecoderTest() : ImageDecoderTest("bmp") { }

 protected:
  blink::WebImageDecoder* CreateWebKitImageDecoder() const override {
    return new blink::WebImageDecoder(blink::WebImageDecoder::TypeBMP);
  }

  // The BMPImageDecoderTest tests are really slow under Valgrind.
  // Thus it is split into fast and slow versions. The threshold is
  // set to 10KB because the fast test can finish under Valgrind in
  // less than 30 seconds.
  static const int64_t kThresholdSize = 10240;
};

TEST_F(BMPImageDecoderTest, DecodingFast) {
  TestDecoding(TEST_SMALLER, kThresholdSize);
}

#if defined(THREAD_SANITIZER)
// BMPImageDecoderTest.DecodingSlow always times out under ThreadSanitizer v2.
#define MAYBE_DecodingSlow DISABLED_DecodingSlow
#else
#define MAYBE_DecodingSlow DecodingSlow
#endif
TEST_F(BMPImageDecoderTest, MAYBE_DecodingSlow) {
  TestDecoding(TEST_BIGGER, kThresholdSize);
}