summaryrefslogtreecommitdiffstats
path: root/tools/perf_expectations/tests
diff options
context:
space:
mode:
authorchase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 19:38:45 +0000
committerchase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-11 19:38:45 +0000
commit1b3db78c4451a755eeaadc4cedceccd9e91724c8 (patch)
treeecec761dee823204925cfe5d4edab5c76b06372d /tools/perf_expectations/tests
parent8004db2a466136e59d40c37c72d7d8b739b67862 (diff)
downloadchromium_src-1b3db78c4451a755eeaadc4cedceccd9e91724c8.zip
chromium_src-1b3db78c4451a755eeaadc4cedceccd9e91724c8.tar.gz
chromium_src-1b3db78c4451a755eeaadc4cedceccd9e91724c8.tar.bz2
Convert mac10.6/dhtml/times to new expectations format.
Update unit tests. BUG=none TEST=mac10.6/dhtml is orange Review URL: http://codereview.chromium.org/3180002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55769 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/perf_expectations/tests')
-rwxr-xr-xtools/perf_expectations/tests/perf_expectations_unittest.py30
1 files changed, 22 insertions, 8 deletions
diff --git a/tools/perf_expectations/tests/perf_expectations_unittest.py b/tools/perf_expectations/tests/perf_expectations_unittest.py
index 88b8251..ffb0e23 100755
--- a/tools/perf_expectations/tests/perf_expectations_unittest.py
+++ b/tools/perf_expectations/tests/perf_expectations_unittest.py
@@ -105,14 +105,28 @@ class PerfExpectationsUnittest(unittest.TestCase):
for key in perf_data:
if key == 'load':
continue
- if 'delta' not in perf_data[key] or 'var' not in perf_data[key]:
- bad_keys.append(key)
- if (not isinstance(perf_data[key]['delta'], int) and
- not isinstance(perf_data[key]['delta'], float)):
- bad_keys.append(key)
- if (not isinstance(perf_data[key]['var'], int) and
- not isinstance(perf_data[key]['var'], float)):
- bad_keys.append(key)
+
+ # First check if regress/improve is in the key's data.
+ if 'regress' in perf_data[key]:
+ if 'improve' not in perf_data[key]:
+ bad_keys.append(key)
+ if (not isinstance(perf_data[key]['regress'], int) and
+ not isinstance(perf_data[key]['regress'], float)):
+ bad_keys.append(key)
+ if (not isinstance(perf_data[key]['improve'], int) and
+ not isinstance(perf_data[key]['improve'], float)):
+ bad_keys.append(key)
+ else:
+ # Otherwise check if delta/var is in the key's data.
+ if 'delta' not in perf_data[key] or 'var' not in perf_data[key]:
+ bad_keys.append(key)
+ if (not isinstance(perf_data[key]['delta'], int) and
+ not isinstance(perf_data[key]['delta'], float)):
+ bad_keys.append(key)
+ if (not isinstance(perf_data[key]['var'], int) and
+ not isinstance(perf_data[key]['var'], float)):
+ bad_keys.append(key)
+
if len(bad_keys) > 0:
msg = "perf expectations key values missing or invalid delta/var"
raise Exception("%s: %s" % (msg, bad_keys))