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

Side by Side Diff: chrome/test/functional/themes.py

Issue 6309009: Fix a warning in themes.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 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 import glob 6 import glob
7 import logging 7 import logging
8 import os 8 import os
9 9
10 import pyauto_functional # Must be imported before pyauto 10 import pyauto_functional # Must be imported before pyauto
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 This does not get run automatically. To run: 97 This does not get run automatically. To run:
98 python themes.py themes.ThemesTest.Runner 98 python themes.py themes.ThemesTest.Runner
99 99
100 Note: this test requires that a directory of crx files called 'themes' 100 Note: this test requires that a directory of crx files called 'themes'
101 exists in the data directory. 101 exists in the data directory.
102 """ 102 """
103 themes_dir = os.path.join(self.DataDir(), 'themes') 103 themes_dir = os.path.join(self.DataDir(), 'themes')
104 urls_file = os.path.join(self.DataDir(), 'urls.txt') 104 urls_file = os.path.join(self.DataDir(), 'urls.txt')
105 105
106 assert(os.path.exists(themes_dir), 106 assert os.path.exists(themes_dir), \
107 'The dir "%s" must exist' % os.path.abspath(themes_dir)) 107 'The dir "%s" must exist' % os.path.abspath(themes_dir)
108 108
109 group_size = 20 109 group_size = 20
110 num_urls_to_visit = 100 110 num_urls_to_visit = 100
111 111
112 urls = [l.rstrip() for l in 112 urls = [l.rstrip() for l in
113 open(urls_file).readlines()[:num_urls_to_visit]] 113 open(urls_file).readlines()[:num_urls_to_visit]]
114 failed_themes = glob.glob(os.path.join(themes_dir, '*.crx')) 114 failed_themes = glob.glob(os.path.join(themes_dir, '*.crx'))
115 115
116 while failed_themes and group_size: 116 while failed_themes and group_size:
117 failed_themes = self._ReturnCrashingThemes(failed_themes, group_size, 117 failed_themes = self._ReturnCrashingThemes(failed_themes, group_size,
118 urls) 118 urls)
119 group_size = group_size // 2 119 group_size = group_size // 2
120 120
121 self.assertFalse(failed_themes, 121 self.assertFalse(failed_themes,
122 'Theme(s) in failing group: %s' % failed_themes) 122 'Theme(s) in failing group: %s' % failed_themes)
123 123
124 124
125 if __name__ == '__main__': 125 if __name__ == '__main__':
126 pyauto_functional.Main() 126 pyauto_functional.Main()
127 127
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698