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

Unified Diff: tools/perf/benchmarks/session_restore.py

Issue 317733002: [Telemetry] Make session restore benchmark not require arguments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New approach Created 6 years, 6 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: tools/perf/benchmarks/session_restore.py
diff --git a/tools/perf/benchmarks/session_restore.py b/tools/perf/benchmarks/session_restore.py
index a5f2a8ca90bf3bb034dc442665d75c2b9dbaca16..6084034a5a6027cd7c89d36dc3bc2766247abf7f 100644
--- a/tools/perf/benchmarks/session_restore.py
+++ b/tools/perf/benchmarks/session_restore.py
@@ -2,13 +2,39 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import os
+import tempfile
+
from measurements import session_restore
+from profile_creators import small_profile_creator
from telemetry import test
+from telemetry.page import profile_generator
+
+
+class _SessionRestoreTest(test.Test):
+
+ @classmethod
+ def ProcessCommandLineArgs(cls, parser, args):
+ super(_SessionRestoreTest, cls).ProcessCommandLineArgs(parser, args)
+
+ profile_type = 'small_profile'
+
+ if not args.browser_options.profile_dir:
+ profile_dir = os.path.join(tempfile.gettempdir(), profile_type)
+ args.browser_options.profile_dir = profile_dir
+
+ if not os.path.exists(profile_dir):
+ os.makedirs(profile_dir)
+ args = args.Copy()
+ args.pageset_repeat = 1
+ args.output_dir = tempfile.gettempdir()
+ profile_generator.GenerateProfiles(
+ small_profile_creator.SmallProfileCreator, profile_type, args)
# crbug.com/325479: Disabling this test for now since it never ran before.
@test.Disabled('android', 'linux')
-class SessionRestoreColdTypical25(test.Test):
+class SessionRestoreColdTypical25(_SessionRestoreTest):
tag = 'cold'
test = session_restore.SessionRestore
page_set = 'page_sets/typical_25.py'
@@ -16,7 +42,7 @@ class SessionRestoreColdTypical25(test.Test):
'pageset_repeat': 5}
-class SessionRestoreWarmTypical25(test.Test):
+class SessionRestoreWarmTypical25(_SessionRestoreTest):
tag = 'warm'
test = session_restore.SessionRestore
page_set = 'page_sets/typical_25.py'
« no previous file with comments | « no previous file | tools/perf/measurements/session_restore.py » ('j') | tools/perf/measurements/session_restore.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698