| Index: chrome/common/extensions/docs/server2/caching_file_system_test.py
|
| diff --git a/chrome/common/extensions/docs/server2/caching_file_system_test.py b/chrome/common/extensions/docs/server2/caching_file_system_test.py
|
| index f80ac8c70f7875d83c3a91c452e0c1762d87b016..45ce024c84aeafb450c77e57707d82ba3520b09d 100755
|
| --- a/chrome/common/extensions/docs/server2/caching_file_system_test.py
|
| +++ b/chrome/common/extensions/docs/server2/caching_file_system_test.py
|
| @@ -292,5 +292,26 @@ class CachingFileSystemTest(unittest.TestCase):
|
| # TODO(ahernandez): Test with a new instance CachingFileSystem so a
|
| # different object store is utilized.
|
|
|
| + def testVersionedStat(self):
|
| + test_fs = TestFileSystem({
|
| + 'bob': {
|
| + 'bob0': 'bob/bob0 contents',
|
| + 'bob1': 'bob/bob1 contents'
|
| + }
|
| + })
|
| +
|
| + # Create a versioned FileSystem and verify that multiple CachingFileSystem
|
| + # instances wrapping it will share the same stat cache.
|
| + mock_fs = MockFileSystem(test_fs)
|
| + mock_fs.SetVersion('abcdefg')
|
| +
|
| + def run_and_expect_stat_count(paths, stat_count=0):
|
| + file_system = self._CreateCachingFileSystem(mock_fs, start_empty=True)
|
| + [file_system.Stat(path) for path in paths]
|
| + self.assertTrue(*mock_fs.CheckAndReset(stat_count=stat_count))
|
| +
|
| + run_and_expect_stat_count(['bob/', 'bob/bob0', 'bob/bob1'], stat_count=1)
|
| + run_and_expect_stat_count(['bob/', 'bob/bob0', 'bob/bob1'], stat_count=0)
|
| +
|
| if __name__ == '__main__':
|
| unittest.main()
|
|
|