diff options
author | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-31 22:29:56 +0000 |
---|---|---|
committer | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-31 22:29:56 +0000 |
commit | cda984a50e13b1a9bf4cdb143c7d2a84c52c112e (patch) | |
tree | f1dda833980a462c2a00c5ef85b2c5517f1db9d7 /chrome/common/extensions/docs/server2/api_data_source_test.py | |
parent | 49ace48df9275d0c18b578ce8ef0f29c1cee4f1a (diff) | |
download | chromium_src-cda984a50e13b1a9bf4cdb143c7d2a84c52c112e.zip chromium_src-cda984a50e13b1a9bf4cdb143c7d2a84c52c112e.tar.gz chromium_src-cda984a50e13b1a9bf4cdb143c7d2a84c52c112e.tar.bz2 |
Docserver: Introduce an annotation to CompiledFileSystem's compilation function
which indicates it only relies on that data from a single file, not multiple
files. This allows implementing an optimisation where the file data doesn't need
to be re-compiled if the file stat is the same (note that it's never re-read because
CachingFileSystem already implements a similar optimisation).
This also replace a couple of uses of CompiledFileSystem.Create with the
appropriate CompileFileSystem.For* method.
BUG=305280
R=jyasskin@chromium.org
NOTRY=true
Review URL: https://codereview.chromium.org/54693004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232228 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/docs/server2/api_data_source_test.py')
-rwxr-xr-x | chrome/common/extensions/docs/server2/api_data_source_test.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/chrome/common/extensions/docs/server2/api_data_source_test.py b/chrome/common/extensions/docs/server2/api_data_source_test.py index c862377..611ef49 100755 --- a/chrome/common/extensions/docs/server2/api_data_source_test.py +++ b/chrome/common/extensions/docs/server2/api_data_source_test.py @@ -76,11 +76,8 @@ class APIDataSourceTest(unittest.TestCase): self._base_path = os.path.join(sys.path[0], 'test_data', 'test_json') self._compiled_fs_factory = CompiledFileSystem.Factory( ObjectStoreCreator.ForTest()) - self._json_cache = self._compiled_fs_factory.Create( - TestFileSystem(CANNED_TEST_FILE_SYSTEM_DATA), - lambda _, json: json_parse.Parse(json), - APIDataSourceTest, - 'test') + self._json_cache = self._compiled_fs_factory.ForJson( + TestFileSystem(CANNED_TEST_FILE_SYSTEM_DATA)) def _ReadLocalFile(self, filename): with open(os.path.join(self._base_path, filename), 'r') as f: |