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

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

Issue 23819036: Support for @mixin, @include and @extend (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: All changes ready to commit Created 7 years, 2 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/csslib/test/run_all.dart ('k') | pkg/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';
11 11
12 useMockMessages() { 12 useMockMessages() {
13 messages = new Messages(printHandler: (message) {}); 13 messages = new Messages(printHandler: (message) {});
14 } 14 }
15 15
16 /** 16 /**
17 * Spin-up CSS parser in checked mode to detect any problematic CSS. Normally, 17 * Spin-up CSS parser in checked mode to detect any problematic CSS. Normally,
18 * CSS will allow any property/value pairs regardless of validity; all of our 18 * CSS will allow any property/value pairs regardless of validity; all of our
19 * tests (by default) will ensure that the CSS is really valid. 19 * tests (by default) will ensure that the CSS is really valid.
20 */ 20 */
21 StyleSheet parseCss(String cssInput, {List errors, List opts}) => 21 StyleSheet parseCss(String cssInput, {List errors, List opts}) =>
22 parse(cssInput, errors: errors, options: opts == null ? 22 parse(cssInput, errors: errors, options: opts == null ?
23 ['--no-colors', '--checked', '--warnings_as_errors', 'memory'] : opts); 23 ['--no-colors', '--checked', '--warnings_as_errors', 'memory'] : opts);
24 24
25 /** 25 /**
26 * Spin-up CSS parser in checked mode to detect any problematic CSS. Normally, 26 * Spin-up CSS parser in checked mode to detect any problematic CSS. Normally,
27 * CSS will allow any property/value pairs regardless of validity; all of our 27 * CSS will allow any property/value pairs regardless of validity; all of our
28 * tests (by default) will ensure that the CSS is really valid. 28 * tests (by default) will ensure that the CSS is really valid.
29 */ 29 */
30 StyleSheet compileCss(String cssInput, 30 StyleSheet compileCss(String cssInput, {List errors, List opts,
31 {List errors, List opts, bool polyfill: false}) => 31 bool polyfill: false, List<StyleSheet> includes: null}) =>
32 compile(cssInput, errors: errors, options: opts == null ? 32 compile(cssInput, errors: errors, options: opts == null ?
33 ['--no-colors', '--checked', '--warnings_as_errors', 'memory'] : opts, 33 ['--no-colors', '--checked', '--warnings_as_errors', 'memory'] : opts,
34 polyfill: polyfill); 34 polyfill: polyfill, includes: includes);
35
36 StyleSheet polyFillCompileCss(input, {List errors, List opts}) =>
37 compileCss(input, errors: errors, polyfill: true, opts: opts);
35 38
36 /** CSS emitter walks the style sheet tree and emits readable CSS. */ 39 /** CSS emitter walks the style sheet tree and emits readable CSS. */
37 var _emitCss = new CssPrinter(); 40 var _emitCss = new CssPrinter();
38 41
39 /** Simple Visitor does nothing but walk tree. */ 42 /** Simple Visitor does nothing but walk tree. */
40 var _cssVisitor = new Visitor(); 43 var _cssVisitor = new Visitor();
41 44
42 /** Pretty printer for CSS. */ 45 /** Pretty printer for CSS. */
43 String prettyPrint(StyleSheet ss) { 46 String prettyPrint(StyleSheet ss) {
44 // Walk the tree testing basic Vistor class. 47 // Walk the tree testing basic Vistor class.
(...skipping 12 matching lines...) Expand all
57 } 60 }
58 61
59 /** Walks the style sheet tree does nothing; insures the basic walker works. */ 62 /** Walks the style sheet tree does nothing; insures the basic walker works. */
60 void walkTree(StyleSheet ss) { 63 void walkTree(StyleSheet ss) {
61 _cssVisitor..visitTree(ss); 64 _cssVisitor..visitTree(ss);
62 } 65 }
63 66
64 String dumpTree(StyleSheet ss) => treeToDebugString(ss); 67 String dumpTree(StyleSheet ss) => treeToDebugString(ss);
65 68
66 69
OLDNEW
« no previous file with comments | « pkg/csslib/test/run_all.dart ('k') | pkg/csslib/test/var_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698