| 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 os | 5 import os |
| 6 import tempfile | 6 import tempfile |
| 7 import unittest | 7 import unittest |
| 8 import zipfile | 8 import zipfile |
| 9 | 9 |
| 10 from adb_profile_chrome import profiler | 10 from profile_chrome import profiler |
| 11 from adb_profile_chrome import ui | 11 from profile_chrome import ui |
| 12 | 12 |
| 13 | 13 |
| 14 class FakeController(object): | 14 class FakeController(object): |
| 15 def __init__(self, contents='fake-contents'): | 15 def __init__(self, contents='fake-contents'): |
| 16 self.contents = contents | 16 self.contents = contents |
| 17 self.interval = None | 17 self.interval = None |
| 18 self.stopped = False | 18 self.stopped = False |
| 19 self.filename = None | 19 self.filename = None |
| 20 | 20 |
| 21 def StartTracing(self, interval): | 21 def StartTracing(self, interval): |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 try: | 70 try: |
| 71 self.assertTrue(result.endswith('.zip')) | 71 self.assertTrue(result.endswith('.zip')) |
| 72 self.assertTrue(zipfile.is_zipfile(result)) | 72 self.assertTrue(zipfile.is_zipfile(result)) |
| 73 with zipfile.ZipFile(result) as f: | 73 with zipfile.ZipFile(result) as f: |
| 74 self.assertEquals( | 74 self.assertEquals( |
| 75 f.namelist(), | 75 f.namelist(), |
| 76 [controllers[0].filename[1:], controllers[1].filename[1:]]) | 76 [controllers[0].filename[1:], controllers[1].filename[1:]]) |
| 77 finally: | 77 finally: |
| 78 os.remove(result) | 78 os.remove(result) |
| OLD | NEW |