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

Side by Side Diff: telemetry/telemetry/page/__init__.py

Issue 2610173005: Revert of Asserting telemetry story display name length for filename creation. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | telemetry/telemetry/page/page_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2012 The Chromium Authors. All rights reserved. 1 # Copyright 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 import inspect 4 import inspect
5 import logging 5 import logging
6 import os 6 import os
7 import urlparse 7 import urlparse
8 8
9 from py_utils import cloud_storage # pylint: disable=import-error 9 from py_utils import cloud_storage # pylint: disable=import-error
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 # page actions. 61 # page actions.
62 self._collect_garbage_before_run = True 62 self._collect_garbage_before_run = True
63 63
64 # These attributes can be set dynamically by the page. 64 # These attributes can be set dynamically by the page.
65 self.synthetic_delays = dict() 65 self.synthetic_delays = dict()
66 self._startup_url = startup_url 66 self._startup_url = startup_url
67 self.credentials = None 67 self.credentials = None
68 self.skip_waits = False 68 self.skip_waits = False
69 self.script_to_evaluate_on_commit = None 69 self.script_to_evaluate_on_commit = None
70 self._SchemeErrorCheck() 70 self._SchemeErrorCheck()
71 # Confirm that the display name length that is used to generate the trace
72 # filename isn't too long. See crbug.com/662941.
73 assert len(self.display_name) <= 180
74 71
75 @property 72 @property
76 def credentials_path(self): 73 def credentials_path(self):
77 return self._credentials_path 74 return self._credentials_path
78 75
79 @property 76 @property
80 def cache_temperature(self): 77 def cache_temperature(self):
81 return self._cache_temperature 78 return self._cache_temperature
82 79
83 @property 80 @property
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 218
222 @property 219 @property
223 def display_name(self): 220 def display_name(self):
224 if self.name: 221 if self.name:
225 return self.name 222 return self.name
226 if self.page_set is None or not self.is_file: 223 if self.page_set is None or not self.is_file:
227 return self.url 224 return self.url
228 all_urls = [p.url.rstrip('/') for p in self.page_set if p.is_file] 225 all_urls = [p.url.rstrip('/') for p in self.page_set if p.is_file]
229 common_prefix = os.path.dirname(os.path.commonprefix(all_urls)) 226 common_prefix = os.path.dirname(os.path.commonprefix(all_urls))
230 return self.url[len(common_prefix):].strip('/') 227 return self.url[len(common_prefix):].strip('/')
OLDNEW
« no previous file with comments | « no previous file | telemetry/telemetry/page/page_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698