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

Unified Diff: third_party/WebKit/LayoutTests/fast/harness/perftests/measure-time.html

Issue 2429623004: Add performance tests for full frame cycle (Closed)
Patch Set: - 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/harness/perftests/measure-time.html
diff --git a/third_party/WebKit/LayoutTests/fast/harness/perftests/measure-time.html b/third_party/WebKit/LayoutTests/fast/harness/perftests/measure-time.html
new file mode 100644
index 0000000000000000000000000000000000000000..00126e290c046ba4df7e805a9c9f07a0decc7135
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/harness/perftests/measure-time.html
@@ -0,0 +1,21 @@
+<script src="../../../../PerformanceTests/resources/runner.js"></script>
+<script>
+// The initial value doesn't affect result.
+var virtualTime = Math.floor(Math.random() * 100000);
pdr. 2016/10/19 03:50:31 Nit: could you use a fixed random value like 12345
Xianzhu 2016/10/19 15:17:10 Done.
+PerfTestRunner.now = function () { return virtualTime; }
+
+var originalSetTimeout = window.setTimeout;
+window.setTimeout = function(f, t) {
+ // This doesn't affect result.
+ virtualTime += Math.floor(Math.random() * 100000);
+ originalSetTimeout(f, t);
+};
+
+PerfTestRunner.measureTime({
+ run: function () {
+ virtualTime += 20;
+ },
+ warmUpCount: 3,
+ doNotMeasureMemoryUsage: true,
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698