| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library polymer.test.build.common; | 5 library polymer.test.build.common; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:barback/barback.dart'; | 9 import 'package:barback/barback.dart'; |
| 10 import 'package:stack_trace/stack_trace.dart'; | 10 import 'package:stack_trace/stack_trace.dart'; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 Future<Asset> getAsset(AssetId id) => | 39 Future<Asset> getAsset(AssetId id) => |
| 40 new Future.value(new Asset.fromString(id, files[idToString(id)])); | 40 new Future.value(new Asset.fromString(id, files[idToString(id)])); |
| 41 TestHelper(List<List<Transformer>> transformers, Map<String, String> files) | 41 TestHelper(List<List<Transformer>> transformers, Map<String, String> files) |
| 42 : files = files, | 42 : files = files, |
| 43 packages = files.keys.map((s) => idFromString(s).package) { | 43 packages = files.keys.map((s) => idFromString(s).package) { |
| 44 barback = new Barback(this); | 44 barback = new Barback(this); |
| 45 for (var p in packages) { | 45 for (var p in packages) { |
| 46 barback.updateTransformers(p, transformers); | 46 barback.updateTransformers(p, transformers); |
| 47 } | 47 } |
| 48 errorSubscription = barback.errors.listen((e) { | 48 errorSubscription = barback.errors.listen((e) { |
| 49 var trace = getAttachedStackTrace(e); | 49 var trace = null; |
| 50 if (e is Error) trace = e.stackTrace; |
| 50 if (trace != null) { | 51 if (trace != null) { |
| 51 print(Trace.format(trace)); | 52 print(Trace.format(trace)); |
| 52 } | 53 } |
| 53 fail('error running barback: $e'); | 54 fail('error running barback: $e'); |
| 54 }); | 55 }); |
| 55 resultSubscription = barback.results.listen((result) { | 56 resultSubscription = barback.results.listen((result) { |
| 56 expect(result.succeeded, isTrue, reason: "${result.errors}"); | 57 expect(result.succeeded, isTrue, reason: "${result.errors}"); |
| 57 }); | 58 }); |
| 58 } | 59 } |
| 59 | 60 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // TODO(jmesserly): this is .debug to workaround issue 13046. | 105 // TODO(jmesserly): this is .debug to workaround issue 13046. |
| 105 const SHADOW_DOM_TAG = | 106 const SHADOW_DOM_TAG = |
| 106 '<script src="packages/shadow_dom/shadow_dom.debug.js"></script>\n'; | 107 '<script src="packages/shadow_dom/shadow_dom.debug.js"></script>\n'; |
| 107 | 108 |
| 108 const INTEROP_TAG = '<script src="packages/browser/interop.js"></script>\n'; | 109 const INTEROP_TAG = '<script src="packages/browser/interop.js"></script>\n'; |
| 109 const DART_JS_TAG = '<script src="packages/browser/dart.js"></script>'; | 110 const DART_JS_TAG = '<script src="packages/browser/dart.js"></script>'; |
| 110 | 111 |
| 111 const CUSTOM_ELEMENT_TAG = | 112 const CUSTOM_ELEMENT_TAG = |
| 112 '<script src="packages/custom_element/custom-elements.debug.js">' | 113 '<script src="packages/custom_element/custom-elements.debug.js">' |
| 113 '</script>\n'; | 114 '</script>\n'; |
| OLD | NEW |