| 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 shutil | 6 import shutil |
| 7 import socket | 7 import socket |
| 8 import tempfile | 8 import tempfile |
| 9 import unittest | 9 import unittest |
| 10 | 10 |
| 11 from telemetry.page import profile_generator | 11 from profile_creators import profile_generator |
| 12 | 12 |
| 13 | 13 |
| 14 class ProfileGeneratorUnitTest(unittest.TestCase): | 14 class ProfileGeneratorUnitTest(unittest.TestCase): |
| 15 def setUp(self): | 15 def setUp(self): |
| 16 self.test_directory = tempfile.mkdtemp() | 16 self.test_directory = tempfile.mkdtemp() |
| 17 super(ProfileGeneratorUnitTest, self).setUp() | 17 super(ProfileGeneratorUnitTest, self).setUp() |
| 18 | 18 |
| 19 def _CreateFunkyFilesAndOnePlainFile(self, sandbox_directory): | 19 def _CreateFunkyFilesAndOnePlainFile(self, sandbox_directory): |
| 20 """Create several special files and one plain file in |sandbox_directory|. | 20 """Create several special files and one plain file in |sandbox_directory|. |
| 21 """ | 21 """ |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 shutil.copytree(sandbox_dir, sandbox_dir_copy, | 59 shutil.copytree(sandbox_dir, sandbox_dir_copy, |
| 60 ignore=profile_generator._IsPseudoFile) | 60 ignore=profile_generator._IsPseudoFile) |
| 61 | 61 |
| 62 # Check that only the directory and plain file got copied. | 62 # Check that only the directory and plain file got copied. |
| 63 dir_contents = os.listdir(sandbox_dir_copy) | 63 dir_contents = os.listdir(sandbox_dir_copy) |
| 64 dir_contents.sort() | 64 dir_contents.sort() |
| 65 self.assertEqual(['directory', 'plain_file'], dir_contents) | 65 self.assertEqual(['directory', 'plain_file'], dir_contents) |
| 66 | 66 |
| 67 def tearDown(self): | 67 def tearDown(self): |
| 68 shutil.rmtree(self.test_directory) | 68 shutil.rmtree(self.test_directory) |
| OLD | NEW |