OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import logging | 5 import logging |
6 import optparse | 6 import optparse |
7 import os | 7 import os |
8 import shutil | 8 import shutil |
9 import sys | 9 import sys |
10 import zipfile | 10 import zipfile |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 self._DownloadGeneratedProfileArchive(args) | 80 self._DownloadGeneratedProfileArchive(args) |
81 | 81 |
82 results = page_test_results.PageTestResults() | 82 results = page_test_results.PageTestResults() |
83 try: | 83 try: |
84 results = page_runner.Run(test, ps, expectations, args) | 84 results = page_runner.Run(test, ps, expectations, args) |
85 except page_test.TestNotSupportedOnPlatformFailure as failure: | 85 except page_test.TestNotSupportedOnPlatformFailure as failure: |
86 logging.warning(str(failure)) | 86 logging.warning(str(failure)) |
87 | 87 |
88 results.PrintSummary() | 88 results.PrintSummary() |
89 return len(results.failures) + len(results.errors) | 89 return len(results.failures) |
90 | 90 |
91 def _DownloadGeneratedProfileArchive(self, options): | 91 def _DownloadGeneratedProfileArchive(self, options): |
92 """Download and extract profile directory archive if one exists.""" | 92 """Download and extract profile directory archive if one exists.""" |
93 archive_name = getattr(self, 'generated_profile_archive', None) | 93 archive_name = getattr(self, 'generated_profile_archive', None) |
94 | 94 |
95 # If attribute not specified, nothing to do. | 95 # If attribute not specified, nothing to do. |
96 if not archive_name: | 96 if not archive_name: |
97 return | 97 return |
98 | 98 |
99 # If profile dir specified on command line, nothing to do. | 99 # If profile dir specified on command line, nothing to do. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 """ | 193 """ |
194 return test_expectations.TestExpectations() | 194 return test_expectations.TestExpectations() |
195 | 195 |
196 | 196 |
197 def AddCommandLineArgs(parser): | 197 def AddCommandLineArgs(parser): |
198 page_runner.AddCommandLineArgs(parser) | 198 page_runner.AddCommandLineArgs(parser) |
199 | 199 |
200 | 200 |
201 def ProcessCommandLineArgs(parser, args): | 201 def ProcessCommandLineArgs(parser, args): |
202 page_runner.ProcessCommandLineArgs(parser, args) | 202 page_runner.ProcessCommandLineArgs(parser, args) |
OLD | NEW |