Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/api_data_source_test.py |
| 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 478226df0c3b985e88ace95e1f9380cfba93df10..0f36502d66060ccc5a1a596b8edbcce488eeb7d3 100755 |
| --- a/chrome/common/extensions/docs/server2/api_data_source_test.py |
| +++ b/chrome/common/extensions/docs/server2/api_data_source_test.py |
| @@ -42,6 +42,12 @@ class _FakeAvailabilityFinder(object): |
| return ChannelInfo('stable', '396', 5) |
| +class _FakeScheduledAvailabilityFinder(object): |
| + |
| + def GetApiAvailability(self, version): |
| + return ChannelInfo('dev', '1500', 28, 28) |
| + |
| + |
| class _FakeTemplateCache(object): |
| def GetFromFile(self, key): |
| @@ -142,7 +148,54 @@ class APIDataSourceTest(unittest.TestCase): |
| 'content': [ |
| { 'partial': 'handlebar chrome/common/extensions/docs/' + |
| 'templates/private/intro_tables/stable_message.html', |
| - 'version': 5 |
| + 'version': 5, |
| + 'scheduled': None |
| + } |
| + ] |
| + }, |
| + { 'title': 'Permissions', |
| + 'content': [ |
| + { 'class': 'override', |
| + 'text': '"tester"' |
| + }, |
| + { 'text': 'is an API for testing things.' } |
| + ] |
| + }, |
| + { 'title': 'Manifest', |
| + 'content': [ |
| + { 'class': 'code', |
| + 'text': '"tester": {...}' |
| + } |
| + ] |
| + }, |
| + { 'title': 'Learn More', |
| + 'content': [ |
| + { 'link': 'https://tester.test.com/welcome.html', |
| + 'text': 'Welcome!' |
| + } |
| + ] |
| + } |
| + ] |
| + self.assertEquals(model._GetIntroTableList(), expected_list) |
| + |
| + model = _JSCModel(self._api_models.GetModel('tester').Get(), |
| + _FakeScheduledAvailabilityFinder(), |
| + self._json_cache, |
| + _FakeTemplateCache(), |
| + self._features_bundle, |
| + None) |
| + expected_list = [ |
|
jshumway
2014/04/25 21:34:43
Since only the second item in the list has changed
danielj41
2014/04/25 22:24:49
Done.
|
| + { 'title': 'Description', |
| + 'content': [ |
| + { 'text': 'a test api' } |
| + ] |
| + }, |
| + { 'title': 'Availability', |
| + 'content': [ |
| + { 'partial': 'handlebar chrome/common/extensions/docs/' + |
| + 'templates/private/intro_tables/dev_message.html', |
| + 'version': 28, |
| + 'scheduled': 28 |
| } |
| ] |
| }, |