OLD | NEW |
1 #!/usr/bin/python | |
2 | |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
4 # 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 |
5 # found in the LICENSE file. | 3 # found in the LICENSE file. |
6 | 4 |
7 """DownloadInfo: python representation for downloads visible to Chrome. | 5 """DownloadInfo: python representation for downloads visible to Chrome. |
8 | 6 |
9 Obtain one of these from PyUITestSuite::GetDownloadsInfo() call. | 7 Obtain one of these from PyUITestSuite::GetDownloadsInfo() call. |
10 | 8 |
11 class MyDownloadsTest(pyauto.PyUITest): | 9 class MyDownloadsTest(pyauto.PyUITest): |
12 def testDownload(self): | 10 def testDownload(self): |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 """ | 70 """ |
73 return [x for x in self.Downloads() if x['state'] == 'IN_PROGRESS'] | 71 return [x for x in self.Downloads() if x['state'] == 'IN_PROGRESS'] |
74 | 72 |
75 def DownloadsComplete(self): | 73 def DownloadsComplete(self): |
76 """Info about all downloads that have completed. | 74 """Info about all downloads that have completed. |
77 | 75 |
78 Returns: | 76 Returns: |
79 [downloaditem1, downloaditem2, ...] | 77 [downloaditem1, downloaditem2, ...] |
80 """ | 78 """ |
81 return [x for x in self.Downloads() if x['state'] == 'COMPLETE'] | 79 return [x for x in self.Downloads() if x['state'] == 'COMPLETE'] |
OLD | NEW |