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

Side by Side Diff: third_party/pkg/angular/test/io/template_cache_generator_spec.dart

Issue 256553002: Revert "Update all Angular libs (run update_all.sh)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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
OLDNEW
1 library ng.tool.template_cache_generator_spec; 1 library ng.tool.template_cache_generator_spec;
2 2
3 import 'dart:async'; 3 import 'dart:async';
4 import 'dart:io'; 4 import 'dart:io';
5 5
6 import 'package:angular/tools/template_cache_generator.dart' as generator; 6 import 'package:angular/tools/template_cache_generator.dart' as generator;
7 import '../jasmine_syntax.dart'; 7 import '../jasmine_syntax.dart';
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 9
10 void main() { 10 main() => describe('template_cache_generator', () {
11 describe('template_cache_generator', () {
12 11
13 it('should correctly generate the templates cache file (template)', () { 12 it('should correctly generate the templates cache file (template)', () {
14 var tmpDir = Directory.systemTemp.createTempSync(); 13 var tmpDir = Directory.systemTemp.createTempSync();
15 Future flush; 14 Future flush;
16 try { 15 try {
17 flush = generator.main([ 16 flush = generator.main(['test/io/test_files/templates/main.dart',
18 '--out=${tmpDir.path}/generated.dart', 17 Platform.environment['DART_SDK'],
19 '--url-rewrites=/test/io/test_files,rewritten', 18 '${tmpDir.path}/generated.dart', 'generated',
20 '--skip-classes=MyComponent3', 19 '%SYSTEM_PACKAGE_ROOT%',
21 'test/io/test_files/templates/main.dart', 20 '/test/io/test_files,rewritten', 'MyComponent3']);
22 'generated']); 21 } catch(_) {
23 } catch(_) { 22 tmpDir.deleteSync(recursive: true);
24 tmpDir.deleteSync(recursive: true); 23 rethrow;
25 rethrow; 24 }
26 } 25 return flush.then((_) {
27 return flush.then((_) { 26 expect(new File('${tmpDir.path}/generated.dart').readAsStringSync(),
28 expect(new File('${tmpDir.path}/generated.dart').readAsStringSync(), 27 '// GENERATED, DO NOT EDIT!\n'
29 '// GENERATED, DO NOT EDIT!\n' 28 'library generated;\n'
30 'library generated;\n' 29 '\n'
31 '\n' 30 'import \'package:angular/angular.dart\';\n'
32 'import \'package:angular/angular.dart\';\n' 31 '\n'
33 '\n' 32 'primeTemplateCache(TemplateCache tc) {\n'
34 'primeTemplateCache(TemplateCache tc) {\n' 33 'tc.put("rewritten/templates/main.html", new HttpResponse(200, r"""Hel lo World!"""));\n'
35 'tc.put("rewritten/templates/main.html", new HttpResponse(200, r"""H ello World!"""));\n' 34 '}');
36 '}'); 35 }).whenComplete(() {
37 }).whenComplete(() { 36 tmpDir.deleteSync(recursive: true);
38 tmpDir.deleteSync(recursive: true);
39 });
40 }); 37 });
38 });
41 39
42 it('should correctly generate the templates cache file (css)', () { 40 it('should correctly generate the templates cache file (css)', () {
43 var tmpDir = Directory.systemTemp.createTempSync(); 41 var tmpDir = Directory.systemTemp.createTempSync();
44 Future flush; 42 Future flush;
45 try { 43 try {
46 flush = generator.main([ 44 flush = generator.main(['test/io/test_files/cssUrls/main.dart',
47 '--out=${tmpDir.path}/generated.dart', 45 Platform.environment['DART_SDK'],
48 '--url-rewrites=/test/io/test_files,rewritten', 46 '${tmpDir.path}/generated.dart', 'generated',
49 '--skip-classes=MyComponent3', 47 '%SYSTEM_PACKAGE_ROOT%',
50 'test/io/test_files/cssUrls/main.dart', 48 '/test/io/test_files,rewritten', 'MyComponent3']);
51 'generated']); 49 } catch(_) {
52 } catch(_) { 50 tmpDir.deleteSync(recursive: true);
53 tmpDir.deleteSync(recursive: true); 51 rethrow;
54 rethrow; 52 }
55 } 53 return flush.then((_) {
56 return flush.then((_) { 54 expect(new File('${tmpDir.path}/generated.dart').readAsStringSync(),
57 expect(new File('${tmpDir.path}/generated.dart').readAsStringSync(), 55 '// GENERATED, DO NOT EDIT!\n'
58 '// GENERATED, DO NOT EDIT!\n' 56 'library generated;\n'
59 'library generated;\n' 57 '\n'
60 '\n' 58 'import \'package:angular/angular.dart\';\n'
61 'import \'package:angular/angular.dart\';\n' 59 '\n'
62 '\n' 60 'primeTemplateCache(TemplateCache tc) {\n'
63 'primeTemplateCache(TemplateCache tc) {\n' 61 'tc.put("rewritten/cssUrls/one.css", new HttpResponse(200, r"""body {}""") );\n'
64 'tc.put("rewritten/cssUrls/one.css", new HttpResponse(200, r"""body {}"""));\n' 62 'tc.put("rewritten/cssUrls/three.css", new HttpResponse(200, r"""body {}"" "));\n'
65 'tc.put("rewritten/cssUrls/three.css", new HttpResponse(200, r"""bod y {}"""));\n' 63 'tc.put("rewritten/cssUrls/two.css", new HttpResponse(200, r"""body {}""") );\n'
66 'tc.put("rewritten/cssUrls/two.css", new HttpResponse(200, r"""body {}"""));\n' 64 '}');
67 '}'); 65 }).whenComplete(() {
68 }).whenComplete(() { 66 //tmpDir.deleteSync(recursive: true);
69 tmpDir.deleteSync(recursive: true);
70 });
71 }); 67 });
68 });
72 69
73 70
74 }); 71 });
75 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698