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

Unified Diff: test/transform/code_extractor_test.dart

Issue 22825012: Introduce transformers for: (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
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 side-by-side diff with in-line comments
Download patch
Index: test/transform/code_extractor_test.dart
diff --git a/test/transform/code_extractor_test.dart b/test/transform/code_extractor_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..e62ec967a6bb070c8f5f5e95e641010e07679f4c
--- /dev/null
+++ b/test/transform/code_extractor_test.dart
@@ -0,0 +1,82 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library polymer.test.transform.code_extractor_test;
+
+import 'package:polymer/src/transform/code_extractor.dart';
+import 'package:unittest/compact_vm_config.dart';
+
+import 'common.dart';
+
+void main() {
+ useCompactVMConfiguration();
+
+ testPhases('no changes', [[new InlineCodeExtractor()]], {
Siggi Cherem (dart-lang) 2013/08/19 21:23:38 this is defined in 'common.dart', basically read i
Jennifer Messerly 2013/08/19 22:57:26 why not [[[[[transformer]]]]]? ;)
Bob Nystrom 2013/08/19 23:05:45 In case you're actually curious... Barback organi
+ 'a|test.html': '<!DOCTYPE html><html></html>',
+ }, {
+ 'a|test.html': '<!DOCTYPE html><html></html>',
+ });
+
+ testPhases('single script', [[new InlineCodeExtractor()]], {
+ 'a|test.html':
+ '<!DOCTYPE html><html><head>'
+ '<script type="application/dart">main() { }</script>',
+ }, {
+ 'a|test.html':
+ '<!DOCTYPE html><html><head>'
+ '<script type="application/dart" src="test.html.0.dart"></script>'
+ '</head><body></body></html>',
+
+ 'a|test.html.0.dart':
+ 'main() { }',
+ });
+
+ testPhases('multiple scripts', [[new InlineCodeExtractor()]], {
+ 'a|test.html':
+ '<!DOCTYPE html><html><head>'
+ '<script type="application/dart">main1() { }</script>'
+ '<script type="application/dart">main2() { }</script>',
+ }, {
+ 'a|test.html':
+ '<!DOCTYPE html><html><head>'
+ '<script type="application/dart" src="test.html.0.dart"></script>'
+ '<script type="application/dart" src="test.html.1.dart"></script>'
+ '</head><body></body></html>',
+
+ 'a|test.html.0.dart':
+ 'main1() { }',
+
+ 'a|test.html.1.dart':
+ 'main2() { }',
+ });
+
+ testPhases('multiple deeper scripts', [[new InlineCodeExtractor()]], {
+ 'a|test.html':
+ '<!DOCTYPE html><html><head>'
+ '<script type="application/dart">main1() { }</script>'
+ '</head><body><div>'
+ '<script type="application/dart">main2() { }</script>'
+ '</div><div><div>'
+ '<script type="application/dart">main3() { }</script>'
+ '</div></div>'
+ }, {
+ 'a|test.html':
+ '<!DOCTYPE html><html><head>'
+ '<script type="application/dart" src="test.html.0.dart"></script>'
+ '</head><body><div>'
+ '<script type="application/dart" src="test.html.1.dart"></script>'
+ '</div><div><div>'
+ '<script type="application/dart" src="test.html.2.dart"></script>'
+ '</div></div></body></html>',
+
+ 'a|test.html.0.dart':
+ 'main1() { }',
+
+ 'a|test.html.1.dart':
+ 'main2() { }',
+
+ 'a|test.html.2.dart':
+ 'main3() { }',
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698