Index: tools/json_schema_compiler/js_externs_generator_test.py |
diff --git a/tools/json_schema_compiler/js_externs_generator_test.py b/tools/json_schema_compiler/js_externs_generator_test.py |
index cdf49301c7b7372a99a401d2212f6e22d3e39356..20a1d1a81237f8bce2295d92eb1711bf539e5e48 100755 |
--- a/tools/json_schema_compiler/js_externs_generator_test.py |
+++ b/tools/json_schema_compiler/js_externs_generator_test.py |
@@ -11,19 +11,6 @@ import model |
import sys |
import unittest |
-COPYRIGHT = ("""// Copyright %s 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. |
-""" % datetime.now().year) |
- |
-INFO = """// This file was generated by: |
-// %s. |
-// NOTE: The format of types has changed. 'FooType' is now |
-// 'chrome.%s.FooType'. |
-// Please run the closure compiler before committing changes. |
-// See https://code.google.com/p/chromium/wiki/ClosureCompilation. |
-""" |
- |
# The contents of a fake idl file. |
fake_idl = """ |
// Copyright 2014 The Chromium Authors. All rights reserved. |
@@ -85,8 +72,7 @@ namespace fakeApi { |
""" |
# The output we expect from our fake idl file. |
-expected_output = COPYRIGHT + "\n" + (INFO % (sys.argv[0], "fakeApi")) + """ |
-/** @fileoverview Externs generated from namespace: fakeApi */ |
+expected_output = JsExternsGenerator.GetHeader(sys.argv[0], 'fakeApi') + """ |
Devlin
2015/12/07 18:55:27
I slightly prefer having this hard-coded, even if
stevenjb
2015/12/07 19:49:32
Sigh. The previous way isn't any better IMHO becau
|
/** |
* @const |
@@ -161,8 +147,7 @@ chrome.fakeApi.returnString = function() {}; |
* @type {!ChromeEvent} |
* @see https://developer.chrome.com/extensions/fakeApi#event-onTrapDetected |
*/ |
-chrome.fakeApi.onTrapDetected; |
-""" |
+chrome.fakeApi.onTrapDetected;""" |
fake_json = """// Copyright 2014 The Chromium Authors. All rights reserved. |
@@ -235,8 +220,7 @@ fake_json = """// Copyright 2014 The Chromium Authors. All rights reserved. |
} |
]""" |
-json_expected = COPYRIGHT + "\n" + (INFO % (sys.argv[0], "fakeJson")) + """ |
-/** @fileoverview Externs generated from namespace: fakeJson */ |
+json_expected = JsExternsGenerator.GetHeader(sys.argv[0], 'fakeJson') + """ |
/** |
* @const |
@@ -272,8 +256,7 @@ chrome.fakeJson.CrazyEnum = { |
* }} |
* @see https://developer.chrome.com/extensions/fakeJson#method-funcWithInlineObj |
*/ |
-chrome.fakeJson.funcWithInlineObj = function(inlineObj, callback) {}; |
-""" |
+chrome.fakeJson.funcWithInlineObj = function(inlineObj, callback) {};""" |
class JsExternGeneratorTest(unittest.TestCase): |