-
Notifications
You must be signed in to change notification settings - Fork 708
/
results.h
106 lines (94 loc) · 3.74 KB
/
results.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/******************************************************************************
Copyright (c) 2010, Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the <ORGANIZATION> nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
#pragma once
class Requests;
class Request;
class TestState;
class TrackSockets;
class TrackDns;
class ScreenCapture;
class CxImage;
class WptTest;
class OptimizationChecks;
class DevTools;
class Results {
public:
Results(TestState& test_state, WptTest& test, Requests& requests,
TrackSockets& sockets, TrackDns& dns, ScreenCapture& screen_capture,
DevTools &dev_tools);
~Results(void);
void Reset(void);
void Save(void);
// test information
CString _url;
private:
CString _file_base;
Requests& _requests;
TestState& _test_state;
TrackSockets& _sockets;
TrackDns& _dns;
ScreenCapture& _screen_capture;
WptTest& _test;
DevTools &_dev_tools;
bool _saved;
LARGE_INTEGER _visually_complete;
CStringA base_page_CDN_;
int base_page_redirects_;
int base_page_result_;
LARGE_INTEGER base_page_complete_;
CStringA base_page_server_rtt_;
int base_page_address_count_;
bool adult_site_;
int count_connect_;
int count_connect_doc_;
int count_dns_;
int count_dns_doc_;
int count_ok_;
int count_ok_doc_;
int count_redirect_;
int count_redirect_doc_;
int count_not_modified_;
int count_not_modified_doc_;
int count_not_found_;
int count_not_found_doc_;
int count_other_;
int count_other_doc_;
void ProcessRequests(void);
void SavePageData(OptimizationChecks&);
void SaveRequests(OptimizationChecks&);
void SaveRequest(HANDLE file, HANDLE headers, Request * request, int index);
void SaveImages(void);
void SaveVideo(void);
void SaveProgressData(void);
void SaveStatusMessages(void);
void SaveImage(CxImage& image, CString file, BYTE quality);
bool ImagesAreDifferent(CxImage * img1, CxImage* img2);
CStringA FormatTime(LARGE_INTEGER t);
void SaveResponseBodies(void);
void SaveConsoleLog(void);
void SaveTimedEvents(void);
void SaveHistogram(CxImage& image, CString file);
bool NativeRequestExists(Request * browser_request);
};