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

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

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 #include "content/shell/renderer/layout_test/blink_test_runner.h" 5 #include "content/shell/renderer/layout_test/blink_test_runner.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <clocale> 10 #include <clocale>
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 } 714 }
715 715
716 float BlinkTestRunner::GetDeviceScaleFactor() const { 716 float BlinkTestRunner::GetDeviceScaleFactor() const {
717 return render_view()->GetDeviceScaleFactor(); 717 return render_view()->GetDeviceScaleFactor();
718 } 718 }
719 719
720 void BlinkTestRunner::RunIdleTasks(const base::Closure& callback) { 720 void BlinkTestRunner::RunIdleTasks(const base::Closure& callback) {
721 SchedulerRunIdleTasks(callback); 721 SchedulerRunIdleTasks(callback);
722 } 722 }
723 723
724 base::Callback<double()> BlinkTestRunner::time_function_;
725
726 void BlinkTestRunner::SetMockMonotonicTimeFunction(
727 const base::Callback<double()>& time_function) const {
728 time_function_ = time_function;
729 // TODO(majidvp): Perhaps we need a generic utility to convert a
730 // base::Callback to a WTF::Function similar to WebFunction but in reverse
731 // direction.
732 WebTestingSupport::setMonotonicallyIncreasingTimeFunctionForTesting(
733 time_function_.is_null() ? nullptr : returnMockTime);
734
735 }
736
724 bool BlinkTestRunner::AddMediaStreamVideoSourceAndTrack( 737 bool BlinkTestRunner::AddMediaStreamVideoSourceAndTrack(
725 blink::WebMediaStream* stream) { 738 blink::WebMediaStream* stream) {
726 DCHECK(stream); 739 DCHECK(stream);
727 #if defined(ENABLE_WEBRTC) 740 #if defined(ENABLE_WEBRTC)
728 return AddVideoTrackToMediaStream( 741 return AddVideoTrackToMediaStream(
729 base::WrapUnique(new MockVideoCapturerSource()), 742 base::WrapUnique(new MockVideoCapturerSource()),
730 false, // is_remote 743 false, // is_remote
731 false, // is_readonly 744 false, // is_readonly
732 stream); 745 stream);
733 #else 746 #else
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 void BlinkTestRunner::ReportLeakDetectionResult( 1031 void BlinkTestRunner::ReportLeakDetectionResult(
1019 const LeakDetectionResult& report) { 1032 const LeakDetectionResult& report) {
1020 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); 1033 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report));
1021 } 1034 }
1022 1035
1023 void BlinkTestRunner::OnDestruct() { 1036 void BlinkTestRunner::OnDestruct() {
1024 delete this; 1037 delete this;
1025 } 1038 }
1026 1039
1027 } // namespace content 1040 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.h ('k') | third_party/WebKit/Source/core/events/Event.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698