def testCopyCacheDirectory(self):
        copy_dest = self.GetTempPath('cache')
        chrome_cache.CopyCacheDirectory(LOADING_DIR, copy_dest)
        self.CompareDirectories(LOADING_DIR, copy_dest)

        self.CreateNewGarbageFile(os.path.join(copy_dest, 'garbage'))
        chrome_cache.CopyCacheDirectory(LOADING_DIR, copy_dest)
        self.CompareDirectories(LOADING_DIR, copy_dest)

        copy_dest = self.GetTempPath('foo/bar/cache')
        chrome_cache.CopyCacheDirectory(LOADING_DIR, copy_dest)
        self.CompareDirectories(LOADING_DIR, copy_dest)
Example #2
0
 def PushBrowserCache(self, cache_path):
     """Override for chrome cache pushing."""
     self._EnsureProfileDirectory()
     profile_cache_path = self._GetCacheDirectoryPath()
     logging.info('Copy cache directory from %s to %s.' %
                  (cache_path, profile_cache_path))
     chrome_cache.CopyCacheDirectory(cache_path, profile_cache_path)
Example #3
0
 def PullBrowserCache(self):
     """Override for chrome cache pulling."""
     cache_path = tempfile.mkdtemp()
     profile_cache_path = self._GetCacheDirectoryPath()
     logging.info('Copy cache directory from %s to %s.' %
                  (profile_cache_path, cache_path))
     chrome_cache.CopyCacheDirectory(profile_cache_path, cache_path)
     return cache_path