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

Side by Side Diff: packages/csslib/test/testing.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 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 | « packages/csslib/test/selector_test.dart ('k') | packages/csslib/test/var_test.dart » ('j') | 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 'package:csslib/parser.dart'; 8 import 'package:csslib/parser.dart';
9 import 'package:csslib/visitor.dart'; 9 import 'package:csslib/visitor.dart';
10 import 'package:csslib/src/messages.dart'; 10 import 'package:csslib/src/messages.dart';
(...skipping 12 matching lines...) Expand all
23 23
24 const options = const PreprocessorOptions( 24 const options = const PreprocessorOptions(
25 useColors: false, warningsAsErrors: true, inputFile: 'memory'); 25 useColors: false, warningsAsErrors: true, inputFile: 'memory');
26 26
27 /** 27 /**
28 * Spin-up CSS parser in checked mode to detect any problematic CSS. Normally, 28 * Spin-up CSS parser in checked mode to detect any problematic CSS. Normally,
29 * CSS will allow any property/value pairs regardless of validity; all of our 29 * CSS will allow any property/value pairs regardless of validity; all of our
30 * tests (by default) will ensure that the CSS is really valid. 30 * tests (by default) will ensure that the CSS is really valid.
31 */ 31 */
32 StyleSheet parseCss(String cssInput, 32 StyleSheet parseCss(String cssInput,
33 {List<Message> errors, PreprocessorOptions opts}) => parse(cssInput, 33 {List<Message> errors, PreprocessorOptions opts}) =>
34 parse(cssInput,
34 errors: errors, 35 errors: errors,
35 options: opts == null 36 options:
36 ? simpleOptionsWithCheckedAndWarningsAsErrors 37 opts == null ? simpleOptionsWithCheckedAndWarningsAsErrors : opts);
37 : opts);
38 38
39 /** 39 /**
40 * Spin-up CSS parser in checked mode to detect any problematic CSS. Normally, 40 * Spin-up CSS parser in checked mode to detect any problematic CSS. Normally,
41 * CSS will allow any property/value pairs regardless of validity; all of our 41 * CSS will allow any property/value pairs regardless of validity; all of our
42 * tests (by default) will ensure that the CSS is really valid. 42 * tests (by default) will ensure that the CSS is really valid.
43 */ 43 */
44 StyleSheet compileCss(String cssInput, {List<Message> errors, 44 StyleSheet compileCss(String cssInput,
45 PreprocessorOptions opts, bool polyfill: false, 45 {List<Message> errors,
46 List<StyleSheet> includes: null}) => compile(cssInput, 46 PreprocessorOptions opts,
47 bool polyfill: false,
48 List<StyleSheet> includes: null}) =>
49 compile(cssInput,
47 errors: errors, 50 errors: errors,
48 options: opts == null 51 options:
49 ? simpleOptionsWithCheckedAndWarningsAsErrors 52 opts == null ? simpleOptionsWithCheckedAndWarningsAsErrors : opts,
50 : opts,
51 polyfill: polyfill, 53 polyfill: polyfill,
52 includes: includes); 54 includes: includes);
53 55
54 StyleSheet polyFillCompileCss(input, 56 StyleSheet polyFillCompileCss(input,
55 {List<Message> errors, PreprocessorOptions opts}) => 57 {List<Message> errors, PreprocessorOptions opts}) =>
56 compileCss(input, errors: errors, polyfill: true, opts: opts); 58 compileCss(input, errors: errors, polyfill: true, opts: opts);
57 59
58 /** CSS emitter walks the style sheet tree and emits readable CSS. */ 60 /** CSS emitter walks the style sheet tree and emits readable CSS. */
59 final _emitCss = new CssPrinter(); 61 final _emitCss = new CssPrinter();
60 62
(...skipping 16 matching lines...) Expand all
77 walkTree(ss); 79 walkTree(ss);
78 return (_emitCss..visitTree(ss, pretty: false)).toString(); 80 return (_emitCss..visitTree(ss, pretty: false)).toString();
79 } 81 }
80 82
81 /** Walks the style sheet tree does nothing; insures the basic walker works. */ 83 /** Walks the style sheet tree does nothing; insures the basic walker works. */
82 void walkTree(StyleSheet ss) { 84 void walkTree(StyleSheet ss) {
83 _cssVisitor..visitTree(ss); 85 _cssVisitor..visitTree(ss);
84 } 86 }
85 87
86 String dumpTree(StyleSheet ss) => treeToDebugString(ss); 88 String dumpTree(StyleSheet ss) => treeToDebugString(ss);
OLDNEW
« no previous file with comments | « packages/csslib/test/selector_test.dart ('k') | packages/csslib/test/var_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698