Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: content/shell/renderer/webkit_test_runner.h

Issue 478483005: Add IPC benchmarking API to Blink TestRunner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Landing Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ 5 #ifndef CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_
6 #define CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ 6 #define CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 12 matching lines...) Expand all
23 23
24 namespace blink { 24 namespace blink {
25 class WebBatteryStatus; 25 class WebBatteryStatus;
26 class WebDeviceMotionData; 26 class WebDeviceMotionData;
27 class WebDeviceOrientationData; 27 class WebDeviceOrientationData;
28 struct WebRect; 28 struct WebRect;
29 } 29 }
30 30
31 namespace content { 31 namespace content {
32 32
33 class IPCEcho;
33 class LeakDetector; 34 class LeakDetector;
34 class WebTestProxyBase; 35 class WebTestProxyBase;
35 struct LeakDetectionResult; 36 struct LeakDetectionResult;
36 37
37 // This is the renderer side of the webkit test runner. 38 // This is the renderer side of the webkit test runner.
38 class WebKitTestRunner : public RenderViewObserver, 39 class WebKitTestRunner : public RenderViewObserver,
39 public RenderViewObserverTracker<WebKitTestRunner>, 40 public RenderViewObserverTracker<WebKitTestRunner>,
40 public WebTestDelegate { 41 public WebTestDelegate {
41 public: 42 public:
42 explicit WebKitTestRunner(RenderView* render_view); 43 explicit WebKitTestRunner(RenderView* render_view);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 virtual void testFinished() OVERRIDE; 108 virtual void testFinished() OVERRIDE;
108 virtual void closeRemainingWindows() OVERRIDE; 109 virtual void closeRemainingWindows() OVERRIDE;
109 virtual void deleteAllCookies() OVERRIDE; 110 virtual void deleteAllCookies() OVERRIDE;
110 virtual int navigationEntryCount() OVERRIDE; 111 virtual int navigationEntryCount() OVERRIDE;
111 virtual void goToOffset(int offset) OVERRIDE; 112 virtual void goToOffset(int offset) OVERRIDE;
112 virtual void reload() OVERRIDE; 113 virtual void reload() OVERRIDE;
113 virtual void loadURLForFrame(const blink::WebURL& url, 114 virtual void loadURLForFrame(const blink::WebURL& url,
114 const std::string& frame_name) OVERRIDE; 115 const std::string& frame_name) OVERRIDE;
115 virtual bool allowExternalPages() OVERRIDE; 116 virtual bool allowExternalPages() OVERRIDE;
116 virtual std::string dumpHistoryForWindow(WebTestProxyBase* proxy) OVERRIDE; 117 virtual std::string dumpHistoryForWindow(WebTestProxyBase* proxy) OVERRIDE;
118 virtual void requestEcho(int id, int size) OVERRIDE;
119 virtual int lastEchoId() OVERRIDE;
120 virtual int lastEchoSize() OVERRIDE;
117 121
118 void Reset(); 122 void Reset();
119 123
120 void set_proxy(WebTestProxyBase* proxy) { proxy_ = proxy; } 124 void set_proxy(WebTestProxyBase* proxy) { proxy_ = proxy; }
121 WebTestProxyBase* proxy() const { return proxy_; } 125 WebTestProxyBase* proxy() const { return proxy_; }
122 126
123 void ReportLeakDetectionResult(const LeakDetectionResult& result); 127 void ReportLeakDetectionResult(const LeakDetectionResult& result);
124 128
125 private: 129 private:
126 // Message handlers. 130 // Message handlers.
131 void OnEchoPong(int id, const std::string& body);
127 void OnSetTestConfiguration(const ShellTestConfiguration& params); 132 void OnSetTestConfiguration(const ShellTestConfiguration& params);
128 void OnSessionHistory( 133 void OnSessionHistory(
129 const std::vector<int>& routing_ids, 134 const std::vector<int>& routing_ids,
130 const std::vector<std::vector<PageState> >& session_histories, 135 const std::vector<std::vector<PageState> >& session_histories,
131 const std::vector<unsigned>& current_entry_indexes); 136 const std::vector<unsigned>& current_entry_indexes);
132 void OnReset(); 137 void OnReset();
133 void OnNotifyDone(); 138 void OnNotifyDone();
134 void OnTryLeakDetection(); 139 void OnTryLeakDetection();
135 140
136 // After finishing the test, retrieves the audio, text, and pixel dumps from 141 // After finishing the test, retrieves the audio, text, and pixel dumps from
(...skipping 12 matching lines...) Expand all
149 154
150 std::vector<int> routing_ids_; 155 std::vector<int> routing_ids_;
151 std::vector<std::vector<PageState> > session_histories_; 156 std::vector<std::vector<PageState> > session_histories_;
152 std::vector<unsigned> current_entry_indexes_; 157 std::vector<unsigned> current_entry_indexes_;
153 158
154 bool is_main_window_; 159 bool is_main_window_;
155 160
156 bool focus_on_next_commit_; 161 bool focus_on_next_commit_;
157 162
158 scoped_ptr<LeakDetector> leak_detector_; 163 scoped_ptr<LeakDetector> leak_detector_;
164 scoped_ptr<IPCEcho> ipc_echo_;
159 bool needs_leak_detector_; 165 bool needs_leak_detector_;
160 166
161 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner); 167 DISALLOW_COPY_AND_ASSIGN(WebKitTestRunner);
162 }; 168 };
163 169
164 } // namespace content 170 } // namespace content
165 171
166 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_ 172 #endif // CONTENT_SHELL_WEBKIT_TEST_RUNNER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698