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

Side by Side Diff: test/testing.dart

Issue 22962005: Merge pull request #581 from kevmoo/polymer (Closed) Base URL: https://github.com/dart-lang/web-ui.git@polymer
Patch Set: Created 7 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
« no previous file with comments | « test/run_all.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** Common definitions used for setting up the test environment. */ 5 /** Common definitions used for setting up the test environment. */
6 library testing; 6 library testing;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 for (var file in files) { 57 for (var file in files) {
58 var path = file.path; 58 var path = file.path;
59 result[path] = analyzeDefinitions(global, new UrlInfo(path, path, null), 59 result[path] = analyzeDefinitions(global, new UrlInfo(path, path, null),
60 file.document, packageRoot, messages); 60 file.document, packageRoot, messages);
61 } 61 }
62 62
63 // analyze file contents 63 // analyze file contents
64 var uniqueIds = new IntIterator(); 64 var uniqueIds = new IntIterator();
65 var pseudoElements = new Map(); 65 var pseudoElements = new Map();
66 for (var file in files) { 66 for (var file in files) {
67 analyzeFile(file, result, uniqueIds, pseudoElements, messages); 67 analyzeFile(file, result, uniqueIds, pseudoElements, messages, true);
68 } 68 }
69 return result; 69 return result;
70 } 70 }
71 71
72 Compiler createCompiler(Map files, Messages messages, {bool errors: false}) { 72 Compiler createCompiler(Map files, Messages messages, {bool errors: false,
73 bool scopedCss: false}) {
73 List baseOptions = ['--no-colors', '-o', 'out', 'index.html']; 74 List baseOptions = ['--no-colors', '-o', 'out', 'index.html'];
74 if (errors) baseOptions.insert(0, '--warnings_as_errors'); 75 if (errors) baseOptions.insert(0, '--warnings_as_errors');
76 if (scopedCss) baseOptions.insert(0, '--scoped-css');
75 var options = CompilerOptions.parse(baseOptions); 77 var options = CompilerOptions.parse(baseOptions);
76 var fs = new MockFileSystem(files); 78 var fs = new MockFileSystem(files);
77 return new Compiler(fs, options, messages); 79 return new Compiler(fs, options, messages);
78 } 80 }
79 81
80 String prettyPrintCss(StyleSheet styleSheet) => 82 String prettyPrintCss(StyleSheet styleSheet) =>
81 ((new CssPrinter())..visitTree(styleSheet)).toString(); 83 ((new CssPrinter())..visitTree(styleSheet)).toString();
82 84
83 /** 85 /**
84 * Abstraction around file system access to work in a variety of different 86 * Abstraction around file system access to work in a variety of different
(...skipping 15 matching lines...) Expand all
100 } else { 102 } else {
101 return new Future.error( 103 return new Future.error(
102 new FileException('MockFileSystem: $path not found')); 104 new FileException('MockFileSystem: $path not found'));
103 } 105 }
104 } 106 }
105 107
106 // Compiler doesn't call these 108 // Compiler doesn't call these
107 void writeString(String outfile, String text) {} 109 void writeString(String outfile, String text) {}
108 Future flush() {} 110 Future flush() {}
109 } 111 }
OLDNEW
« no previous file with comments | « test/run_all.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698