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

Side by Side Diff: pkg/polymer/test/transform/common.dart

Issue 23678009: fixed TodoMVC tests to include deploying to JS (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 // 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.transfom.common; 5 library polymer.test.transfom.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';
11 import 'package:unittest/unittest.dart'; 11 import 'package:unittest/unittest.dart';
12 12
13 String idToString(AssetId id) => '${id.package}|${id.path}'; 13 String idToString(AssetId id) => '${id.package}|${id.path}';
14 AssetId idFromString(String s) { 14 AssetId idFromString(String s) {
15 int index = s.indexOf('|'); 15 int index = s.indexOf('|');
16 return new AssetId(s.substring(0, index), s.substring(index + 1)); 16 return new AssetId(s.substring(0, index), s.substring(index + 1));
17 } 17 }
18 18
19 /** 19 /**
20 * A helper package provider that has files stored in memory, also wraps 20 * A helper package provider that has files stored in memory, also wraps
21 * [Barback] to simply our tests. 21 * [Barback] to simply our tests.
22 */ 22 */
23 class TestHelper implements PackageProvider { 23 class TestHelper implements PackageProvider {
24 /** 24 /**
25 * Maps from an asset string identifier of the form 'package|path' to the 25 * Maps from an asset string identifier of the form 'package|path' to the
26 * file contents. 26 * file contents.
27 */ 27 */
28 final Map<String, String> files; 28 final Map<String, String> files;
29 final Iterable<String> packages; 29 final Iterable<String> packages;
30 30
31 Barback barback; 31 Barback barback;
32 var errorSubscription; 32 var errorSubscription;
33 var resultSubscription; 33 var resultSubscription;
34 34
35 Future<Asset> getAsset(AssetId id) => 35 Future<Asset> getAsset(AssetId id) =>
36 new Future.value(new Asset.fromString(id, files[idToString(id)])); 36 new Future.value(new Asset.fromString(id, files[idToString(id)]));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 89
90 testPhases(String testName, List<List<Transformer>> phases, 90 testPhases(String testName, List<List<Transformer>> phases,
91 Map<String, String> inputFiles, Map<String, String> expectedFiles) { 91 Map<String, String> inputFiles, Map<String, String> expectedFiles) {
92 test(testName, () { 92 test(testName, () {
93 var helper = new TestHelper(phases, inputFiles)..run(); 93 var helper = new TestHelper(phases, inputFiles)..run();
94 return helper.checkAll(expectedFiles).then((_) => helper.tearDown()); 94 return helper.checkAll(expectedFiles).then((_) => helper.tearDown());
95 }); 95 });
96 } 96 }
97 97
98 // TODO(jmesserly): this is .debug to workaround issue 13046.
98 const SHADOW_DOM_TAG = 99 const SHADOW_DOM_TAG =
99 '<script src="packages/shadow_dom/shadow_dom.min.js"></script>\n'; 100 '<script src="packages/shadow_dom/shadow_dom.debug.js"></script>\n';
100 101
101 const INTEROP_TAG = '<script src="packages/browser/interop.js"></script>\n'; 102 const INTEROP_TAG = '<script src="packages/browser/interop.js"></script>\n';
103
104 const PKG_JS_INTEROP_TAG =
105 '<script src="packages/js/dart_interop.js"></script>\n';
OLDNEW
« no previous file with comments | « pkg/polymer/test/transform/all_phases_test.dart ('k') | pkg/polymer/test/transform/polyfill_injector_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698