Adding the orphaned options pages to the navigation
[chromium-blink-merge.git] / chrome / common / extensions / docs / server2 / whats_new_data_source_test.py
blob9be3972e2120edd8053b33f70bed692a277a665a
1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 import json
7 import os
8 import unittest
9 import sys
11 from fake_host_file_system_provider import FakeHostFileSystemProvider
12 from server_instance import ServerInstance
13 from test_data.canned_data import CANNED_API_FILE_SYSTEM_DATA
14 from whats_new_data_source import WhatsNewDataSource
17 class WhatsNewDataSourceTest(unittest.TestCase):
18 def testCreateWhatsNewDataSource(self):
19 api_fs_creator = FakeHostFileSystemProvider(CANNED_API_FILE_SYSTEM_DATA)
20 server_instance = ServerInstance.ForTest(
21 file_system_provider=api_fs_creator)
23 whats_new_data_source = WhatsNewDataSource(server_instance, None)
24 expected_whats_new_changes_list = [
26 'version': 22,
27 'additionsToExistingApis': [{
28 'version': 22,
29 'type': 'additionsToExistingApis',
30 'id': 'backgroundpages.to-be-non-persistent',
31 'description': 'backgrounds to be non persistent'
36 'version': 21,
37 'additionsToExistingApis': [{
38 'version': 21,
39 'type': 'additionsToExistingApis',
40 'id': 'chromeSetting.set-regular-only-scope',
41 'description': 'ChromeSetting.set now has a regular_only scope.'
46 'version': 20,
47 'manifestChanges': [{
48 'version': 20,
49 'type': 'manifestChanges',
50 'id': 'manifest-v1-deprecated',
51 'description': 'Manifest version 1 was deprecated in Chrome 18'
57 expected_new_info_of_apps = [
59 'version': 26,
60 'apis': [{
61 'version': 26, 'type': 'apis',
62 'name': u'alarm',
63 'description': u'<code>alarm</code>'
66 'version': 26, 'type': 'apis',
67 'name': u'app.window',
68 'description': u'<code>app.window</code>'
73 expected_new_info_of_apps.extend(expected_whats_new_changes_list)
75 expected_new_info_of_extensions = [
77 'version': 26,
78 'apis': [{
79 'version': 26, 'type': 'apis',
80 'name': u'alarm',
81 'description': u'<code>alarm</code>'
84 'version': 26, 'type': 'apis',
85 'name': u'browserAction',
86 'description': u'<code>browserAction</code>'
91 expected_new_info_of_extensions.extend(expected_whats_new_changes_list)
93 whats_new_for_apps = whats_new_data_source.get('apps')
94 whats_new_for_extension = whats_new_data_source.get('extensions')
95 self.assertEqual(expected_new_info_of_apps, whats_new_for_apps)
96 self.assertEqual(expected_new_info_of_extensions, whats_new_for_extension)
98 if __name__ == '__main__':
99 unittest.main()