| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library polymer.test.linter_test; | 5 library polymer.test.linter_test; |
| 6 | 6 |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:polymer/src/build/common.dart'; | 9 import 'package:polymer/src/build/common.dart'; |
| 10 import 'package:polymer/src/build/linter.dart'; | 10 import 'package:polymer/src/build/linter.dart'; |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 '(lib/test.html 1 0)' | 431 '(lib/test.html 1 0)' |
| 432 ]); | 432 ]); |
| 433 | 433 |
| 434 group('event handlers', () { | 434 group('event handlers', () { |
| 435 _testLinter('no longer warn about inline onfoo (Javascript)', { | 435 _testLinter('no longer warn about inline onfoo (Javascript)', { |
| 436 'a|lib/test.html': '''<html><body> | 436 'a|lib/test.html': '''<html><body> |
| 437 <div onfoo="something"></div> | 437 <div onfoo="something"></div> |
| 438 '''.replaceAll(' ', ''), | 438 '''.replaceAll(' ', ''), |
| 439 }, []); | 439 }, []); |
| 440 | 440 |
| 441 _testLinter('no longer warn about on-foo for auto-binding templates', { |
| 442 'a|lib/test.html': '''<html><body> |
| 443 <template is="auto-binding-dart"> |
| 444 <div on-foo="{{something}}"></div> |
| 445 </template> |
| 446 '''.replaceAll(' ', ''), |
| 447 }, []); |
| 448 |
| 441 _testLinter('on-foo is only supported in polymer elements', { | 449 _testLinter('on-foo is only supported in polymer elements', { |
| 442 'a|lib/test.html': '''<html><body> | 450 'a|lib/test.html': '''<html><body> |
| 443 <div on-foo="something"></div> | 451 <div on-foo="something"></div> |
| 444 '''.replaceAll(' ', ''), | 452 '''.replaceAll(' ', ''), |
| 445 }, [ | 453 }, [ |
| 446 'warning: Inline event handlers are only supported inside ' | 454 'warning: Inline event handlers are only supported inside ' |
| 447 'declarations of <polymer-element>. ' | 455 'declarations of <polymer-element>. ' |
| 448 '(lib/test.html 1 5)' | 456 '(lib/test.html 1 5)' |
| 449 ]); | 457 ]); |
| 450 | 458 |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 } | 779 } |
| 772 if (outputMessages.isEmpty) { | 780 if (outputMessages.isEmpty) { |
| 773 var linter = new Linter(new TransformOptions()); | 781 var linter = new Linter(new TransformOptions()); |
| 774 testPhases(name, [[linter]], inputFiles, outputFiles, outputMessages, solo); | 782 testPhases(name, [[linter]], inputFiles, outputFiles, outputMessages, solo); |
| 775 } else { | 783 } else { |
| 776 testLogOutput( | 784 testLogOutput( |
| 777 (options) => new Linter(options), name, inputFiles, outputFiles, | 785 (options) => new Linter(options), name, inputFiles, outputFiles, |
| 778 outputMessages, solo); | 786 outputMessages, solo); |
| 779 } | 787 } |
| 780 } | 788 } |
| OLD | NEW |