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

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

Issue 24149003: Port of github.com/polymer/polymer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 years, 3 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/test/attr_mustache_test.html ('k') | pkg/polymer/test/build/utils_test.dart » ('j') | 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 e4f3630f58dde7c1b47521a01c1b71d9b208a9fd..17975a85a6f906736ac02fd951e38d3acd81a043 100644
--- a/pkg/polymer/test/build/linter_test.dart
+++ b/pkg/polymer/test/build/linter_test.dart
@@ -261,7 +261,7 @@ void main() {
'JavaScript event handler. Use the form '
'on-event-name="handlerName" if you want a Dart handler '
'that will automatically update the UI based on model changes. '
- '(lib/test.html 1 0)'
+ '(lib/test.html 1 5)'
});
_testLinter('on-foo is only supported in polymer elements', {
@@ -272,7 +272,7 @@ void main() {
'a|lib/test.html.messages':
'warning: Inline event handlers are only supported inside '
'declarations of <polymer-element>. '
- '(lib/test.html 1 0)'
+ '(lib/test.html 1 5)'
});
_testLinter('on-foo is not an expression', {
@@ -285,7 +285,20 @@ void main() {
'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 1 28)'
+ '(lib/test.html 1 33)'
+ });
+
+ _testLinter('on-foo-bar is no longer supported', {
+ 'a|lib/test.html': '''<html><body>
+ <polymer-element name="x-a"><div on-foo-bar="quux"></div>
+ </polymer-element>
+ '''.replaceAll(' ', ''),
+ }, {
+ 'a|lib/test.html.messages':
+ 'warning: Invalid event name "on-foo-bar". After the "on-" the '
+ 'event name should not use dashes. For example use "on-fooBar" or '
+ '"on-foobar" (both forms are equivalent in HTML). '
+ '(lib/test.html 1 33)'
});
});
@@ -294,7 +307,7 @@ void main() {
'a|lib/test.html': '<x-foo></x-foo>',
}, {
'a|lib/test.html.messages':
- 'warning: definition for custom element with tag name "x-foo" not '
+ 'warning: definition for Polymer element with tag name "x-foo" not '
'found. (lib/test.html 0 0)'
});
@@ -302,7 +315,7 @@ void main() {
'a|lib/test.html': '<div is="x-foo"></div>',
}, {
'a|lib/test.html.messages':
- 'warning: definition for custom element with tag name "x-foo" not '
+ 'warning: definition for Polymer element with tag name "x-foo" not '
'found. (lib/test.html 0 0)'
});
@@ -409,6 +422,20 @@ void main() {
'to write <li is="x-a">? (lib/test.html 1 0)'
});
});
+
+ group('custom attributes', () {
+ _testLinter('foo-bar is no longer supported in attributes', {
+ 'a|lib/test.html': '''<html><body>
+ <polymer-element name="x-a" attributes="foo-bar">
+ </polymer-element>
+ '''.replaceAll(' ', ''),
+ }, {
+ 'a|lib/test.html.messages':
+ 'warning: PolymerElement no longer recognizes attribute names with '
+ 'dashes such as "foo-bar". Use "fooBar" or "foobar" instead (both '
+ 'forms are equivalent in HTML). (lib/test.html 1 28)'
+ });
+ });
}
_testLinter(String name, Map inputFiles, Map outputMessages) {
« no previous file with comments | « pkg/polymer/test/attr_mustache_test.html ('k') | pkg/polymer/test/build/utils_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698