OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Docbuilder for extension docs.""" | 6 """Docbuilder for extension docs.""" |
7 | 7 |
8 import os | 8 import os |
9 import os.path | 9 import os.path |
10 import shutil | 10 import shutil |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 if (os.path.isfile(input_file)): | 65 if (os.path.isfile(input_file)): |
66 originals[name] = open(input_file, 'rb').read() | 66 originals[name] = open(input_file, 'rb').read() |
67 os.remove(input_file) | 67 os.remove(input_file) |
68 else: | 68 else: |
69 originals[name] = "" | 69 originals[name] = "" |
70 | 70 |
71 shutil.copy(_page_shell_html, input_file) | 71 shutil.copy(_page_shell_html, input_file) |
72 | 72 |
73 # Run DumpRenderTree and capture result | 73 # Run DumpRenderTree and capture result |
74 dump_render_tree_timeout = 1000 * 60 * 5 # five minutes | 74 dump_render_tree_timeout = 1000 * 60 * 5 # five minutes |
75 | |
76 cmd = [dump_render_tree, "--test-shell", | |
Ben Olmstead
2011/07/19 23:28:30
Leftovers? cmd doesn't appear to be used anywhere
dmazzoni
2011/07/20 05:58:04
Good catch, deleted.
| |
77 "%s %s" % (generator_url, dump_render_tree_timeout)] | |
78 | |
75 p = Popen( | 79 p = Popen( |
76 [dump_render_tree, "--test-shell", | 80 [dump_render_tree, "--test-shell", |
77 "%s %s" % (generator_url, dump_render_tree_timeout)], | 81 "%s %s" % (generator_url, dump_render_tree_timeout)], |
78 stdout=PIPE) | 82 stdout=PIPE) |
79 | 83 |
80 # The remaining output will be the content of the generated pages. | 84 # The remaining output will be the content of the generated pages. |
81 output = p.stdout.read() | 85 output = p.stdout.read() |
82 | 86 |
83 # Parse out just the JSON part. | 87 # Parse out just the JSON part. |
84 begin = output.find(_expected_output_preamble) | 88 begin = output.find(_expected_output_preamble) |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 if (os.path.isfile(debug_log)): | 240 if (os.path.isfile(debug_log)): |
237 os.remove(debug_log) | 241 os.remove(debug_log) |
238 | 242 |
239 if 'EX_OK' in dir(os): | 243 if 'EX_OK' in dir(os): |
240 return os.EX_OK | 244 return os.EX_OK |
241 else: | 245 else: |
242 return 0 | 246 return 0 |
243 | 247 |
244 if __name__ == '__main__': | 248 if __name__ == '__main__': |
245 sys.exit(main()) | 249 sys.exit(main()) |
OLD | NEW |