diff options
author | evan.peterson.EP@gmail.com <evan.peterson.EP@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-23 01:14:01 +0000 |
---|---|---|
committer | evan.peterson.EP@gmail.com <evan.peterson.EP@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-23 01:14:01 +0000 |
commit | a84a26a8ea24a7c686050b5f0ffc72bd059ae986 (patch) | |
tree | 5b652ab70e0552f468f4ee201b580134ae4589bc | |
parent | 197ce11e4b97322f7ef5399b0f23c4fc82532b33 (diff) | |
download | chromium_src-a84a26a8ea24a7c686050b5f0ffc72bd059ae986.zip chromium_src-a84a26a8ea24a7c686050b5f0ffc72bd059ae986.tar.gz chromium_src-a84a26a8ea24a7c686050b5f0ffc72bd059ae986.tar.bz2 |
Whitelisted APIs like declarativeContent were displaying wrong availability information. This should fix that.
BUG=262859
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/19980002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213022 0039d316-1c4b-4281-b951-d872f2087c98
6 files changed, 33 insertions, 7 deletions
diff --git a/chrome/common/extensions/docs/server2/app.yaml b/chrome/common/extensions/docs/server2/app.yaml index 4950671..00894fb 100644 --- a/chrome/common/extensions/docs/server2/app.yaml +++ b/chrome/common/extensions/docs/server2/app.yaml @@ -1,5 +1,5 @@ application: chrome-apps-doc -version: 2-12-0 +version: 2-12-1 runtime: python27 api_version: 1 threadsafe: false diff --git a/chrome/common/extensions/docs/server2/availability_finder.py b/chrome/common/extensions/docs/server2/availability_finder.py index f9cf1b3..69028b0c 100644 --- a/chrome/common/extensions/docs/server2/availability_finder.py +++ b/chrome/common/extensions/docs/server2/availability_finder.py @@ -34,12 +34,11 @@ def _GetChannelFromFeatures(api_name, file_system, path): if feature is None: return None if isinstance(feature, collections.Mapping): - # The channel information dict is nested within a list for whitelisting - # purposes. + # The channel information exists as a solitary dict. return feature.get('channel') - # Features can contain a list of entries. Take the newest branch. - return BranchUtility.NewestChannel(entry.get('channel') - for entry in feature) + # The channel information dict is nested within a list for whitelisting + # purposes. Take the newest channel out of all of the entries. + return BranchUtility.NewestChannel(entry.get('channel') for entry in feature) def _GetChannelFromApiFeatures(api_name, file_system): try: diff --git a/chrome/common/extensions/docs/server2/availability_finder_test.py b/chrome/common/extensions/docs/server2/availability_finder_test.py index b880b0c..25cfd14 100755 --- a/chrome/common/extensions/docs/server2/availability_finder_test.py +++ b/chrome/common/extensions/docs/server2/availability_finder_test.py @@ -55,6 +55,12 @@ class AvailabilityFinderTest(unittest.TestCase): self.assertEqual(28, self._avail_finder.GetApiAvailability('jsonAPI3').version) + # Testing whitelisted API + self.assertEquals('beta', + self._avail_finder.GetApiAvailability('declarativeWebRequest').channel) + self.assertEquals(27, + self._avail_finder.GetApiAvailability('declarativeWebRequest').version) + # Testing APIs found only by checking file system existence. self.assertEquals('stable', self._avail_finder.GetApiAvailability('windows').channel) diff --git a/chrome/common/extensions/docs/server2/branch_utility.py b/chrome/common/extensions/docs/server2/branch_utility.py index ab3dce2..85e77e5 100644 --- a/chrome/common/extensions/docs/server2/branch_utility.py +++ b/chrome/common/extensions/docs/server2/branch_utility.py @@ -31,6 +31,7 @@ class BranchUtility(object): @staticmethod def NewestChannel(channels): + channels = set(channels) for channel in reversed(BranchUtility.GetAllChannelNames()): if channel in channels: return channel diff --git a/chrome/common/extensions/docs/server2/cron.yaml b/chrome/common/extensions/docs/server2/cron.yaml index 478a202..fc7da6d 100644 --- a/chrome/common/extensions/docs/server2/cron.yaml +++ b/chrome/common/extensions/docs/server2/cron.yaml @@ -2,4 +2,4 @@ cron: - description: Repopulates all cached data. url: /_cron schedule: every 5 minutes - target: 2-12-0 + target: 2-12-1 diff --git a/chrome/common/extensions/docs/server2/test_data/canned_data.py b/chrome/common/extensions/docs/server2/test_data/canned_data.py index befa2a7..c81dfa8 100644 --- a/chrome/common/extensions/docs/server2/test_data/canned_data.py +++ b/chrome/common/extensions/docs/server2/test_data/canned_data.py @@ -133,6 +133,11 @@ CANNED_API_FILE_SYSTEM_DATA = { 'declarativeContent': { 'channel': 'trunk' }, + 'declarativeWebRequest': [ + { 'channel': 'beta' }, + # whitelist + { 'channel': 'stable'} + ], 'falseBetaAPI': { 'channel': 'beta' }, @@ -218,6 +223,11 @@ CANNED_API_FILE_SYSTEM_DATA = { 'declarativeContent': { 'channel': 'trunk' }, + 'declarativeWebRequest': [ + { 'channel': 'beta' }, + # whitelist + { 'channel': 'stable'} + ], 'downloads': { 'channel': 'beta' } @@ -272,6 +282,11 @@ CANNED_API_FILE_SYSTEM_DATA = { 'declarativeContent': { 'channel': 'trunk' }, + 'declarativeWebRequest': [ + { 'channel': 'beta' }, + # whitelist + { 'channel': 'stable'} + ], 'downloads': { 'channel': 'dev' } @@ -318,6 +333,11 @@ CANNED_API_FILE_SYSTEM_DATA = { 'declarativeContent': { 'channel': 'trunk' }, + 'declarativeWebRequest': [ + { 'channel': 'beta' }, + # whitelist + { 'channel': 'stable'} + ], 'systemInfo.display': { 'channel': 'stable' } |