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

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

Issue 794473002: Delete polymer from the Dart repo (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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
« no previous file with comments | « pkg/polymer/test/bind_test.html ('k') | pkg/polymer/test/build/build_log_combiner_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/test/build/all_phases_test.dart
diff --git a/pkg/polymer/test/build/all_phases_test.dart b/pkg/polymer/test/build/all_phases_test.dart
deleted file mode 100644
index 39b1602379541f061106a9815779ed8fd0b700b0..0000000000000000000000000000000000000000
--- a/pkg/polymer/test/build/all_phases_test.dart
+++ /dev/null
@@ -1,348 +0,0 @@
-// 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.all_phases_test;
-
-import 'package:code_transformers/tests.dart' show testingDartSdkDirectory;
-import 'package:polymer/src/build/common.dart';
-import 'package:polymer/src/build/messages.dart';
-import 'package:polymer/src/build/script_compactor.dart' show MAIN_HEADER;
-import 'package:polymer/transformer.dart';
-import 'package:smoke/codegen/generator.dart' show DEFAULT_IMPORTS;
-import 'package:unittest/compact_vm_config.dart';
-
-import 'common.dart';
-
-void main() {
- useCompactVMConfiguration();
- var phases = createDeployPhases(new TransformOptions(),
- sdkDir: testingDartSdkDirectory);
-
- testPhases('no changes', phases, {
- 'a|web/test.html': '<!DOCTYPE html><html></html>',
- }, {}, [
- 'warning: ${MISSING_INIT_POLYMER.snippet}'
- ]);
-
- testPhases('observable changes', phases, {
- 'a|web/test.dart': _sampleInput('A', 'foo'),
- 'a|web/test2.dart': _sampleOutput('B', 'bar'),
- }, {
- 'a|web/test.dart': _sampleOutput('A', 'foo'),
- 'a|web/test2.dart': _sampleOutput('B', 'bar'),
- });
-
- testPhases('single script', phases, {
- 'a|web/test.html':
- '<!DOCTYPE html><html><head>'
- '<link rel="import" href="packages/polymer/polymer.html">'
- '<script type="application/dart" src="a.dart"></script>',
- 'a|web/a.dart': _sampleInput('A', 'foo'),
- }, {
- 'a|web/test.html':
- '<!DOCTYPE html><html><head>'
- '$COMPATIBILITY_JS_TAGS'
- '</head><body>'
- '<script src="test.html_bootstrap.dart.js" async=""></script>'
- '</body></html>',
-
- 'a|web/test.html_bootstrap.dart':
- '''$MAIN_HEADER
- import 'a.dart' as i0;
- ${DEFAULT_IMPORTS.join('\n')}
- import 'a.dart' as smoke_0;
- import 'package:polymer/polymer.dart' as smoke_1;
-
- void main() {
- useGeneratedCode(new StaticConfiguration(
- checkedMode: false,
- parents: {
- smoke_0.XA: smoke_1.PolymerElement,
- },
- declarations: {
- smoke_0.XA: {},
- }));
- configureForDeployment([
- i0.m_foo,
- () => Polymer.register('x-A', i0.XA),
- ]);
- i0.main();
- }
- '''.replaceAll('\n ', '\n'),
- 'a|web/a.dart': _sampleOutput('A', 'foo'),
- }, []);
-
- testPhases('single inline script', phases, {
- 'a|web/test.html':
- '<!DOCTYPE html><html><head>'
- '<link rel="import" href="packages/polymer/polymer.html">'
- '<script type="application/dart">'
- '${_sampleInput("B", "bar")}</script>',
- }, {
- 'a|web/test.html':
- '<!DOCTYPE html><html><head>'
- '$COMPATIBILITY_JS_TAGS'
- '</head><body>'
- '<script src="test.html_bootstrap.dart.js" async=""></script>'
- '</body></html>',
-
- 'a|web/test.html_bootstrap.dart':
- '''$MAIN_HEADER
- import 'test.html.0.dart' as i0;
- ${DEFAULT_IMPORTS.join('\n')}
- import 'test.html.0.dart' as smoke_0;
- import 'package:polymer/polymer.dart' as smoke_1;
-
- void main() {
- useGeneratedCode(new StaticConfiguration(
- checkedMode: false,
- parents: {
- smoke_0.XB: smoke_1.PolymerElement,
- },
- declarations: {
- smoke_0.XB: {},
- }));
- configureForDeployment([
- i0.m_bar,
- () => Polymer.register('x-B', i0.XB),
- ]);
- i0.main();
- }
- '''.replaceAll('\n ', '\n'),
- 'a|web/test.html.0.dart':
- _sampleOutput("B", "bar"),
- });
-
- testPhases('several scripts', phases, {
- 'a|web/test.html':
- '<!DOCTYPE html><html><head>'
- '<link rel="import" href="packages/polymer/polymer.html">\n'
- '<script type="application/dart" src="a.dart"></script>\n'
- '<script type="application/dart">'
- '${_sampleInput("B", "bar")}</script>'
- '</head><body><div>\n'
- '<script type="application/dart">'
- '${_sampleInput("C", "car")}</script>'
- '</div>\n'
- '<script type="application/dart" src="d.dart"></script>',
- 'a|web/a.dart': _sampleInput('A', 'foo'),
- }, {
- 'a|web/test.html':
- '<!DOCTYPE html><html><head>'
- '$COMPATIBILITY_JS_TAGS\n\n'
- '</head><body>'
- '<div>\n</div>\n'
- '<script src="test.html_bootstrap.dart.js" async=""></script>'
- '</body></html>',
- 'a|web/test.html_bootstrap.dart':
- '''$MAIN_HEADER
- import 'a.dart' as i0;
- import 'test.html.0.dart' as i1;
- import 'test.html.1.dart' as i2;
- ${DEFAULT_IMPORTS.join('\n')}
- import 'a.dart' as smoke_0;
- import 'package:polymer/polymer.dart' as smoke_1;
- import 'test.html.0.dart' as smoke_2;
- import 'test.html.1.dart' as smoke_3;
-
- void main() {
- useGeneratedCode(new StaticConfiguration(
- checkedMode: false,
- parents: {
- smoke_0.XA: smoke_1.PolymerElement,
- smoke_2.XB: smoke_1.PolymerElement,
- smoke_3.XC: smoke_1.PolymerElement,
- },
- declarations: {
- smoke_0.XA: {},
- smoke_2.XB: {},
- smoke_3.XC: {},
- }));
- configureForDeployment([
- i0.m_foo,
- () => Polymer.register('x-A', i0.XA),
- i1.m_bar,
- () => Polymer.register('x-B', i1.XB),
- i2.m_car,
- () => Polymer.register('x-C', i2.XC),
- ]);
- i2.main();
- }
- '''.replaceAll('\n ', '\n'),
- 'a|web/a.dart': _sampleOutput('A', 'foo'),
- }, [
- // These should not be emitted multiple times. See:
- // https://code.google.com/p/dart/issues/detail?id=17197
- 'warning: ${ONLY_ONE_TAG.snippet} (web/test.html 2 0)',
- 'warning: ${ONLY_ONE_TAG.snippet} (web/test.html 18 0)',
- 'warning: ${ONLY_ONE_TAG.snippet} (web/test.html 34 0)',
- 'warning: ${SCRIPT_FILE_NOT_FOUND.create({'url': 'd.dart'}).snippet} '
- '(web/test.html 34 0)',
- ]);
-
- testPhases('with imports', phases, {
- 'a|web/index.html':
- '<!DOCTYPE html><html><head>'
- '<link rel="import" href="packages/polymer/polymer.html">'
- '<link rel="import" href="packages/a/test2.html">'
- '</head><body>'
- '<script type="application/dart" src="b.dart"></script>',
- 'a|web/b.dart': _sampleInput('B', 'bar'),
- 'a|lib/test2.html':
- '<!DOCTYPE html><html><head>'
- '<link rel="import" href="../../packages/polymer/polymer.html">'
- '</head><body>'
- '<polymer-element name="x-a">1'
- '<script type="application/dart">'
- '${_sampleInput("A", "foo")}</script>'
- '</polymer-element></html>',
- }, {
- 'a|web/index.html':
- '<!DOCTYPE html><html><head>'
- '$COMPATIBILITY_JS_TAGS'
- '</head><body>'
- '<div hidden="">'
- '<polymer-element name="x-a">1</polymer-element>'
- '</div>'
- '<script src="index.html_bootstrap.dart.js" async=""></script>'
- '</body></html>',
- 'a|web/index.html_bootstrap.dart':
- '''$MAIN_HEADER
- import 'index.html.0.dart' as i0;
- import 'b.dart' as i1;
- ${DEFAULT_IMPORTS.join('\n')}
- import 'index.html.0.dart' as smoke_0;
- import 'package:polymer/polymer.dart' as smoke_1;
- import 'b.dart' as smoke_2;
-
- void main() {
- useGeneratedCode(new StaticConfiguration(
- checkedMode: false,
- parents: {
- smoke_2.XB: smoke_1.PolymerElement,
- smoke_0.XA: smoke_1.PolymerElement,
- },
- declarations: {
- smoke_2.XB: {},
- smoke_0.XA: {},
- }));
- configureForDeployment([
- i0.m_foo,
- () => Polymer.register('x-A', i0.XA),
- i1.m_bar,
- () => Polymer.register('x-B', i1.XB),
- ]);
- i1.main();
- }
- '''.replaceAll('\n ', '\n'),
- 'a|web/index.html.0.dart': _sampleOutput("A", "foo"),
- 'a|web/b.dart': _sampleOutput('B', 'bar'),
- }, []);
-
- testPhases('experimental bootstrap', phases, {
- 'a|web/index.html':
- '<!DOCTYPE html><html><head>'
- '<link rel="import" '
- 'href="packages/polymer/polymer_experimental.html">'
- '<link rel="import" href="packages/a/test2.html">'
- '<link rel="import" href="packages/a/load_b.html">',
- 'a|lib/b.dart': _sampleInput('B', 'bar'),
- 'a|lib/test2.html':
- '<!DOCTYPE html><html><head>'
- '<link rel="import" href="../../packages/polymer/polymer.html">'
- '</head><body>'
- '<polymer-element name="x-a">1'
- '<script type="application/dart">'
- '${_sampleInput("A", "foo")}</script>'
- '</polymer-element></html>',
- 'a|lib/load_b.html':
- '<!DOCTYPE html><html><head></head><body>'
- '<script type="application/dart" src="b.dart"></script>',
- }, {
- 'a|web/index.html':
- '<!DOCTYPE html><html><head>'
- '$COMPATIBILITY_JS_TAGS'
- '</head><body>'
- '<div hidden="">'
- '<polymer-element name="x-a">1</polymer-element>'
- '</div>'
- '<script src="index.html_bootstrap.dart.js" async=""></script>'
- '</body></html>',
- 'a|web/index.html_bootstrap.dart':
- '''$MAIN_HEADER
- import 'index.html.0.dart' as i0;
- import 'package:a/b.dart' as i1;
- ${DEFAULT_IMPORTS.join('\n')}
- import 'index.html.0.dart' as smoke_0;
- import 'package:polymer/polymer.dart' as smoke_1;
- import 'package:a/b.dart' as smoke_2;
-
- void main() {
- useGeneratedCode(new StaticConfiguration(
- checkedMode: false,
- parents: {
- smoke_0.XA: smoke_1.PolymerElement,
- smoke_2.XB: smoke_1.PolymerElement,
- },
- declarations: {
- smoke_0.XA: {},
- smoke_2.XB: {},
- }));
- startPolymer([
- i0.m_foo,
- () => Polymer.register('x-A', i0.XA),
- i1.m_bar,
- () => Polymer.register('x-B', i1.XB),
- ]);
- }
- '''.replaceAll('\n ', '\n'),
- 'a|web/index.html.0.dart': _sampleOutput("A", "foo"),
- 'a|lib/b.dart': _sampleOutput('B', 'bar'),
- }, []);
-}
-
-String _sampleInput(String className, String fieldName) => '''
-library ${className}_$fieldName;
-import 'package:observe/observe.dart';
-import 'package:polymer/polymer.dart';
-
-class $className extends Observable {
- @observable int $fieldName;
- $className(this.$fieldName);
-}
-
-@CustomTag('x-$className')
-class X${className} extends PolymerElement {
- X${className}.created() : super.created();
-}
-@initMethod m_$fieldName() {}
-main() {}
-''';
-
-
-String _sampleOutput(String className, String fieldName) {
- var fieldReplacement = '@reflectable @observable '
- 'int get $fieldName => __\$$fieldName; '
- 'int __\$$fieldName; '
- '@reflectable set $fieldName(int value) { '
- '__\$$fieldName = notifyPropertyChange(#$fieldName, '
- '__\$$fieldName, value); }';
- return '''
-library ${className}_$fieldName;
-import 'package:observe/observe.dart';
-import 'package:polymer/polymer.dart';
-
-class $className extends ChangeNotifier {
- $fieldReplacement
- $className($fieldName) : __\$$fieldName = $fieldName;
-}
-
-@CustomTag('x-$className')
-class X${className} extends PolymerElement {
- X${className}.created() : super.created();
-}
-@initMethod m_$fieldName() {}
-main() {}
-''';
-}
« no previous file with comments | « pkg/polymer/test/bind_test.html ('k') | pkg/polymer/test/build/build_log_combiner_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698