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

Unified Diff: pkg/polymer/test/build/linter_test.dart

Issue 362553005: Check that script tag has at least src or inlined text, add unrelated test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | « pkg/polymer/lib/src/build/linter.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/test/build/linter_test.dart
diff --git a/pkg/polymer/test/build/linter_test.dart b/pkg/polymer/test/build/linter_test.dart
index e37131385613c5dba4b5c21a0d11d71a7577b752..ef05428037835abb486799ba1eb191b6331be2f5 100644
--- a/pkg/polymer/test/build/linter_test.dart
+++ b/pkg/polymer/test/build/linter_test.dart
@@ -405,6 +405,15 @@ void main() {
]);
});
+ _testLinter('script tags should have at least src url or inline code', {
+ 'a|lib/test.html': '''<html>
+ <script type="application/dart"></script>
+ </html>'''.replaceAll(' ', ''),
+ }, [
+ 'warning: script tag seems empty. '
+ '(lib/test.html 1 0)'
+ ]);
+
_testLinter('script tags should have only src url or inline code', {
'a|lib/test.html': '''<html>
<script type="application/dart" src="foo.dart">more</script>
@@ -431,6 +440,19 @@ void main() {
'(lib/test.html 1 5)'
]);
+ _testLinter('on-foo uses the {{ binding }} syntax', {
+ 'a|lib/test.html': '''<html><body>
+ <link rel="import" href="../../packages/polymer/polymer.html">
+ <polymer-element name="x-a"><div on-foo="bar"></div>
+ </polymer-element>
+ '''.replaceAll(' ', ''),
+ }, [
+ 'warning: Invalid event handler body "bar". Declare a method '
+ 'in your custom element "void handlerName(event, detail, target)" '
+ 'and use the form on-foo="{{handlerName}}". '
+ '(lib/test.html 2 33)'
+ ]);
+
_testLinter('on-foo is not an expression', {
'a|lib/test.html': '''<html><body>
<link rel="import" href="../../packages/polymer/polymer.html">
« no previous file with comments | « pkg/polymer/lib/src/build/linter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698