Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1159)

Unified Diff: chrome/common/extensions/docs/server2/api_list_data_source_test.py

Issue 189123002: Docserver: Correctly disambiguate between what 'platform' means in a features (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup debugging Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/app.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/api_list_data_source_test.py
diff --git a/chrome/common/extensions/docs/server2/api_list_data_source_test.py b/chrome/common/extensions/docs/server2/api_list_data_source_test.py
index 7c197c32a495c225fa5e331d598251eca1077d04..de7b6052edec54c5c94fc7cd41da3677cb5549cc 100755
--- a/chrome/common/extensions/docs/server2/api_list_data_source_test.py
+++ b/chrome/common/extensions/docs/server2/api_list_data_source_test.py
@@ -2,37 +2,49 @@
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+
import unittest
import json
+
from api_list_data_source import APIListDataSource
from extensions_paths import EXTENSIONS
from server_instance import ServerInstance
from test_file_system import TestFileSystem
+
def _ToTestData(obj):
'''Transforms |obj| into test data by turning a list of files into an object
mapping that file to its contents (derived from its name).
'''
return dict((name, name) for name in obj)
+
def _ToTestFeatures(names):
'''Transforms a list of strings into a minimal JSON features object.
'''
- features = dict((name, {'name': name, 'platforms': platforms})
- for name, platforms, in names)
+ def platforms_to_extension_types(platforms):
+ return ['platform_app' if platform == 'apps' else 'extension'
+ for platform in platforms]
+ features = dict((name, {
+ 'name': name,
+ 'extension_types': platforms_to_extension_types(platforms),
+ }) for name, platforms in names)
features['sockets.udp']['channel'] = 'dev'
return features
+
def _ToTestApiData(names):
api_data = dict((name, [{'namespace': name, 'description': description}])
for name, description in names)
return api_data
+
def _ToTestApiSchema(names, apis):
for name, json_file in names:
apis['api'][json_file] = json.dumps(_TEST_API_DATA[name])
return apis
+
_TEST_API_FEATURES = _ToTestFeatures([
('alarms', ['apps', 'extensions']),
('app.window', ['apps']),
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/app.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698