def setUp(self):
        self.temp_dir = tempfile.mkdtemp()
        archive_utils_unittest.BuildTestFilesTree(self.temp_dir)
        self.zip_file = 'archive.zip'
        self.target = 'Debug'
        self.build_dir = os.path.join(self.temp_dir, 'build')
        os.makedirs(self.build_dir)
        self.src_dir = os.path.join(self.build_dir, 'src')
        os.makedirs(self.src_dir)
        self.out_dir = os.path.join(self.src_dir, 'out')
        os.makedirs(self.out_dir)
        self.target_dir = os.path.join(self.out_dir, self.target)
        os.makedirs(self.target_dir)

        # Create test files
        archive_utils_unittest.CreateFileSetInDir(self.src_dir, SOURCE_FILES)
        archive_utils_unittest.CreateFileSetInDir(self.target_dir,
                                                  BINARY_FILES)
        archive_utils_unittest.CreateFileSetInDir(self.target_dir,
                                                  INTERMEDIATE_FILES)
        os.chdir(self.src_dir)
    def setUp(self):
        self.temp_dir = tempfile.mkdtemp()
        archive_utils_unittest.BuildTestFilesTree(self.temp_dir)

        # Make some directories to make the stager happy.
        self.target = 'Test'
        if chromium_utils.IsWindows():
            self.build_dir = os.path.join(self.temp_dir, 'build')
        elif chromium_utils.IsLinux():
            self.build_dir = os.path.join(self.temp_dir, 'out')
        elif chromium_utils.IsMac():
            self.build_dir = os.path.join(self.temp_dir, 'xcodebuild')
        else:
            raise PlatformError('Platform "%s" is not currently supported.' %
                                sys.platform)
        os.makedirs(os.path.join(self.build_dir, self.target))
        self.src_dir = os.path.join(self.temp_dir, 'build', 'src')
        os.makedirs(self.src_dir)
        self.archive_dir = os.path.join(self.temp_dir, 'archive')
        os.makedirs(self.archive_dir)
        # Make a directory to hold an extra files and tests specifier:
        self.extra_files_dir = os.path.join(self.temp_dir, 'build', 'src',
                                            'extra')
        os.makedirs(self.extra_files_dir)

        # Create the FILES file and seed with contents:
        self.extra_files = os.path.join(self.extra_files_dir, 'FILES')
        extra_file = open(self.extra_files, 'w')
        for f in ZIP_TEST_FILES:
            extra_file.write(f + '\n')
        extra_file.close()

        # Create the TESTS file and seed with contents:
        self.extra_tests = os.path.join(self.extra_files_dir, 'TESTS')
        extra_tests = open(self.extra_tests, 'w')
        for t in EXTRA_TEST_FILES:
            extra_tests.write(t + '\n')
        extra_tests.close()
        # The stager object will be initialized in initializeStager method.
        self.stager = None