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

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

Issue 176943008: Update the Angular/DI tests to latest from github. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 main() => describe('template_cache_generator', () { 10 main() => describe('template_cache_generator', () {
11 it('should correctly generate the templates cache file', () { 11
12 it('should correctly generate the templates cache file (template)', () {
12 var tmpDir = Directory.systemTemp.createTempSync(); 13 var tmpDir = Directory.systemTemp.createTempSync();
13 Future flush; 14 Future flush;
14 try { 15 try {
15 flush = generator.main(['test/io/test_files/templates/main.dart', 16 flush = generator.main(['test/io/test_files/templates/main.dart',
16 '${tmpDir.path}/generated.dart', 'generated', '%SYSTEM_PAC KAGE_ROOT%', 17 Platform.environment['DART_SDK'],
17 'test/io/test_files,rewritten', 'MyComponent3']); 18 '${tmpDir.path}/generated.dart', 'generated',
19 '%SYSTEM_PACKAGE_ROOT%',
20 '/test/io/test_files,rewritten', 'MyComponent3']);
18 } catch(_) { 21 } catch(_) {
19 tmpDir.deleteSync(recursive: true); 22 tmpDir.deleteSync(recursive: true);
20 rethrow; 23 rethrow;
21 } 24 }
22 return flush.then((_) { 25 return flush.then((_) {
23 expect(new File('${tmpDir.path}/generated.dart').readAsStringSync(), 26 expect(new File('${tmpDir.path}/generated.dart').readAsStringSync(),
24 '// GENERATED, DO NOT EDIT!\n' 27 '// GENERATED, DO NOT EDIT!\n'
25 'library generated;\n' 28 'library generated;\n'
26 '\n' 29 '\n'
27 'import \'package:angular/angular.dart\';\n' 30 'import \'package:angular/angular.dart\';\n'
28 '\n' 31 '\n'
29 'primeTemplateCache(TemplateCache tc) {\n' 32 'primeTemplateCache(TemplateCache tc) {\n'
30 'tc.put("rewritten/templates/main.html", new HttpResponse(200, r"""Hell o World!"""));\n' 33 'tc.put("rewritten/templates/main.html", new HttpResponse(200, r"""Hel lo World!"""));\n'
31 '}'); 34 '}');
32 }).whenComplete(() { 35 }).whenComplete(() {
33 tmpDir.deleteSync(recursive: true); 36 tmpDir.deleteSync(recursive: true);
34 }); 37 });
35 }); 38 });
39
40 it('should correctly generate the templates cache file (css)', () {
41 var tmpDir = Directory.systemTemp.createTempSync();
42 Future flush;
43 try {
44 flush = generator.main(['test/io/test_files/cssUrls/main.dart',
45 Platform.environment['DART_SDK'],
46 '${tmpDir.path}/generated.dart', 'generated',
47 '%SYSTEM_PACKAGE_ROOT%',
48 '/test/io/test_files,rewritten', 'MyComponent3']);
49 } catch(_) {
50 tmpDir.deleteSync(recursive: true);
51 rethrow;
52 }
53 return flush.then((_) {
54 expect(new File('${tmpDir.path}/generated.dart').readAsStringSync(),
55 '// GENERATED, DO NOT EDIT!\n'
56 'library generated;\n'
57 '\n'
58 'import \'package:angular/angular.dart\';\n'
59 '\n'
60 'primeTemplateCache(TemplateCache tc) {\n'
61 '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'
63 'tc.put("rewritten/cssUrls/two.css", new HttpResponse(200, r"""body {}""") );\n'
64 '}');
65 }).whenComplete(() {
66 //tmpDir.deleteSync(recursive: true);
67 });
68 });
69
70
36 }); 71 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698