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

Unified Diff: pkg/polymer/test/build/index_page_builder_test.dart

Issue 573863003: simple index.html files for folders that contain entry points (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: show subdirectories as well Created 6 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 side-by-side diff with in-line comments
Download patch
Index: pkg/polymer/test/build/index_page_builder_test.dart
diff --git a/pkg/polymer/test/build/index_page_builder_test.dart b/pkg/polymer/test/build/index_page_builder_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..aa1f4c9949aad91d1d8ebfd13894ad86d8f47fc1
--- /dev/null
+++ b/pkg/polymer/test/build/index_page_builder_test.dart
@@ -0,0 +1,56 @@
+// 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.build.index_page_builder_test;
+
+import 'dart:async';
+import 'package:unittest/compact_vm_config.dart';
+import 'package:unittest/unittest.dart';
+import 'package:polymer/src/build/common.dart';
+import 'package:polymer/src/build/index_page_builder.dart';
+
+import 'common.dart';
+
+final phases = [[new IndexPageBuilder(new TransformOptions())]];
+
+void main() {
+ useCompactVMConfiguration();
+
+ testPhases('outputs index pages', phases, {
+ 'a|web/test.html': '<!DOCTYPE html><html></html>',
+ 'a|web/test2.html': '<!DOCTYPE html><html></html>',
+ 'a|web/foo/test3.html': '<!DOCTYPE html><html></html>',
+ 'a|web/foo/bar/test4.html': '<!DOCTYPE html><html></html>',
+ }, {
+ 'a|web/index.html': '<!DOCTYPE html><html><head></head><body>'
+ '<h1>Entry points</h1><ul>'
+ '<li><a href="foo/">foo/</a></li>'
+ '<li><a href="foo/bar/">foo/bar/</a></li>'
+ '<li><a href="test.html">test.html</a></li>'
+ '<li><a href="test2.html">test2.html</a></li>'
+ '</ul></body></html>',
+ 'a|web/foo/index.html': '<!DOCTYPE html><html><head></head><body>'
+ '<h1>Entry points</h1><ul>'
+ '<li><a href="bar/">bar/</a></li>'
+ '<li><a href="test3.html">test3.html</a></li>'
+ '</ul></body></html>',
+ 'a|web/foo/bar/index.html': '<!DOCTYPE html><html><head></head><body>'
+ '<h1>Entry points</h1><ul>'
+ '<li><a href="test4.html">test4.html</a></li>'
+ '</ul></body></html>',
+ });
+
+ testPhases('doesn\'t overwrite existing pages', phases, {
Siggi Cherem (dart-lang) 2014/09/16 19:40:50 let's add some additional tests: - A that mixes b
jakemac 2014/09/16 21:17:05 Including index.html since I am flattening everyth
+ 'a|web/index.html': '<!DOCTYPE html><html></html>',
+ 'a|web/test.html': '<!DOCTYPE html><html></html>',
+ 'a|web/foo/index.html': '<!DOCTYPE html><html></html>',
+ 'a|web/foo/test.html': '<!DOCTYPE html><html></html>',
+ 'a|web/foo/bar/index.html': '<!DOCTYPE html><html></html>',
+ 'a|web/foo/bar/test.html': '<!DOCTYPE html><html></html>',
+ }, {
+ 'a|web/index.html': '<!DOCTYPE html><html></html>',
+ 'a|web/foo/index.html': '<!DOCTYPE html><html></html>',
+ 'a|web/foo/bar/index.html': '<!DOCTYPE html><html></html>',
+ });
+}
+
« pkg/polymer/lib/src/build/index_page_builder.dart ('K') | « pkg/polymer/lib/transformer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698