chore: remove obsolete dart related files

This commit is contained in:
Igor Minar 2016-09-02 11:45:13 -07:00 committed by Martin Probst
parent 6f4b6edfea
commit 2371d22d49
24 changed files with 0 additions and 1015 deletions

View File

@ -1,3 +0,0 @@
library benchpress.src.firefox_extension.data.installed_script;
//no dart implementation

View File

@ -1,3 +0,0 @@
library benchmarks_external.e2e_test.compiler_perf;
main() {}

View File

@ -1,3 +0,0 @@
library benchmarks_external.e2e_test.largetable_perf;
main() {}

View File

@ -1,3 +0,0 @@
library benchmarks_external.e2e_test.naive_infinite_scroll_perf;
main() {}

View File

@ -1,3 +0,0 @@
library benchmarks_external.e2e_test.polymer_tree_perf;
main() {}

View File

@ -1,3 +0,0 @@
library benchmarks_external.e2e_test.react_tree_perf;
main() {}

View File

@ -1,3 +0,0 @@
library benchmarks_external.e2e_test.static_tree_perf;
main() {}

View File

@ -1,3 +0,0 @@
library benchmarks_external.e2e_test.tree_perf;
main() {}

View File

@ -1,21 +0,0 @@
name: benchmarks_external
environment:
sdk: '>=1.4.0'
dependencies:
angular: '>=1.1.2+2 <2.0.0'
browser: '>=0.10.0 <0.11.0'
dev_dependencies:
angular2:
path: ../angular2
dependency_overrides:
intl: '^0.12.4' # angular depends on an older version of intl.
transformers:
- angular:
$include: "web/src"
html_files:
- web/src/naive_infinite_scroll/scroll_area.html
- web/src/naive_infinite_scroll/scroll_item.html
- $dart2js:
$include: "web/src"
commandLineOptions:
- --show-package-warnings

View File

@ -1,90 +0,0 @@
// compiler benchmark in AngularDart 1.x
library compiler_benchmark_ng10;
import 'package:angular/angular.dart';
import 'package:angular/application_factory.dart';
import 'dart:html';
import 'package:angular2/src/testing/benchmark_util.dart';
main() {
var count = getIntParameter('elements');
var m = new Module()
..bind(Dir0)
..bind(Dir1)
..bind(Dir2)
..bind(Dir3)
..bind(Dir4);
var templateWithBindings = loadTemplate('templateWithBindings', count);
var templateNoBindings = loadTemplate('templateWithBindings', count);
final injector = applicationFactory().addModule(m).run();
final compiler = injector.get(Compiler);
final directiveMap = injector.get(DirectiveMap);
compileWithBindings() {
final cloned = templateWithBindings.clone(true);
compiler([cloned], directiveMap);
}
compileNoBindings() {
final cloned = templateNoBindings.clone(true);
compiler([cloned], directiveMap);
}
bindAction('#compileWithBindings', compileWithBindings);
bindAction('#compileNoBindings', compileNoBindings);
}
loadTemplate(templateId, repeatCount) {
String result = '';
var content = document.querySelector("#${templateId}").innerHtml;
for (var i = 0; i < repeatCount; i++) {
result += content;
}
return createTemplate(result.replaceAll(new RegExp(r'[\[\]]'), ''));
}
class IdentitySanitizer implements NodeTreeSanitizer {
void sanitizeTree(Node node) {}
}
createTemplate(String html) {
var div = document.createElement('div');
div.setInnerHtml(html, treeSanitizer: new IdentitySanitizer());
return div;
}
@Decorator(selector: '[dir0]', map: const {'attr0': '=>prop'})
class Dir0 {
Object prop;
}
@Decorator(selector: '[dir1]', map: const {'attr1': '=>prop'})
class Dir1 {
Object prop;
constructor(Dir0 dir0) {}
}
@Decorator(selector: '[dir2]', map: const {'attr2': '=>prop'})
class Dir2 {
Object prop;
constructor(Dir1 dir1) {}
}
@Decorator(selector: '[dir3]', map: const {'attr3': '=>prop'})
class Dir3 {
Object prop;
constructor(Dir2 dir2) {}
}
@Decorator(selector: '[dir4]', map: const {'attr4': '=>prop'})
class Dir4 {
Object prop;
constructor(Dir3 dir3) {}
}

View File

@ -1 +0,0 @@
library benchmarks_external.src.largetable;

View File

@ -1,59 +0,0 @@
library scroll_app;
import 'dart:async';
import 'dart:html';
import 'package:angular/angular.dart';
import 'package:angular2/src/testing/benchmark_util.dart';
@Component(
selector: 'scroll-app',
template: '''
<div>
<div style="display: flex">
<scroll-area scroll-top="scrollTop"></scroll-area>
</div>
<div ng-if="scrollAreas.length > 0">
<p>Following tables are only here to add weight to the UI:</p>
<scroll-area ng-repeat="scrollArea in scrollAreas"></scroll-area>
</div>
</div>
''')
class App implements ShadowRootAware {
final VmTurnZone ngZone;
List<int> scrollAreas;
int scrollTop = 0;
int iterationCount;
int scrollIncrement;
App(this.ngZone) {
int appSize = getIntParameter('appSize');
iterationCount = getIntParameter('iterationCount');
scrollIncrement = getIntParameter('scrollIncrement');
appSize = appSize > 1 ? appSize - 1 : 0; // draw at least one table
scrollAreas = new List.generate(appSize, (i) => i);
}
@override
void onShadowRoot(ShadowRoot shadowRoot) {
bindAction('#run-btn', () {
runBenchmark();
});
bindAction('#reset-btn', () {
scrollTop = 0;
});
}
void runBenchmark() {
int n = iterationCount;
scheduleScroll() {
new Future(() {
scrollTop += scrollIncrement;
n--;
if (n > 0) {
scheduleScroll();
}
});
}
scheduleScroll();
}
}

View File

@ -1,128 +0,0 @@
library cells;
import 'package:angular/angular.dart';
import 'common.dart';
@Component(
selector: 'company-name',
template: '''
<div style="width: {{width}}">{{company.name}}</div>
''',
map: const {'company': '=>company', 'cell-width': '=>width',})
class CompanyNameComponent {
String width;
Company company;
}
@Component(
selector: 'opportunity-name',
template: '''
<div style="width: {{width}}">{{opportunity.name}}</div>
''',
map: const {'opportunity': '=>opportunity', 'cell-width': '=>width',})
class OpportunityNameComponent {
String width;
Opportunity opportunity;
}
@Component(
selector: 'offering-name',
template: '''
<div style="width: {{width}}">{{offering.name}}</div>
''',
map: const {'offering': '=>offering', 'cell-width': '=>width',})
class OfferingNameComponent {
String width;
Offering offering;
}
class Stage {
String name;
bool isDisabled;
Map style;
Function apply;
String get styleString => style != null
? style.keys.map((prop) => '$prop: ${style[prop]}').join(';')
: '';
}
@Component(
selector: 'stage-buttons',
template: '''
<div style="width: {{width}}">
<button ng-repeat="stage in stages"
ng-disabled="stage.isDisabled"
style="{{stage.styleString}}"
ng-click="setStage(stage)">
{{stage.name}}
</button>
</div>
''',
map: const {'offering': '=>offering', 'cell-width': '=>width',})
class StageButtonsComponent {
Offering _offering;
List<Stage> stages;
String width;
Offering get offering => _offering;
set offering(Offering offering) {
_offering = offering;
_computeStageButtons();
}
setStage(Stage stage) {
_offering.status = stage.name;
_computeStageButtons();
}
_computeStageButtons() {
bool disabled = true;
stages = STATUS_LIST.map((String status) {
bool isCurrent = offering.status == status;
var stage = new Stage();
stage
..name = status
..isDisabled = disabled
..style = {
'background-color': disabled ? '#DDD' : isCurrent ? '#DDF' : '#FDD'
};
if (isCurrent) {
disabled = false;
}
return stage;
}).toList();
}
}
@Component(
selector: 'account-cell',
template: '''
<div style="width: {{width}}">
<a href="/account/{{account.accountId}}">
{{account.accountId}}
</a>
</div>
''',
map: const {'account': '=>account', 'cell-width': '=>width',})
class AccountCellComponent {
Account account;
String width;
}
@Component(
selector: 'formatted-cell',
template: '''<div style="width: {{width}}">{{formattedValue}}</div>''',
map: const {'value': '=>value', 'cell-width': '=>width',})
class FormattedCellComponent {
String formattedValue;
String width;
set value(dynamic value) {
if (value is DateTime) {
formattedValue = '${value.month}/${value.day}/${value.year}';
} else {
formattedValue = value.toString();
}
}
}

View File

@ -1,205 +0,0 @@
library common.stuff;
import 'dart:async';
import 'dart:collection';
import 'package:observe/observe.dart';
const ITEMS = 1000;
const ITEM_HEIGHT = 40;
const VISIBLE_ITEMS = 17;
const HEIGHT = ITEMS * ITEM_HEIGHT;
const VIEW_PORT_HEIGHT = ITEM_HEIGHT * VISIBLE_ITEMS;
const COMPANY_NAME_WIDTH = 100;
const OPPORTUNITY_NAME_WIDTH = 100;
const OFFERING_NAME_WIDTH = 100;
const ACCOUNT_CELL_WIDTH = 50;
const BASE_POINTS_WIDTH = 50;
const KICKER_POINTS_WIDTH = 50;
const STAGE_BUTTONS_WIDTH = 220;
const BUNDLES_WIDTH = 120;
const DUE_DATE_WIDTH = 100;
const END_DATE_WIDTH = 100;
const AAT_STATUS_WIDTH = 100;
const ROW_WIDTH = COMPANY_NAME_WIDTH +
OPPORTUNITY_NAME_WIDTH +
OFFERING_NAME_WIDTH +
ACCOUNT_CELL_WIDTH +
BASE_POINTS_WIDTH +
KICKER_POINTS_WIDTH +
STAGE_BUTTONS_WIDTH +
BUNDLES_WIDTH +
DUE_DATE_WIDTH +
END_DATE_WIDTH +
AAT_STATUS_WIDTH;
const STATUS_LIST = const ['Planned', 'Pitched', 'Won', 'Lost'];
const AAT_STATUS_LIST = const ['Active', 'Passive', 'Abandoned'];
// Imitate Streamy entities.
class RawEntity extends Object
with MapMixin<String, dynamic>
implements ObservableMap<String, dynamic> {
ObservableMap _data = new ObservableMap();
@override
Iterable<String> get keys => _data.keys;
@override
void clear() {
_data.clear();
}
@override
operator [](String key) {
if (!key.contains('.')) {
return _data[key];
}
var pieces = key.split('.');
var last = pieces.removeLast();
var target = _resolve(pieces, this);
if (target == null) {
return null;
}
return target[last];
}
@override
operator []=(String key, value) {
if (!key.contains('.')) {
_data[key] = value;
return;
}
var pieces = key.split('.');
var last = pieces.removeLast();
var target = _resolve(pieces, this);
target[last] = value;
}
@override
remove(String key) {
if (!key.contains('.')) {
return _data.remove(key);
}
var pieces = key.split('.');
var last = pieces.removeLast();
var target = _resolve(pieces, this);
return target.remove(last);
}
_resolve(List<String> pieces, start) {
var cur = start;
for (var i = 0; i < pieces.length; i++) {
cur = cur[pieces[i]];
if (cur == null) {
return null;
}
}
return cur;
}
@override
Stream<List<ChangeRecord>> get changes => _data.changes;
@override
bool get hasObservers => _data.hasObservers;
@override
bool deliverChanges() => _data.deliverChanges();
@override
notifyPropertyChange(Symbol field, Object oldValue, Object newValue) =>
_data.notifyPropertyChange(field, oldValue, newValue);
@override
void notifyChange(ChangeRecord record) {
_data.notifyChange(record);
}
@override
void observed() {
_data.observed();
}
@override
void unobserved() {
_data.observed();
}
}
class Company extends RawEntity {
String get name => this['name'];
set name(String val) {
this['name'] = val;
}
}
class Offering extends RawEntity {
String get name => this['name'];
set name(String val) {
this['name'] = val;
}
Company get company => this['company'];
set company(Company val) {
this['company'] = val;
}
Opportunity get opportunity => this['opportunity'];
set opportunity(Opportunity val) {
this['opportunity'] = val;
}
Account get account => this['account'];
set account(Account val) {
this['account'] = val;
}
int get basePoints => this['basePoints'];
set basePoints(int val) {
this['basePoints'] = val;
}
int get kickerPoints => this['kickerPoints'];
set kickerPoints(int val) {
this['kickerPoints'] = val;
}
String get status => this['status'];
set status(String val) {
this['status'] = val;
}
String get bundles => this['bundles'];
set bundles(String val) {
this['bundles'] = val;
}
DateTime get dueDate => this['dueDate'];
set dueDate(DateTime val) {
this['dueDate'] = val;
}
DateTime get endDate => this['endDate'];
set endDate(DateTime val) {
this['endDate'] = val;
}
String get aatStatus => this['aatStatus'];
set aatStatus(String val) {
this['aatStatus'] = val;
}
}
class Opportunity extends RawEntity {
String get name => this['name'];
set name(String val) {
this['name'] = val;
}
}
class Account extends RawEntity {
int get accountId => this['accountId'];
set accountId(int val) {
this['accountId'] = val;
}
}

View File

@ -1,28 +0,0 @@
library naive_infinite_scroll;
import 'package:angular/angular.dart';
import 'package:angular/application_factory.dart';
import 'app.dart';
import 'scroll_area.dart';
import 'scroll_item.dart';
import 'cells.dart';
class MyAppModule extends Module {
MyAppModule() {
bind(ResourceResolverConfig,
toValue: new ResourceResolverConfig.resolveRelativeUrls(false));
bind(App);
bind(ScrollAreaComponent);
bind(ScrollItemComponent);
bind(CompanyNameComponent);
bind(OpportunityNameComponent);
bind(OfferingNameComponent);
bind(AccountCellComponent);
bind(StageButtonsComponent);
bind(FormattedCellComponent);
}
}
void main() {
applicationFactory().addModule(new MyAppModule()).run();
}

View File

@ -1,69 +0,0 @@
library random_data;
import 'common.dart';
List<Offering> generateOfferings(int count) =>
new List.generate(count, generateOffering);
Offering generateOffering(int seed) {
final res = new Offering();
res.name = generateName(seed++);
res.company = generateCompany(seed++);
res.opportunity = generateOpportunity(seed++);
res.account = generateAccount(seed++);
res.basePoints = seed % 10;
res.kickerPoints = seed % 4;
res.status = STATUS_LIST[seed % STATUS_LIST.length];
res.bundles = randomString(seed++);
res.dueDate = randomDate(seed++);
res.endDate = randomDate(seed++, minDate: res.dueDate);
res.aatStatus = AAT_STATUS_LIST[seed % AAT_STATUS_LIST.length];
return res;
}
Company generateCompany(int seed) {
return new Company()..name = generateName(seed);
}
Opportunity generateOpportunity(int seed) {
return new Opportunity()..name = generateName(seed);
}
Account generateAccount(int seed) {
return new Account()..accountId = seed;
}
String generateName(int seed) {
const names = const [
'Foo',
'Bar',
'Baz',
'Qux',
'Quux',
'Garply',
'Waldo',
'Fred',
'Plugh',
'Xyzzy',
'Thud',
'Cruft',
'Stuff'
];
return names[seed % names.length];
}
DateTime randomDate(int seed, {DateTime minDate}) {
if (minDate == null) {
minDate = new DateTime.now();
}
const offsets = const [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
return minDate.add(new Duration(days: offsets[seed % offsets.length]));
}
String randomString(int seed) {
return new String.fromCharCodes(new List.generate(
const [5, 7, 9, 11, 13][seed % 5],
(i) =>
'a'.codeUnitAt(0) + const [0, 1, 2, 3, 4, 5, 6, 7, 8][seed % 9] + i));
}

View File

@ -1,57 +0,0 @@
library scroll_area;
import 'dart:html';
import 'dart:math' as math;
import 'package:angular/angular.dart';
import 'common.dart';
import 'random_data.dart';
@Component(
selector: 'scroll-area',
templateUrl: 'scroll_area.html',
map: const {'scroll-top': '=>scrollTop',})
class ScrollAreaComponent implements ShadowRootAware {
Element scrollDiv;
List<Offering> _fullList;
List<Offering> visibleItems = [];
// Init empty maps and populate later. There seems to be a bug in Angular
// that makes it choke on pre-populated style maps.
final Map paddingStyle = {};
final Map innerStyle = {};
final Map scrollDivStyle = {};
ScrollAreaComponent() {
_fullList = generateOfferings(ITEMS);
}
@override
void onShadowRoot(ShadowRoot shadowRoot) {
scrollDiv = shadowRoot.querySelector('#scrollDiv');
onScroll();
scrollDivStyle.addAll({
'height': '${VIEW_PORT_HEIGHT}px',
'width': '1000px',
'border': '1px solid #000',
'overflow': 'scroll',
});
innerStyle['width'] = '${ROW_WIDTH}px';
}
set scrollTop(int value) {
if (value == null || scrollDiv == null) return;
scrollDiv.scrollTop = value;
}
void onScroll() {
int scrollY = scrollDiv.scrollTop;
int iStart = scrollY == 0 ? 0 : (scrollY / ITEM_HEIGHT).floor();
int iEnd = math.min(iStart + VISIBLE_ITEMS + 1, _fullList.length);
int padding = iStart * ITEM_HEIGHT;
innerStyle['height'] = '${HEIGHT - padding}px';
paddingStyle['height'] = '${padding}px';
visibleItems
..clear()
..addAll(_fullList.getRange(iStart, iEnd));
}
}

View File

@ -1,39 +0,0 @@
library scroll_item;
import 'package:angular/angular.dart';
import 'common.dart';
@Component(
selector: 'scroll-item',
templateUrl: 'scroll_item.html',
map: const {'offering': '=>offering',})
class ScrollItemComponent implements ShadowRootAware {
Offering offering;
// Init empty maps and populate later. There seems to be a bug in Angular
// that makes it choke on pre-populated style maps.
Map itemStyle = {};
@override
void onShadowRoot(_) {
itemStyle.addAll({
'height': '${ITEM_HEIGHT}px',
'line-height': '${ITEM_HEIGHT}px',
'font-size': '18px',
'display': 'flex',
'justify-content': 'space-between',
});
}
get companyNameWidth => '${COMPANY_NAME_WIDTH}px';
get opportunityNameWidth => '${OPPORTUNITY_NAME_WIDTH}px';
get offeringNameWidth => '${OFFERING_NAME_WIDTH}px';
get accountCellWidth => '${ACCOUNT_CELL_WIDTH}px';
get basePointsWidth => '${BASE_POINTS_WIDTH}px';
get kickerPointsWidth => '${KICKER_POINTS_WIDTH}px';
get stageButtonsWidth => '${STAGE_BUTTONS_WIDTH}px';
get bundlesWidth => '${BUNDLES_WIDTH}px';
get dueDateWidth => '${DUE_DATE_WIDTH}px';
get endDateWidth => '${END_DATE_WIDTH}px';
get aatStatusWidth => '${AAT_STATUS_WIDTH}px';
}

View File

@ -1,164 +0,0 @@
// static tree benchmark in AngularDart 1.x
library static_tree_benchmark_ng10;
import 'package:angular/angular.dart';
import 'package:angular/application_factory.dart';
import 'package:angular2/src/testing/benchmark_util.dart';
setup() {
var m = new Module()
..bind(CompilerConfig,
toValue: new CompilerConfig.withOptions(elementProbeEnabled: false))
..bind(ScopeDigestTTL,
toFactory: () => new ScopeDigestTTL.value(15), inject: [])
..bind(TreeComponent0)
..bind(TreeComponent1)
..bind(TreeComponent2)
..bind(TreeComponent3)
..bind(TreeComponent4)
..bind(TreeComponent5)
..bind(TreeComponent6)
..bind(TreeComponent7)
..bind(TreeComponent8)
..bind(TreeComponent9);
final injector = applicationFactory().addModule(m).run();
return injector;
}
const MAX_DEPTH = 10;
main() {
final injector = setup();
final zone = injector.get(VmTurnZone);
final rootScope = injector.get(Scope);
rootScope.context['initData'] = null;
var count = 0;
TreeNode createData() {
var values = count++ % 2 == 0
? ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*']
: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', '-'];
return buildTree(MAX_DEPTH, values, 0);
}
destroyDom() {
zone.run(() {
rootScope.context['initData'] = null;
});
}
createDom() {
zone.run(() {
rootScope.context['initData'] = createData();
});
}
bindAction('#destroyDom', destroyDom);
bindAction('#createDom', createDom);
}
@Component(
selector: 'tree0',
map: const {'data': '=>data'},
template: '<span> {{data.value}} ')
class TreeComponent0 {
var data;
}
@Component(
selector: 'tree1',
map: const {'data': '=>data'},
template:
'<span> {{data.value}} <tree0 data=data.right></tree0><tree0 data=data.left></tree0>')
class TreeComponent1 {
var data;
}
@Component(
selector: 'tree2',
map: const {'data': '=>data'},
template:
'<span> {{data.value}} <tree1 data=data.right></tree1><tree1 data=data.left></tree1>')
class TreeComponent2 {
var data;
}
@Component(
selector: 'tree3',
map: const {'data': '=>data'},
template:
'<span> {{data.value}} <tree2 data=data.right></tree2><tree2 data=data.left></tree2>')
class TreeComponent3 {
var data;
}
@Component(
selector: 'tree4',
map: const {'data': '=>data'},
template:
'<span> {{data.value}} <tree3 data=data.right></tree3><tree3 data=data.left></tree3>')
class TreeComponent4 {
var data;
}
@Component(
selector: 'tree5',
map: const {'data': '=>data'},
template:
'<span> {{data.value}} <tree4 data=data.right></tree4><tree4 data=data.left></tree4>')
class TreeComponent5 {
var data;
}
@Component(
selector: 'tree6',
map: const {'data': '=>data'},
template:
'<span> {{data.value}} <tree5 data=data.right></tree5><tree5 data=data.left></tree5>')
class TreeComponent6 {
var data;
}
@Component(
selector: 'tree7',
map: const {'data': '=>data'},
template:
'<span> {{data.value}} <tree6 data=data.right></tree6><tree6 data=data.left></tree6>')
class TreeComponent7 {
var data;
}
@Component(
selector: 'tree8',
map: const {'data': '=>data'},
template:
'<span> {{data.value}} <tree7 data=data.right></tree7><tree7 data=data.left></tree7>')
class TreeComponent8 {
var data;
}
@Component(
selector: 'tree9',
map: const {'data': '=>data'},
template:
'<span> {{data.value}} <tree8 data=data.right></tree8><tree8 data=data.left></tree8>')
class TreeComponent9 {
var data;
}
buildTree(maxDepth, values, curDepth) {
if (maxDepth == curDepth) return new TreeNode('');
return new TreeNode(
values[curDepth],
buildTree(maxDepth, values, curDepth + 1),
buildTree(maxDepth, values, curDepth + 1));
}
class TreeNode {
var value;
TreeNode left;
TreeNode right;
TreeNode([this.value, this.left, this.right]);
}

View File

@ -1 +0,0 @@
library benchmarks_external.src.tree.react;

View File

@ -1,73 +0,0 @@
// tree benchmark in AngularDart 1.x
library tree_benchmark_ng10;
import 'package:angular/angular.dart';
import 'package:angular/application_factory.dart';
import 'package:angular2/src/testing/benchmark_util.dart';
setup() {
var m = new Module()
..bind(CompilerConfig,
toValue: new CompilerConfig.withOptions(elementProbeEnabled: false))
..bind(ScopeDigestTTL,
toFactory: () => new ScopeDigestTTL.value(15), inject: [])
..bind(TreeComponent);
final injector = applicationFactory().addModule(m).run();
return injector;
}
main() {
var maxDepth = getIntParameter('depth');
final injector = setup();
final zone = injector.get(VmTurnZone);
final rootScope = injector.get(Scope);
var count = 0;
destroyDom() {
zone.run(() {
rootScope.context['initData'] = new TreeNode('');
});
}
createDom() {
zone.run(() {
var values = count++ % 2 == 0
? ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '*']
: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', '-'];
rootScope.context['initData'] = buildTree(maxDepth, values, 0);
});
}
bindAction('#destroyDom', destroyDom);
bindAction('#createDom', createDom);
}
@Component(
selector: 'tree',
map: const {'data': '=>data'},
template: '<span> {{data.value}}'
'<span ng-if="data.right != null"><tree data=data.right></span>'
'<span ng-if="data.left != null"><tree data=data.left></span>'
'</span>')
class TreeComponent {
var data;
}
buildTree(maxDepth, values, curDepth) {
if (maxDepth == curDepth) return new TreeNode('');
return new TreeNode(
values[curDepth],
buildTree(maxDepth, values, curDepth + 1),
buildTree(maxDepth, values, curDepth + 1));
}
class TreeNode {
var value;
TreeNode left;
TreeNode right;
TreeNode([this.value, this.left, this.right]);
}

View File

@ -1,11 +0,0 @@
#!/bin/bash
set -ex
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
# this is needed because we're running JS tests in Dartium too
source $SCRIPT_DIR/env_dart.sh
cd $SCRIPT_DIR/../..
./node_modules/.bin/gulp buildRouter.dev

View File

@ -1,35 +0,0 @@
#!/bin/bash
set -ex
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
source $SCRIPT_DIR/env_dart.sh
cd $SCRIPT_DIR/../..
./node_modules/.bin/webdriver-manager update
function killServer () {
kill $serverPid
}
# Serving pre-compiled dart JS takes an extra 15m.
# So we do this only for post-commit testing.
# Pull requests test with Dartium and pub serve
# TODO(jeffbcross): restore conditional dart2js/pubserve #4316
#if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
./node_modules/.bin/gulp build/pubbuild.dart
./node_modules/.bin/gulp serve.js.prod serve.js.dart2js&
serverPid=$!
#else
# ./node_modules/.bin/gulp serve.js.prod serve.dart&
# serverPid=$!
#fi
trap killServer EXIT
# wait for server to come up!
sleep 10
./node_modules/.bin/protractor protractor-js.conf.js --browsers=$PERF_BROWSERS --benchmark
./node_modules/.bin/protractor protractor-dart2js.conf.js --browsers=$PERF_BROWSERS --benchmark

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -ex
echo =============================================================================
# go to project dir
SCRIPT_DIR=$(dirname $0)
source $SCRIPT_DIR/env_dart.sh
cd $SCRIPT_DIR/../..
./node_modules/.bin/gulp test.unit.router/ci --browsers=${KARMA_JS_BROWSERS:-Chrome}