| OLD | NEW |
| 1 #!/usr/bin/python2.4 | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | |
| 3 # 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 |
| 4 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 5 | 4 |
| 6 """SiteCompare command to time page loads | 5 """SiteCompare command to time page loads |
| 7 | 6 |
| 8 Loads a series of URLs in a series of browsers (and browser versions) | 7 Loads a series of URLs in a series of browsers (and browser versions) |
| 9 and measures how long the page takes to load in each. Outputs a | 8 and measures how long the page takes to load in each. Outputs a |
| 10 comma-delimited file. The first line is "URL,[browser names", each | 9 comma-delimited file. The first line is "URL,[browser names", each |
| 11 additional line is a URL follored by comma-delimited times (in seconds), | 10 additional line is a URL follored by comma-delimited times (in seconds), |
| 12 or the string "timeout" or "crashed". | 11 or the string "timeout" or "crashed". |
| (...skipping 19 matching lines...) Expand all Loading... |
| 32 None, | 31 None, |
| 33 ExecuteTimeLoad) | 32 ExecuteTimeLoad) |
| 34 | 33 |
| 35 cmd.AddArgument( | 34 cmd.AddArgument( |
| 36 ["-b", "--browsers"], "List of browsers to use. Comma-separated", | 35 ["-b", "--browsers"], "List of browsers to use. Comma-separated", |
| 37 type="string", required=True) | 36 type="string", required=True) |
| 38 cmd.AddArgument( | 37 cmd.AddArgument( |
| 39 ["-bp", "--browserpaths"], "List of paths to browsers. Comma-separated", | 38 ["-bp", "--browserpaths"], "List of paths to browsers. Comma-separated", |
| 40 type="string", required=False) | 39 type="string", required=False) |
| 41 cmd.AddArgument( | 40 cmd.AddArgument( |
| 42 ["-bv", "--browserversions"], "List of versions of browsers. Comma-separated
", | 41 ["-bv", "--browserversions"], |
| 42 "List of versions of browsers. Comma-separated", |
| 43 type="string", required=False) | 43 type="string", required=False) |
| 44 cmd.AddArgument( | 44 cmd.AddArgument( |
| 45 ["-u", "--url"], "URL to time") | 45 ["-u", "--url"], "URL to time") |
| 46 cmd.AddArgument( | 46 cmd.AddArgument( |
| 47 ["-l", "--list"], "List of URLs to time", type="readfile") | 47 ["-l", "--list"], "List of URLs to time", type="readfile") |
| 48 cmd.AddMutualExclusion(["--url", "--list"]) | 48 cmd.AddMutualExclusion(["--url", "--list"]) |
| 49 cmd.AddArgument( | 49 cmd.AddArgument( |
| 50 ["-s", "--startline"], "First line of URL list", type="int") | 50 ["-s", "--startline"], "First line of URL list", type="int") |
| 51 cmd.AddArgument( | 51 cmd.AddArgument( |
| 52 ["-e", "--endline"], "Last line of URL list (exclusive)", type="int") | 52 ["-e", "--endline"], "Last line of URL list (exclusive)", type="int") |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 path=browser_paths[b]) | 135 path=browser_paths[b]) |
| 136 | 136 |
| 137 for (url, time) in result: | 137 for (url, time) in result: |
| 138 results[url][b] = time | 138 results[url][b] = time |
| 139 | 139 |
| 140 # output the results | 140 # output the results |
| 141 for url in url_list: | 141 for url in url_list: |
| 142 log_file.write(url) | 142 log_file.write(url) |
| 143 for b in xrange(num_browsers): | 143 for b in xrange(num_browsers): |
| 144 log_file.write(",%r" % results[url][b]) | 144 log_file.write(",%r" % results[url][b]) |
| 145 | |
| 146 | |
| OLD | NEW |