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

Side by Side Diff: pkg/polymer/test/build/linter_test.dart

Issue 783393005: fix logic for detecting when in an auto-binding element (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 6 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/polymer/pubspec.yaml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 _testLinter('no longer warn about inline onfoo (Javascript)', { 470 _testLinter('no longer warn about inline onfoo (Javascript)', {
471 'a|lib/test.html': '''<html><body> 471 'a|lib/test.html': '''<html><body>
472 <div onfoo="something"></div> 472 <div onfoo="something"></div>
473 '''.replaceAll(' ', ''), 473 '''.replaceAll(' ', ''),
474 }, []); 474 }, []);
475 475
476 _testLinter('no longer warn about on-foo for auto-binding templates', { 476 _testLinter('no longer warn about on-foo for auto-binding templates', {
477 'a|lib/test.html': '''<html><body> 477 'a|lib/test.html': '''<html><body>
478 <template is="auto-binding-dart"> 478 <template is="auto-binding-dart">
479 <div on-foo="{{something}}"></div> 479 <div on-foo="{{something}}"></div>
480 <template>
481 <div>foo</div>
482 </template>
483 <div on-foo="{{something}}"></div>
480 </template> 484 </template>
481 '''.replaceAll(' ', ''), 485 '''.replaceAll(' ', ''),
482 }, []); 486 }, []);
483 487
484 _testLinter('on-foo is only supported in polymer elements', { 488 _testLinter('on-foo is only supported in polymer elements', {
485 'a|lib/test.html': '''<html><body> 489 'a|lib/test.html': '''<html><body>
486 <div on-foo="something"></div> 490 <div on-foo="{{something}}"></div>
487 '''.replaceAll(' ', ''), 491 '''.replaceAll(' ', ''),
488 }, [ 492 }, [
489 'warning: ${EVENT_HANDLERS_ONLY_WITHIN_POLYMER.snippet} ' 493 'warning: ${EVENT_HANDLERS_ONLY_WITHIN_POLYMER.snippet} '
490 '(lib/test.html 1 5)' 494 '(lib/test.html 1 5)'
491 ]); 495 ]);
492 496
493 _testLinter('on-foo uses the {{ binding }} syntax', { 497 _testLinter('on-foo uses the {{ binding }} syntax', {
494 'a|lib/test.html': '''<html><body> 498 'a|lib/test.html': '''<html><body>
495 <link rel="import" href="../../packages/polymer/polymer.html"> 499 <link rel="import" href="../../packages/polymer/polymer.html">
496 <polymer-element name="x-a"><div on-foo="bar"></div> 500 <polymer-element name="x-a"><div on-foo="bar"></div>
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 } 844 }
841 if (outputMessages.isEmpty) { 845 if (outputMessages.isEmpty) {
842 var linter = new Linter(new TransformOptions()); 846 var linter = new Linter(new TransformOptions());
843 testPhases(name, [[linter]], inputFiles, outputFiles, outputMessages, solo); 847 testPhases(name, [[linter]], inputFiles, outputFiles, outputMessages, solo);
844 } else { 848 } else {
845 testLogOutput( 849 testLogOutput(
846 (options) => new Linter(options), name, inputFiles, outputFiles, 850 (options) => new Linter(options), name, inputFiles, outputFiles,
847 outputMessages, solo); 851 outputMessages, solo);
848 } 852 }
849 } 853 }
OLDNEW
« no previous file with comments | « pkg/polymer/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698