Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
image_test_base.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright 2010 Google Inc.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http:///www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
18 
20 
21 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_IMAGE_TEST_BASE_H_
22 #define NET_INSTAWEB_REWRITER_PUBLIC_IMAGE_TEST_BASE_H_
23 
25 
34 #include "pagespeed/kernel/http/image_types.pb.h"
35 
36 namespace net_instaweb {
37 
38 class ImageTestBase : public testing::Test {
39  protected:
40  static const char kTestData[];
41  static const char kAppSegments[];
42  static const char kBikeCrash[];
43  static const char kCradle[];
44  static const char kCuppa[];
45  static const char kCuppaTransparent[];
46  static const char kIronChef[];
47  static const char kPuzzle[];
48  static const char kRedbrush[];
49  static const char kScenery[];
50  static const char kTransparent[];
51 
53 
54  ImageTestBase() :
55  timer_(new NullMutex, 0),
56  message_handler_(new NullMutex) {
57  }
58 
59  virtual ~ImageTestBase();
60 
63  Image* ImageFromString(ImageType output_type,
64  const GoogleString& name,
65  const GoogleString& contents,
66  bool progressive);
67 
71  const char* name, GoogleString* contents,
72  Image::CompressionOptions* options);
73 
76  Image* ReadImageFromFile(ImageType output_type,
77  const char* filename, GoogleString* buffer,
78  bool progressive);
79 
80  MockTimer timer_;
81  StdioFileSystem file_system_;
82  MockMessageHandler message_handler_;
83 
84  private:
85 
86 };
87 
88 }
89 
90 #endif
Definition: mock_timer.h:33
Definition: image_test_base.h:38
Definition: stdio_file_system.h:34
Image * ImageFromString(ImageType output_type, const GoogleString &name, const GoogleString &contents, bool progressive)
Definition: mock_message_handler.h:39
Definition: scoped_ptr.h:30
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: null_mutex.h:29
Image * ReadFromFileWithOptions(const char *name, GoogleString *contents, Image::CompressionOptions *options)
Definition: image.h:39
Image * ReadImageFromFile(ImageType output_type, const char *filename, GoogleString *buffer, bool progressive)