
committed by
Miško Hevery

parent
4415855683
commit
e916836261
@ -6,7 +6,7 @@ var ParserUtil = require('./parser_util');
|
||||
|
||||
class Profiler {
|
||||
private _profiler;
|
||||
private _markerEvents: List<any>;
|
||||
private _markerEvents: any[];
|
||||
private _profilerStartTime: number;
|
||||
|
||||
constructor() { this._profiler = Cc['@mozilla.org/tools/profiler;1'].getService(Ci.nsIProfiler); }
|
||||
@ -27,7 +27,7 @@ class Profiler {
|
||||
return perfEvents;
|
||||
}
|
||||
|
||||
_mergeMarkerEvents(perfEvents: List<any>): List<any> {
|
||||
_mergeMarkerEvents(perfEvents: any[]): any[] {
|
||||
this._markerEvents.forEach(function(markerEvent) { perfEvents.push(markerEvent); });
|
||||
return perfEvents;
|
||||
}
|
||||
|
@ -2,12 +2,12 @@
|
||||
|
||||
/**
|
||||
* @param {Object} perfProfile The perf profile JSON object.
|
||||
* @return {Array<Object>} An array of recognized events that are captured
|
||||
* @return {Object[]} An array of recognized events that are captured
|
||||
* within the perf profile.
|
||||
*/
|
||||
export function convertPerfProfileToEvents(perfProfile: any): List<any> {
|
||||
export function convertPerfProfileToEvents(perfProfile: any): any[] {
|
||||
var inProgressEvents = new Map(); // map from event name to start time
|
||||
var finishedEvents = []; // Array<Event> finished events
|
||||
var finishedEvents = []; // Event[] finished events
|
||||
var addFinishedEvent = function(eventName, startTime, endTime) {
|
||||
var categorizedEventName = categorizeEvent(eventName);
|
||||
var args = undefined;
|
||||
|
@ -1,11 +1,11 @@
|
||||
import {bind, Binding, Injector, OpaqueToken} from 'angular2/di';
|
||||
import {List, ListWrapper, StringMapWrapper, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper, StringMapWrapper, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async';
|
||||
|
||||
import {Metric} from '../metric';
|
||||
|
||||
export class MultiMetric extends Metric {
|
||||
static createBindings(childTokens): List<Binding> {
|
||||
static createBindings(childTokens): Binding[] {
|
||||
return [
|
||||
bind(_CHILDREN)
|
||||
.toFactory(
|
||||
@ -15,7 +15,7 @@ export class MultiMetric extends Metric {
|
||||
];
|
||||
}
|
||||
|
||||
constructor(private _metrics: List<Metric>) { super(); }
|
||||
constructor(private _metrics: Metric[]) { super(); }
|
||||
|
||||
/**
|
||||
* Starts measuring
|
||||
@ -52,4 +52,4 @@ function mergeStringMaps(maps): Object {
|
||||
return result;
|
||||
}
|
||||
|
||||
var _CHILDREN = new OpaqueToken('MultiMetric.children');
|
||||
var _CHILDREN = new OpaqueToken('MultiMetric.children');
|
||||
|
@ -20,11 +20,11 @@ import {Options} from '../common_options';
|
||||
*/
|
||||
export class PerflogMetric extends Metric {
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get BINDINGS(): List<Binding> { return _BINDINGS; }
|
||||
static get BINDINGS(): Binding[] { return _BINDINGS; }
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get SET_TIMEOUT(): OpaqueToken { return _SET_TIMEOUT; }
|
||||
|
||||
private _remainingEvents: List<StringMap<string, any>>;
|
||||
private _remainingEvents: Array<StringMap<string, any>>;
|
||||
private _measureCount: number;
|
||||
_perfLogFeatures: PerfLogFeatures;
|
||||
|
||||
@ -171,7 +171,7 @@ export class PerflogMetric extends Metric {
|
||||
}
|
||||
}
|
||||
|
||||
_aggregateEvents(events: List<StringMap<string, any>>, markName): StringMap<string, any> {
|
||||
_aggregateEvents(events: Array<StringMap<string, any>>, markName): StringMap<string, any> {
|
||||
var result = {'scriptTime': 0, 'pureScriptTime': 0};
|
||||
if (this._perfLogFeatures.gc) {
|
||||
result['gcTime'] = 0;
|
||||
@ -310,7 +310,7 @@ export class PerflogMetric extends Metric {
|
||||
_addFrameMetrics(result: StringMap<string, any>, frameTimes: any[]) {
|
||||
result['frameTime.mean'] =
|
||||
ListWrapper.reduce(frameTimes, (a, b) => a + b, 0) / frameTimes.length;
|
||||
var firstFrame = ListWrapper.get(frameTimes, 0);
|
||||
var firstFrame = frameTimes[0];
|
||||
result['frameTime.worst'] = ListWrapper.reduce(frameTimes, (a, b) => a > b ? a : b, firstFrame);
|
||||
result['frameTime.best'] = ListWrapper.reduce(frameTimes, (a, b) => a < b ? a : b, firstFrame);
|
||||
result['frameTime.smooth'] =
|
||||
|
@ -2,7 +2,6 @@ import {bind, Binding} from 'angular2/di';
|
||||
import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async';
|
||||
import {ABSTRACT, BaseException} from 'angular2/src/core/facade/lang';
|
||||
import {MeasureValues} from './measure_values';
|
||||
import {List} from 'angular2/src/core/facade/collection';
|
||||
|
||||
/**
|
||||
* A reporter reports measure values and the valid sample.
|
||||
@ -15,8 +14,7 @@ export class Reporter {
|
||||
|
||||
reportMeasureValues(values: MeasureValues): Promise<any> { throw new BaseException('NYI'); }
|
||||
|
||||
reportSample(completeSample: List<MeasureValues>,
|
||||
validSample: List<MeasureValues>): Promise<any> {
|
||||
reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): Promise<any> {
|
||||
throw new BaseException('NYI');
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {print, isPresent, isBlank, NumberWrapper} from 'angular2/src/core/facade/lang';
|
||||
import {StringMapWrapper, ListWrapper, List} from 'angular2/src/core/facade/collection';
|
||||
import {StringMapWrapper, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async';
|
||||
import {Math} from 'angular2/src/core/facade/math';
|
||||
import {bind, Binding, OpaqueToken} from 'angular2/di';
|
||||
@ -18,7 +18,7 @@ export class ConsoleReporter extends Reporter {
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get COLUMN_WIDTH(): OpaqueToken { return _COLUMN_WIDTH; }
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get BINDINGS(): List<Binding> { return _BINDINGS; }
|
||||
static get BINDINGS(): Binding[] { return _BINDINGS; }
|
||||
|
||||
|
||||
static _lpad(value, columnWidth, fill = ' ') {
|
||||
@ -38,7 +38,7 @@ export class ConsoleReporter extends Reporter {
|
||||
return props;
|
||||
}
|
||||
|
||||
private _metricNames: List<string>;
|
||||
private _metricNames: string[];
|
||||
|
||||
constructor(private _columnWidth: number, sampleDescription, private _print: Function) {
|
||||
super();
|
||||
@ -69,8 +69,7 @@ export class ConsoleReporter extends Reporter {
|
||||
return PromiseWrapper.resolve(null);
|
||||
}
|
||||
|
||||
reportSample(completeSample: List<MeasureValues>,
|
||||
validSample: List<MeasureValues>): Promise<any> {
|
||||
reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): Promise<any> {
|
||||
this._printStringRow(this._metricNames.map((_) => ''), '=');
|
||||
this._printStringRow(ListWrapper.map(this._metricNames, (metricName) => {
|
||||
var sample =
|
||||
|
@ -1,5 +1,4 @@
|
||||
import {DateWrapper, isPresent, isBlank, Json} from 'angular2/src/core/facade/lang';
|
||||
import {List} from 'angular2/src/core/facade/collection';
|
||||
import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async';
|
||||
|
||||
import {bind, Binding, OpaqueToken} from 'angular2/di';
|
||||
@ -16,7 +15,7 @@ export class JsonFileReporter extends Reporter {
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get PATH(): OpaqueToken { return _PATH; }
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get BINDINGS(): List<Binding> { return _BINDINGS; }
|
||||
static get BINDINGS(): Binding[] { return _BINDINGS; }
|
||||
|
||||
_writeFile: Function;
|
||||
_path: string;
|
||||
@ -35,8 +34,7 @@ export class JsonFileReporter extends Reporter {
|
||||
return PromiseWrapper.resolve(null);
|
||||
}
|
||||
|
||||
reportSample(completeSample: List<MeasureValues>,
|
||||
validSample: List<MeasureValues>): Promise<any> {
|
||||
reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): Promise<any> {
|
||||
var content = Json.stringify({
|
||||
'description': this._description,
|
||||
'completeSample': completeSample,
|
||||
|
@ -1,12 +1,12 @@
|
||||
import {bind, Binding, Injector, OpaqueToken} from 'angular2/di';
|
||||
import {List, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async';
|
||||
|
||||
import {MeasureValues} from '../measure_values';
|
||||
import {Reporter} from '../reporter';
|
||||
|
||||
export class MultiReporter extends Reporter {
|
||||
static createBindings(childTokens: List<any>): List<Binding> {
|
||||
static createBindings(childTokens: any[]): Binding[] {
|
||||
return [
|
||||
bind(_CHILDREN)
|
||||
.toFactory(
|
||||
@ -16,20 +16,19 @@ export class MultiReporter extends Reporter {
|
||||
];
|
||||
}
|
||||
|
||||
_reporters: List<Reporter>;
|
||||
_reporters: Reporter[];
|
||||
|
||||
constructor(reporters) {
|
||||
super();
|
||||
this._reporters = reporters;
|
||||
}
|
||||
|
||||
reportMeasureValues(values: MeasureValues): Promise<List<any>> {
|
||||
reportMeasureValues(values: MeasureValues): Promise<any[]> {
|
||||
return PromiseWrapper.all(
|
||||
ListWrapper.map(this._reporters, (reporter) => reporter.reportMeasureValues(values)));
|
||||
}
|
||||
|
||||
reportSample(completeSample: List<MeasureValues>,
|
||||
validSample: List<MeasureValues>): Promise<List<any>> {
|
||||
reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): Promise<any[]> {
|
||||
return PromiseWrapper.all(ListWrapper.map(
|
||||
this._reporters, (reporter) => reporter.reportSample(completeSample, validSample)));
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
import {Injector, bind, Binding} from 'angular2/di';
|
||||
import {isPresent, isBlank} from 'angular2/src/core/facade/lang';
|
||||
import {List, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async';
|
||||
|
||||
import {Sampler, SampleState} from './sampler';
|
||||
@ -26,8 +25,8 @@ import {Options} from './common_options';
|
||||
* It provides defaults, creates the injector and calls the sampler.
|
||||
*/
|
||||
export class Runner {
|
||||
private _defaultBindings: List<Binding>;
|
||||
constructor(defaultBindings: List<Binding> = null) {
|
||||
private _defaultBindings: Binding[];
|
||||
constructor(defaultBindings: Binding[] = null) {
|
||||
if (isBlank(defaultBindings)) {
|
||||
defaultBindings = [];
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {StringMapWrapper, ListWrapper, List, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {StringMapWrapper, ListWrapper, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {bind, Binding, OpaqueToken} from 'angular2/di';
|
||||
import {Validator} from './validator';
|
||||
import {Metric} from './metric';
|
||||
@ -9,10 +9,10 @@ import {Options} from './common_options';
|
||||
*/
|
||||
export class SampleDescription {
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get BINDINGS(): List<Binding> { return _BINDINGS; }
|
||||
static get BINDINGS(): Binding[] { return _BINDINGS; }
|
||||
description: StringMap<string, any>;
|
||||
|
||||
constructor(public id: string, descriptions: List<StringMap<string, any>>,
|
||||
constructor(public id: string, descriptions: Array<StringMap<string, any>>,
|
||||
public metrics: StringMap<string, any>) {
|
||||
this.description = {};
|
||||
ListWrapper.forEach(descriptions, (description) => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {isPresent, isBlank, Date, DateWrapper} from 'angular2/src/core/facade/lang';
|
||||
import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async';
|
||||
import {StringMapWrapper, StringMap, List, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {StringMapWrapper, StringMap, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {bind, Binding, OpaqueToken} from 'angular2/di';
|
||||
|
||||
import {Metric} from './metric';
|
||||
@ -21,7 +21,7 @@ import {MeasureValues} from './measure_values';
|
||||
*/
|
||||
export class Sampler {
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get BINDINGS(): List<Binding> { return _BINDINGS; }
|
||||
static get BINDINGS(): Binding[] { return _BINDINGS; }
|
||||
|
||||
_driver: WebDriverAdapter;
|
||||
_metric: Metric;
|
||||
@ -80,7 +80,7 @@ export class Sampler {
|
||||
|
||||
_report(state: SampleState, metricValues: StringMap<string, any>): Promise<SampleState> {
|
||||
var measureValues = new MeasureValues(state.completeSample.length, this._now(), metricValues);
|
||||
var completeSample = ListWrapper.concat(state.completeSample, [measureValues]);
|
||||
var completeSample = state.completeSample.concat([measureValues]);
|
||||
var validSample = this._validator.validate(completeSample);
|
||||
var resultPromise = this._reporter.reportMeasureValues(measureValues);
|
||||
if (isPresent(validSample)) {
|
||||
@ -92,7 +92,7 @@ export class Sampler {
|
||||
}
|
||||
|
||||
export class SampleState {
|
||||
constructor(public completeSample: List<any>, public validSample: List<any>) {}
|
||||
constructor(public completeSample: any[], public validSample: any[]) {}
|
||||
}
|
||||
|
||||
var _BINDINGS = [
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Math} from 'angular2/src/core/facade/math';
|
||||
import {ListWrapper, List} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
|
||||
export class Statistic {
|
||||
static calculateCoefficientOfVariation(sample, mean) {
|
||||
@ -20,7 +20,7 @@ export class Statistic {
|
||||
return deviation;
|
||||
}
|
||||
|
||||
static calculateRegressionSlope(xValues: List<number>, xMean: number, yValues: List<number>,
|
||||
static calculateRegressionSlope(xValues: number[], xMean: number, yValues: number[],
|
||||
yMean: number) {
|
||||
// See http://en.wikipedia.org/wiki/Simple_linear_regression
|
||||
var dividendSum = 0;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {bind, Binding} from 'angular2/di';
|
||||
import {List, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {ABSTRACT, BaseException} from 'angular2/src/core/facade/lang';
|
||||
|
||||
import {MeasureValues} from './measure_values';
|
||||
@ -18,9 +18,7 @@ export class Validator {
|
||||
/**
|
||||
* Calculates a valid sample out of the complete sample
|
||||
*/
|
||||
validate(completeSample: List<MeasureValues>): List<MeasureValues> {
|
||||
throw new BaseException('NYI');
|
||||
}
|
||||
validate(completeSample: MeasureValues[]): MeasureValues[] { throw new BaseException('NYI'); }
|
||||
|
||||
/**
|
||||
* Returns a Map that describes the properties of the validator
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {List, ListWrapper, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {bind, Binding, OpaqueToken} from 'angular2/di';
|
||||
|
||||
import {Validator} from '../validator';
|
||||
@ -15,7 +15,7 @@ export class RegressionSlopeValidator extends Validator {
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get METRIC(): OpaqueToken { return _METRIC; }
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get BINDINGS(): List<Binding> { return _BINDINGS; }
|
||||
static get BINDINGS(): Binding[] { return _BINDINGS; }
|
||||
|
||||
_sampleSize: number;
|
||||
_metric: string;
|
||||
@ -30,7 +30,7 @@ export class RegressionSlopeValidator extends Validator {
|
||||
return {'sampleSize': this._sampleSize, 'regressionSlopeMetric': this._metric};
|
||||
}
|
||||
|
||||
validate(completeSample: List<MeasureValues>): List<MeasureValues> {
|
||||
validate(completeSample: MeasureValues[]): MeasureValues[] {
|
||||
if (completeSample.length >= this._sampleSize) {
|
||||
var latestSample = ListWrapper.slice(completeSample, completeSample.length - this._sampleSize,
|
||||
completeSample.length);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {List, ListWrapper, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {bind, Binding, OpaqueToken} from 'angular2/di';
|
||||
|
||||
import {Validator} from '../validator';
|
||||
@ -9,7 +9,7 @@ import {MeasureValues} from '../measure_values';
|
||||
*/
|
||||
export class SizeValidator extends Validator {
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get BINDINGS(): List<Binding> { return _BINDINGS; }
|
||||
static get BINDINGS(): Binding[] { return _BINDINGS; }
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get SAMPLE_SIZE() { return _SAMPLE_SIZE; }
|
||||
|
||||
@ -22,7 +22,7 @@ export class SizeValidator extends Validator {
|
||||
|
||||
describe(): StringMap<string, any> { return {'sampleSize': this._sampleSize}; }
|
||||
|
||||
validate(completeSample: List<MeasureValues>): List<MeasureValues> {
|
||||
validate(completeSample: MeasureValues[]): MeasureValues[] {
|
||||
if (completeSample.length >= this._sampleSize) {
|
||||
return ListWrapper.slice(completeSample, completeSample.length - this._sampleSize,
|
||||
completeSample.length);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {bind, Binding} from 'angular2/di';
|
||||
import {Promise} from 'angular2/src/core/facade/async';
|
||||
import {BaseException, ABSTRACT} from 'angular2/src/core/facade/lang';
|
||||
import {List, Map} from 'angular2/src/core/facade/collection';
|
||||
import {Map} from 'angular2/src/core/facade/collection';
|
||||
|
||||
/**
|
||||
* A WebDriverAdapter bridges API differences between different WebDriver clients,
|
||||
@ -18,5 +18,5 @@ export class WebDriverAdapter {
|
||||
executeScript(script: string): Promise<any> { throw new BaseException('NYI'); }
|
||||
executeAsyncScript(script: string): Promise<any> { throw new BaseException('NYI'); }
|
||||
capabilities(): Promise<Map<string, any>> { throw new BaseException('NYI'); }
|
||||
logs(type: string): Promise<List<any>> { throw new BaseException('NYI'); }
|
||||
logs(type: string): Promise<any[]> { throw new BaseException('NYI'); }
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import {bind, Binding, Injector, OpaqueToken} from 'angular2/di';
|
||||
|
||||
import {BaseException, ABSTRACT, isBlank, isPresent} from 'angular2/src/core/facade/lang';
|
||||
import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async';
|
||||
import {List, ListWrapper, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper, StringMap} from 'angular2/src/core/facade/collection';
|
||||
|
||||
import {Options} from './common_options';
|
||||
|
||||
@ -13,7 +13,7 @@ import {Options} from './common_options';
|
||||
*/
|
||||
@ABSTRACT()
|
||||
export class WebDriverExtension {
|
||||
static bindTo(childTokens): List<Binding> {
|
||||
static bindTo(childTokens): Binding[] {
|
||||
var res = [
|
||||
bind(_CHILDREN)
|
||||
.toFactory(
|
||||
@ -57,7 +57,7 @@ export class WebDriverExtension {
|
||||
* Based on [Chrome Trace Event
|
||||
*Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit)
|
||||
**/
|
||||
readPerfLog(): Promise<List<any>> { throw new BaseException('NYI'); }
|
||||
readPerfLog(): Promise<any[]> { throw new BaseException('NYI'); }
|
||||
|
||||
perfLogFeatures(): PerfLogFeatures { throw new BaseException('NYI'); }
|
||||
|
||||
|
@ -23,7 +23,7 @@ import {Promise} from 'angular2/src/core/facade/async';
|
||||
*/
|
||||
export class ChromeDriverExtension extends WebDriverExtension {
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get BINDINGS(): List<Binding> { return _BINDINGS; }
|
||||
static get BINDINGS(): Binding[] { return _BINDINGS; }
|
||||
|
||||
constructor(private _driver: WebDriverAdapter) { super(); }
|
||||
|
||||
@ -63,8 +63,8 @@ export class ChromeDriverExtension extends WebDriverExtension {
|
||||
});
|
||||
}
|
||||
|
||||
_convertPerfRecordsToEvents(chromeEvents: List<StringMap<string, any>>,
|
||||
normalizedEvents: List<StringMap<string, any>> = null) {
|
||||
_convertPerfRecordsToEvents(chromeEvents: Array<StringMap<string, any>>,
|
||||
normalizedEvents: Array<StringMap<string, any>> = null) {
|
||||
if (isBlank(normalizedEvents)) {
|
||||
normalizedEvents = [];
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import {WebDriverAdapter} from '../web_driver_adapter';
|
||||
import {Promise} from 'angular2/src/core/facade/async';
|
||||
|
||||
export class FirefoxDriverExtension extends WebDriverExtension {
|
||||
static get BINDINGS(): List<Binding> { return _BINDINGS; }
|
||||
static get BINDINGS(): Binding[] { return _BINDINGS; }
|
||||
|
||||
private _profilerStarted: boolean;
|
||||
|
||||
|
@ -15,7 +15,7 @@ import {Promise} from 'angular2/src/core/facade/async';
|
||||
|
||||
export class IOsDriverExtension extends WebDriverExtension {
|
||||
// TODO(tbosch): use static values when our transpiler supports them
|
||||
static get BINDINGS(): List<Binding> { return _BINDINGS; }
|
||||
static get BINDINGS(): Binding[] { return _BINDINGS; }
|
||||
|
||||
constructor(private _driver: WebDriverAdapter) { super(); }
|
||||
|
||||
|
@ -8,7 +8,7 @@ import * as webdriver from 'selenium-webdriver';
|
||||
* Adapter for the selenium-webdriver.
|
||||
*/
|
||||
export class SeleniumWebDriverAdapter extends WebDriverAdapter {
|
||||
static get PROTRACTOR_BINDINGS(): List<Binding> { return _PROTRACTOR_BINDINGS; }
|
||||
static get PROTRACTOR_BINDINGS(): Binding[] { return _PROTRACTOR_BINDINGS; }
|
||||
|
||||
constructor(private _driver: any) { super(); }
|
||||
|
||||
|
@ -11,7 +11,7 @@ import {
|
||||
xit,
|
||||
} from 'angular2/test_lib';
|
||||
|
||||
import {List, ListWrapper, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async';
|
||||
|
||||
import {Metric, MultiMetric, bind, Injector} from 'benchpress/common';
|
||||
|
@ -11,7 +11,7 @@ import {
|
||||
xit,
|
||||
} from 'angular2/test_lib';
|
||||
|
||||
import {List, ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection';
|
||||
import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async';
|
||||
import {isPresent, isBlank} from 'angular2/src/core/facade/lang';
|
||||
|
||||
@ -641,7 +641,7 @@ export function main() {
|
||||
}
|
||||
|
||||
class MockDriverExtension extends WebDriverExtension {
|
||||
constructor(private _perfLogs: List<any>, private _commandLog: List<any>,
|
||||
constructor(private _perfLogs: any[], private _commandLog: any[],
|
||||
private _perfLogFeatures: PerfLogFeatures) {
|
||||
super();
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
import {describe, ddescribe, it, iit, xit, expect, beforeEach, afterEach} from 'angular2/test_lib';
|
||||
|
||||
import {isBlank, isPresent, Date, DateWrapper} from 'angular2/src/core/facade/lang';
|
||||
import {List, ListWrapper} from 'angular2/src/core/facade/collection';
|
||||
|
||||
import {
|
||||
SampleState,
|
||||
|
@ -11,7 +11,7 @@ import {
|
||||
xit,
|
||||
} from 'angular2/test_lib';
|
||||
|
||||
import {List, ListWrapper, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {ListWrapper, StringMap} from 'angular2/src/core/facade/collection';
|
||||
import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async';
|
||||
import {DateWrapper} from 'angular2/src/core/facade/lang';
|
||||
|
||||
@ -69,8 +69,8 @@ class MockReporter extends Reporter {
|
||||
return PromiseWrapper.resolve({'id': this._id, 'values': values});
|
||||
}
|
||||
|
||||
reportSample(completeSample: List<MeasureValues>,
|
||||
validSample: List<MeasureValues>): Promise<StringMap<string, any>> {
|
||||
reportSample(completeSample: MeasureValues[],
|
||||
validSample: MeasureValues[]): Promise<StringMap<string, any>> {
|
||||
return PromiseWrapper.resolve(
|
||||
{'id': this._id, 'completeSample': completeSample, 'validSample': validSample});
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ import {
|
||||
Date,
|
||||
DateWrapper
|
||||
} from 'angular2/src/core/facade/lang';
|
||||
import {ListWrapper, List} from 'angular2/src/core/facade/collection';
|
||||
import {PromiseWrapper, Promise} from 'angular2/src/core/facade/async';
|
||||
|
||||
import {
|
||||
@ -251,7 +250,7 @@ function createCountingMetric(log = null) {
|
||||
}
|
||||
|
||||
class MockDriverAdapter extends WebDriverAdapter {
|
||||
private _log: List<any>;
|
||||
private _log: any[];
|
||||
private _waitFor: Function;
|
||||
constructor(log = null, waitFor = null) {
|
||||
super();
|
||||
@ -272,7 +271,7 @@ class MockDriverAdapter extends WebDriverAdapter {
|
||||
|
||||
|
||||
class MockValidator extends Validator {
|
||||
private _log: List<any>;
|
||||
private _log: any[];
|
||||
constructor(log = null, private _validate: Function = null) {
|
||||
super();
|
||||
if (isBlank(log)) {
|
||||
@ -280,7 +279,7 @@ class MockValidator extends Validator {
|
||||
}
|
||||
this._log = log;
|
||||
}
|
||||
validate(completeSample: List<MeasureValues>): List<MeasureValues> {
|
||||
validate(completeSample: MeasureValues[]): MeasureValues[] {
|
||||
var stableSample = isPresent(this._validate) ? this._validate(completeSample) : completeSample;
|
||||
this._log.push(['validate', completeSample, stableSample]);
|
||||
return stableSample;
|
||||
@ -288,7 +287,7 @@ class MockValidator extends Validator {
|
||||
}
|
||||
|
||||
class MockMetric extends Metric {
|
||||
private _log: List<any>;
|
||||
private _log: any[];
|
||||
constructor(log = null, private _endMeasure: Function = null) {
|
||||
super();
|
||||
if (isBlank(log)) {
|
||||
@ -308,7 +307,7 @@ class MockMetric extends Metric {
|
||||
}
|
||||
|
||||
class MockReporter extends Reporter {
|
||||
_log: List<any>;
|
||||
_log: any[];
|
||||
constructor(log = null) {
|
||||
super();
|
||||
if (isBlank(log)) {
|
||||
|
@ -302,7 +302,7 @@ export function main() {
|
||||
}
|
||||
|
||||
class MockDriverAdapter extends WebDriverAdapter {
|
||||
constructor(private _log: List<any>, private _events: List<any>, private _messageMethod: string) {
|
||||
constructor(private _log: any[], private _events: any[], private _messageMethod: string) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ function internalScriptRecord(startTime, endTime) {
|
||||
}
|
||||
|
||||
class MockDriverAdapter extends WebDriverAdapter {
|
||||
constructor(private _log: List<any>, private _perfRecords: List<any>) { super(); }
|
||||
constructor(private _log: any[], private _perfRecords: any[]) { super(); }
|
||||
|
||||
executeScript(script) {
|
||||
this._log.push(['executeScript', script]);
|
||||
|
Reference in New Issue
Block a user