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

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

Issue 423713005: add support for _* versions of the url-like attributes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: added tests and shortened link Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/polymer/lib/src/build/import_inliner.dart ('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.build.import_inliner_test; 5 library polymer.test.build.import_inliner_test;
6 6
7 import 'dart:convert' show JSON; 7 import 'dart:convert' show JSON;
8 import 'package:polymer/src/build/common.dart'; 8 import 'package:polymer/src/build/common.dart';
9 import 'package:polymer/src/build/import_inliner.dart'; 9 import 'package:polymer/src/build/import_inliner.dart';
10 import 'package:unittest/compact_vm_config.dart'; 10 import 'package:unittest/compact_vm_config.dart';
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 'a|web/foo/test.html': 876 'a|web/foo/test.html':
877 '<img src="baz/{{bar}}">' 877 '<img src="baz/{{bar}}">'
878 '<img src="./{{bar}}">', 878 '<img src="./{{bar}}">',
879 }, { 879 }, {
880 'a|web/test.html': 880 'a|web/test.html':
881 '<!DOCTYPE html><html><head></head><body>' 881 '<!DOCTYPE html><html><head></head><body>'
882 '<img src="foo/baz/{{bar}}">' 882 '<img src="foo/baz/{{bar}}">'
883 '<img src="foo/{{bar}}">' 883 '<img src="foo/{{bar}}">'
884 '</body></html>', 884 '</body></html>',
885 }); 885 });
886
887 testPhases('relative paths in _* attributes are normalized', phases, {
888 'a|web/test.html':
889 '<!DOCTYPE html><html><head>'
890 '<link rel="import" href="foo/test.html">'
891 '</head></html>',
892 'a|web/foo/test.html':
893 '<img _src="./{{bar}}">'
894 '<a _href="./{{bar}}">test</a>',
895 }, {
896 'a|web/test.html':
897 '<!DOCTYPE html><html><head></head><body>'
898 '<img _src="foo/{{bar}}">'
899 '<a _href="foo/{{bar}}">test</a>'
900 '</body></html>',
901 });
902
903 testPhases('warnings are given about _* attributes', phases, {
904 'a|web/test.html':
905 '<!DOCTYPE html><html><head></head><body>'
906 '<img src="foo/{{bar}}">'
907 '<a _href="foo/bar">test</a>'
908 '</body></html>',
909 }, {}, [
910 'warning: When using bindings with the "src" attribute you may '
911 'experience errors in certain browsers. Please use the "_src" '
912 'attribute instead. For more information, see http://goo.gl/5av8cU '
913 '(web/test.html 0 40)',
914 'warning: The "_href" attribute is only supported when using bindings. '
915 'Please change to the "href" attribute. (web/test.html 0 63)',
916
917 ]);
886 } 918 }
887 919
888 void entryPointTests() { 920 void entryPointTests() {
889 testPhases('one level deep entry points normalize correctly', phases, { 921 testPhases('one level deep entry points normalize correctly', phases, {
890 'a|web/test/test.html': 922 'a|web/test/test.html':
891 '<!DOCTYPE html><html><head>' 923 '<!DOCTYPE html><html><head>'
892 '<link rel="import" href="../../packages/a/foo/foo.html">' 924 '<link rel="import" href="../../packages/a/foo/foo.html">'
893 '</head></html>', 925 '</head></html>',
894 'a|lib/foo/foo.html': 926 'a|lib/foo/foo.html':
895 '<script rel="import" href="../../../packages/b/bar/bar.js">' 927 '<script rel="import" href="../../../packages/b/bar/bar.js">'
(...skipping 30 matching lines...) Expand all
926 '<script rel="import" href="../../../packages/b/bar/bar.js"></script>', 958 '<script rel="import" href="../../../packages/b/bar/bar.js"></script>',
927 'b|lib/bar/bar.js': 959 'b|lib/bar/bar.js':
928 'console.log("here");', 960 'console.log("here");',
929 }, { 961 }, {
930 'a|web/test/well/test.html': 962 'a|web/test/well/test.html':
931 '<!DOCTYPE html><html><head></head><body>' 963 '<!DOCTYPE html><html><head></head><body>'
932 '<script rel="import" href="../../packages/b/bar/bar.js"></script>' 964 '<script rel="import" href="../../packages/b/bar/bar.js"></script>'
933 '</body></html>', 965 '</body></html>',
934 }); 966 });
935 } 967 }
OLDNEW
« no previous file with comments | « pkg/polymer/lib/src/build/import_inliner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698