19 #ifndef PAGESPEED_OPT_LOGGING_LOG_RECORD_TEST_HELPER_H_
20 #define PAGESPEED_OPT_LOGGING_LOG_RECORD_TEST_HELPER_H_
24 #include "pagespeed/kernel/http/image_types.pb.h"
25 #include "pagespeed/opt/logging/enums.pb.h"
30 using ::testing::Matcher;
31 using ::testing::StrEq;
33 namespace net_instaweb {
43 RewriterApplication::Status status,
44 bool is_image_inlined,
45 bool is_critical_image,
46 bool is_url_rewritten,
48 bool try_low_res_src_insertion,
49 bool low_res_src_inserted,
50 ImageType low_res_image_type,
51 int low_res_data_size) :
52 id_(
id), url_(url), status_(status), is_image_inlined_(is_image_inlined),
53 is_critical_image_(is_critical_image), is_url_rewritten_(is_url_rewritten),
54 size_(size), try_low_res_src_insertion_(try_low_res_src_insertion),
55 low_res_src_inserted_(low_res_src_inserted),
56 low_res_image_type_(low_res_image_type),
57 low_res_data_size_(low_res_data_size) {}
61 RewriterApplication::Status status_;
62 bool is_image_inlined_;
63 bool is_critical_image_;
64 bool is_url_rewritten_;
66 bool try_low_res_src_insertion_;
67 bool low_res_src_inserted_;
68 ImageType low_res_image_type_;
69 int low_res_data_size_;
75 Matcher<const char*>
id,
76 Matcher<const GoogleString&> url,
77 Matcher<RewriterApplication::Status> status,
78 Matcher<bool> is_image_inlined,
79 Matcher<bool> is_critical_image,
80 Matcher<bool> is_url_rewritten,
82 Matcher<bool> try_low_res_src_insertion,
83 Matcher<bool> low_res_src_inserted,
84 Matcher<ImageType> low_res_image_type,
85 Matcher<int> low_res_data_size);
95 RewriterApplication::Status status,
96 bool is_image_inlined,
97 bool is_critical_image,
98 bool is_url_rewritten,
100 bool try_low_res_src_insertion,
101 bool low_res_src_inserted,
102 ImageType low_res_image_type,
103 int low_res_data_size) {
105 is_url_rewritten, size, try_low_res_src_insertion,
106 low_res_src_inserted, low_res_image_type,
108 MockLogImageRewriteActivity(info);
Simple AbstractLogRecord implementation which owns a LoggingInfo protobuf.
Definition: log_record.h:294
virtual void LogImageRewriteActivity(const char *id, const GoogleString &url, RewriterApplication::Status status, bool is_image_inlined, bool is_critical_image, bool is_url_rewritten, int size, bool try_low_res_src_insertion, bool low_res_src_inserted, ImageType low_res_image_type, int low_res_data_size)
Log a RewriterInfo for the image rewrite filter.
Definition: log_record_test_helper.h:92
Abstract interface for implementing a mutex.
Definition: abstract_mutex.h:28
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: log_record_test_helper.h:39
AbstractMutex * mutex()
Definition: log_record.h:181
Matcher< ImageRewriteInfo > LogImageRewriteActivityMatcher(Matcher< const char * > id, Matcher< const GoogleString & > url, Matcher< RewriterApplication::Status > status, Matcher< bool > is_image_inlined, Matcher< bool > is_critical_image, Matcher< bool > is_url_rewritten, Matcher< int > size, Matcher< bool > try_low_res_src_insertion, Matcher< bool > low_res_src_inserted, Matcher< ImageType > low_res_image_type, Matcher< int > low_res_data_size)
A class which helps mock the methods of LogRecord for testing.
Definition: log_record_test_helper.h:88