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

Side by Side Diff: content/shell/renderer/layout_test/blink_test_runner.h

Issue 1936853002: Assert event timestamp to be monotonic and not from future Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to histogram Created 4 years, 2 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_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_ 5 #ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_
6 #define CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_ 6 #define CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 void DispatchBeforeInstallPromptEvent( 148 void DispatchBeforeInstallPromptEvent(
149 int request_id, 149 int request_id,
150 const std::vector<std::string>& event_platforms, 150 const std::vector<std::string>& event_platforms,
151 const base::Callback<void(bool)>& callback) override; 151 const base::Callback<void(bool)>& callback) override;
152 blink::WebPlugin* CreatePluginPlaceholder( 152 blink::WebPlugin* CreatePluginPlaceholder(
153 blink::WebLocalFrame* frame, 153 blink::WebLocalFrame* frame,
154 const blink::WebPluginParams& params) override; 154 const blink::WebPluginParams& params) override;
155 float GetDeviceScaleFactor() const override; 155 float GetDeviceScaleFactor() const override;
156 void RunIdleTasks(const base::Closure& callback) override; 156 void RunIdleTasks(const base::Closure& callback) override;
157 157
158 void SetMockMonotonicTimeFunction(
159 const base::Callback<double()>& time_function) const override;
160
158 // Resets a RenderView to a known state for layout tests. It is used both when 161 // Resets a RenderView to a known state for layout tests. It is used both when
159 // a RenderView is created and when reusing an existing RenderView for the 162 // a RenderView is created and when reusing an existing RenderView for the
160 // next test case. 163 // next test case.
161 // When reusing an existing RenderView, |for_new_test| should be true, which 164 // When reusing an existing RenderView, |for_new_test| should be true, which
162 // also resets additional state, like the main frame's name and opener. 165 // also resets additional state, like the main frame's name and opener.
163 void Reset(bool for_new_test); 166 void Reset(bool for_new_test);
164 167
165 void ReportLeakDetectionResult(const LeakDetectionResult& result); 168 void ReportLeakDetectionResult(const LeakDetectionResult& result);
166 169
167 // Message handlers forwarded by LayoutTestRenderFrameObserver. 170 // Message handlers forwarded by LayoutTestRenderFrameObserver.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 210
208 std::deque<base::Callback<void(const std::vector<std::string>&)>> 211 std::deque<base::Callback<void(const std::vector<std::string>&)>>
209 get_bluetooth_events_callbacks_; 212 get_bluetooth_events_callbacks_;
210 213
211 bool is_main_window_; 214 bool is_main_window_;
212 215
213 bool focus_on_next_commit_; 216 bool focus_on_next_commit_;
214 217
215 std::unique_ptr<LeakDetector> leak_detector_; 218 std::unique_ptr<LeakDetector> leak_detector_;
216 219
220 static base::Callback<double()> time_function_;
221 static double returnMockTime() {
222 DCHECK(!time_function_.is_null());
223 return time_function_.Run();
224 }
225
217 DISALLOW_COPY_AND_ASSIGN(BlinkTestRunner); 226 DISALLOW_COPY_AND_ASSIGN(BlinkTestRunner);
218 }; 227 };
219 228
220 } // namespace content 229 } // namespace content
221 230
222 #endif // CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_ 231 #endif // CONTENT_SHELL_RENDERER_LAYOUT_TEST_BLINK_TEST_RUNNER_H_
OLDNEW
« no previous file with comments | « components/test_runner/web_test_delegate.h ('k') | content/shell/renderer/layout_test/blink_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698