OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package com.google.javascript.jscomp; | 5 package com.google.javascript.jscomp; |
6 | 6 |
7 /** | 7 /** |
8 * Tests {@link ChromePass}. | 8 * Tests {@link ChromePass}. |
9 */ | 9 */ |
10 public class ChromePassTest extends CompilerTestCase { | 10 public class ChromePassTest extends CompilerTestCase { |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 212 |
213 public void testCrDefinePropertyDefinesUnquotedPropertyWithAnyTypeForPropert
yKindJs() | 213 public void testCrDefinePropertyDefinesUnquotedPropertyWithAnyTypeForPropert
yKindJs() |
214 throws Exception { | 214 throws Exception { |
215 test( | 215 test( |
216 "cr.defineProperty(a.prototype, 'c', cr.PropertyKind.JS);", | 216 "cr.defineProperty(a.prototype, 'c', cr.PropertyKind.JS);", |
217 "cr.defineProperty(a.prototype, 'c', cr.PropertyKind.JS);\n" + | 217 "cr.defineProperty(a.prototype, 'c', cr.PropertyKind.JS);\n" + |
218 "/** @type {?} */\n" + | 218 "/** @type {?} */\n" + |
219 "a.prototype.c;"); | 219 "a.prototype.c;"); |
220 } | 220 } |
221 | 221 |
| 222 public void testCrDefinePropertyCalledWithouthThirdArgumentMeansCrPropertyKi
ndJs() |
| 223 throws Exception { |
| 224 test( |
| 225 "cr.defineProperty(a.prototype, 'c');", |
| 226 "cr.defineProperty(a.prototype, 'c');\n" + |
| 227 "/** @type {?} */\n" + |
| 228 "a.prototype.c;"); |
| 229 } |
| 230 |
222 public void testCrDefinePropertyDefinesUnquotedPropertyOnPrototypeWhenFuncti
onIsPassed() | 231 public void testCrDefinePropertyDefinesUnquotedPropertyOnPrototypeWhenFuncti
onIsPassed() |
223 throws Exception { | 232 throws Exception { |
224 test( | 233 test( |
225 "cr.defineProperty(a, 'c', cr.PropertyKind.JS);", | 234 "cr.defineProperty(a, 'c', cr.PropertyKind.JS);", |
226 "cr.defineProperty(a, 'c', cr.PropertyKind.JS);\n" + | 235 "cr.defineProperty(a, 'c', cr.PropertyKind.JS);\n" + |
227 "/** @type {?} */\n" + | 236 "/** @type {?} */\n" + |
228 "a.prototype.c;"); | 237 "a.prototype.c;"); |
229 } | 238 } |
230 | 239 |
231 public void testCrDefinePropertyInvalidPropertyKind() | 240 public void testCrDefinePropertyInvalidPropertyKind() |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 "cr.define('cr.ui', function() {\n" + | 302 "cr.define('cr.ui', function() {\n" + |
294 " return {};\n" + | 303 " return {};\n" + |
295 "});"); | 304 "});"); |
296 } | 305 } |
297 | 306 |
298 public void testCrExportPathInvalidNumberOfArguments() throws Exception { | 307 public void testCrExportPathInvalidNumberOfArguments() throws Exception { |
299 test("cr.exportPath();", null, ChromePass.CR_EXPORT_PATH_WRONG_NUMBER_OF
_ARGUMENTS); | 308 test("cr.exportPath();", null, ChromePass.CR_EXPORT_PATH_WRONG_NUMBER_OF
_ARGUMENTS); |
300 } | 309 } |
301 | 310 |
302 } | 311 } |
OLD | NEW |