| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """ Prepare runtime resources that are needed by Test builders but not | 6 """ Prepare runtime resources that are needed by Test builders but not |
| 7 Bench builders. """ | 7 Bench builders. """ |
| 8 | 8 |
| 9 from build_step import BuildStep | 9 from build_step import BuildStep |
| 10 import build_step | 10 import build_step |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 self._flavor_utils.CreateCleanDeviceDirectory( | 40 self._flavor_utils.CreateCleanDeviceDirectory( |
| 41 self._flavor_utils.DevicePathJoin(self._device_dirs.GMActualDir(), | 41 self._flavor_utils.DevicePathJoin(self._device_dirs.GMActualDir(), |
| 42 self._builder_name)) | 42 self._builder_name)) |
| 43 self._flavor_utils.CreateCleanHostDirectory( | 43 self._flavor_utils.CreateCleanHostDirectory( |
| 44 self._local_playback_dirs.PlaybackGmActualDir()) | 44 self._local_playback_dirs.PlaybackGmActualDir()) |
| 45 self._flavor_utils.CreateCleanDeviceDirectory(self._device_dirs.SKPOutDir()) | 45 self._flavor_utils.CreateCleanDeviceDirectory(self._device_dirs.SKPOutDir()) |
| 46 | 46 |
| 47 # Copy expectations file and images to decode in skimage to device. | 47 # Copy expectations file and images to decode in skimage to device. |
| 48 self._flavor_utils.CreateCleanDeviceDirectory( | 48 self._flavor_utils.CreateCleanDeviceDirectory( |
| 49 self._device_dirs.SKImageExpectedDir()) | 49 self._device_dirs.SKImageExpectedDir()) |
| 50 skimage_expected_filename = builder_name_schema.GetWaterfallBot( | 50 skimage_subdir = builder_name_schema.GetWaterfallBot(self._builder_name) |
| 51 self._builder_name) + ".json" | 51 skimage_expected_filename = build_step.GM_EXPECTATIONS_FILENAME |
| 52 | 52 |
| 53 skimage_host_expectations = os.path.join(self._skimage_expected_dir, | 53 skimage_host_expectations = os.path.join(self._skimage_expected_dir, |
| 54 skimage_subdir, |
| 54 skimage_expected_filename) | 55 skimage_expected_filename) |
| 55 | 56 |
| 56 if os.path.exists(skimage_host_expectations): | 57 if os.path.exists(skimage_host_expectations): |
| 58 skimage_device_subdir = self._flavor_utils.DevicePathJoin( |
| 59 self._device_dirs.SKImageExpectedDir(), |
| 60 skimage_subdir) |
| 57 skimage_device_expectations = self._flavor_utils.DevicePathJoin( | 61 skimage_device_expectations = self._flavor_utils.DevicePathJoin( |
| 58 self._device_dirs.SKImageExpectedDir(), skimage_expected_filename) | 62 skimage_device_subdir, skimage_expected_filename) |
| 59 # For builders without an attached device, PushFileToDevice will fail | 63 # For builders without an attached device, PushFileToDevice will fail |
| 60 # when attempting to copy a file to itself. In this case, there is no | 64 # when attempting to copy a file to itself. In this case, there is no |
| 61 # need to copy. Only do the push when there is an attached device, | 65 # need to copy. Only do the push when there is an attached device, |
| 62 # which corresponds to the case that the filepaths are equal. | 66 # which corresponds to the case that the filepaths are equal. |
| 63 # TODO(scroggo): Once | 67 # TODO(scroggo): Once |
| 64 # https://code.google.com/p/skia/issues/detail?id=1571 is fixed, this | 68 # https://code.google.com/p/skia/issues/detail?id=1571 is fixed, this |
| 65 # check can go away. | 69 # check can go away. |
| 66 if skimage_device_expectations != skimage_host_expectations: | 70 if skimage_device_expectations != skimage_host_expectations: |
| 71 # Create the subdir on the device. |
| 72 self._flavor_utils.CreateCleanDeviceDirectory(skimage_device_subdir) |
| 67 self._flavor_utils.PushFileToDevice(skimage_host_expectations, | 73 self._flavor_utils.PushFileToDevice(skimage_host_expectations, |
| 68 skimage_device_expectations) | 74 skimage_device_expectations) |
| 69 | 75 |
| 70 self._flavor_utils.CopyDirectoryContentsToDevice( | 76 self._flavor_utils.CopyDirectoryContentsToDevice( |
| 71 self._skimage_in_dir, self._device_dirs.SKImageInDir()) | 77 self._skimage_in_dir, self._device_dirs.SKImageInDir()) |
| 72 | 78 |
| 73 | 79 |
| 74 # Create a directory for the output of skimage | 80 # Create a directory for the output of skimage |
| 75 self._flavor_utils.CreateCleanHostDirectory(self._skimage_out_dir) | 81 self._flavor_utils.CreateCleanHostDirectory(self._skimage_out_dir) |
| 76 self._flavor_utils.CreateCleanDeviceDirectory( | 82 self._flavor_utils.CreateCleanDeviceDirectory( |
| 77 self._device_dirs.SKImageOutDir()) | 83 self._device_dirs.SKImageOutDir()) |
| 78 | 84 |
| 79 | 85 |
| 80 if '__main__' == __name__: | 86 if '__main__' == __name__: |
| 81 sys.exit(BuildStep.RunBuildStep(PreRender)) | 87 sys.exit(BuildStep.RunBuildStep(PreRender)) |
| OLD | NEW |