提交 5e0c8ed3 编写于 作者: P pah100

datazoom and ut

上级 b26b022d
/**
* DataZoom component entry
*/
define(function (require) {
require('./dataZoom/DataZoomModel');
require('./dataZoom/DataZoomView');
require('./dataZoom/DataZoomProcessor');
});
\ No newline at end of file
define(function(require) {
'use strict';
var List = require('../../data/List');
var zrUtil = require('zrender/core/util');
return require('../../echarts').extendComponentModel({
type: 'dataZoom',
depends: ['xAxis', 'yAxis'],
init: function (option, parentModel, ecModel) {
this.mergeDefaultAndTheme(option, ecModel);
/**
* @type {Object}
* @private
*/
this._state = {};
/**
* @type {Array}
* @private
*/
this._stack = [];
this.mergeOption();
},
mergeOption: function (newOption) {
var thisOption = this.option;
newOption && zrUtil.merge(thisOption, newOption);
// FIXME
// 实现?
// Disable realtime view update if canvas is not supported.
if (!zrUtil.canvasSupported()) {
thisOption.realtime = false;
}
// Init or reset zoom states.
var state = this._state;
var start = retrieveValue(thisOption.start, state.start, 0);
var end = retrieveValue(thisOption.end, state.end, 100);
// Auto reverse
(start > end) && (end = [start, start = end][0]);
state.start = start;
state.end = end;
// Overlap these arrays but not merge.
// FIXME
// zrUtil.merge是否有选项,决定array是否merge?
thisOption.xAxisIndex = retrieveValue(newOption.xAxisIndex, thisOption.xAxisIndex, []);
thisOption.yAxisIndex = retrieveValue(newOption.yAxisIndex, thisOption.yAxisIndex, []);
// Remove thisOption.start/end for consistence when processing merge.
// Consider this case:
// this.thisOption has start 10 and end 80,
// and state has start 20 and end 60,
// and newOption has start 40 but no end (means remain end 60).
thisOption.start = null;
thisOption.end = null;
},
setStart: function (start) {
this.option.start = start;
this._state.start = start;
},
setEnd: function (end) {
this.option.end = end;
this._state.end = end;
},
setRange: function (start, end) {
this.setStart(start);
this.setEnd(end);
this._state.start = start;
this._state.end = end;
},
defaultOption: {
zlevel: 0, // 一级层叠
z: 4, // 二级层叠
show: false,
orient: 'horizontal', // 布局方式,默认为水平布局,可选为:
// 'horizontal' ¦ 'vertical'
// x: {number}, // 水平安放位置,默认为根据grid参数适配,可选为:
// {number}(x坐标,单位px)
// y: {number}, // 垂直安放位置,默认为根据grid参数适配,可选为:
// {number}(y坐标,单位px)
// width: {number}, // 指定宽度,横向布局时默认为根据grid参数适配
// height: {number}, // 指定高度,纵向布局时默认为根据grid参数适配
backgroundColor: 'rgba(0,0,0,0)', // 背景颜色
dataBackgroundColor: '#eee', // 数据背景颜色
fillerColor: 'rgba(144,197,237,0.2)', // 填充颜色
handleColor: 'rgba(70,130,180,0.8)', // 手柄颜色
handleSize: 8,
showDetail: true,
// xAxisIndex: [], // 默认控制所有横向类目
// yAxisIndex: [], // 默认控制所有横向类目
// start: 0, // 默认为0
// end: 100, // 默认为全部 100%
realtime: true
// zoomLock: false // 是否锁定选择区域大小
}
});
// FIXME
// 公用?
/**
* If value1 is not null, then return value1, otherwise judget rest of values.
* @param {*...} values
* @return {*} Final value
*/
function retrieveValue(values) {
for (var i = 0, len = arguements.length; i < len; i++) {
if (arguements[i] != null) {
return arguements[i];
}
}
}
});
\ No newline at end of file
/**
* @file Data zoom processor
*/
define(function (require) {
require('../echarts').registerProcessor(function (ecModel) {
var legendModel = ecModel.getComponent('legend');
if (legendModel) {
ecModel.filterSeries(function (series) {
return legendModel.isSelected(series.name);
});
}
});
});
\ No newline at end of file
......@@ -7,10 +7,25 @@ define(function(require) {
'use strict';
var componentModelClasses = {};
var Model = require('./Model');
var zrUtil = require('zrender/core/util');
/**
* Component model classes
* @type {Object}
*/
var componentModelClasses = {};
/**
* key: conponentType,
* value: {
* predecessor: [conponentTypes...]
* successor: [conponentTypes...]
* }
* @type {Object}
*/
var dependencyGraph = {};
/**
* @alias module:echarts/model/Component
* @constructor
......@@ -45,9 +60,11 @@ define(function(require) {
var componentType = opts.type;
if (componentType) {
if (componentModelClasses[componentType]) {
// Warning
throw new Error('Component model "' + componentType + '" exists.');
}
componentModelClasses[componentType] = SubComponentModel;
initDepndency(opts);
}
return SubComponentModel;
};
......@@ -62,5 +79,67 @@ define(function(require) {
return !!componentModelClasses[name];
};
/**
* Topological travel on Activity Network (Activity On Vertices).
*
* @public
* @param {Array.<string>} componentTypeList Target Component type list.
* @param {Function} callback Params: componentType, depends.
*/
ComponentModel.topologicalTavel = function (componentTypeList, callback) {
if (!componentTypeList.length) {
return;
}
var stack = [];
var enterCount = [];
zrUtil.each(dependencyGraph, function (vertex, componentType) {
enterCount[componentType] = vertex.predecessor.length;
if (enterCount[componentType] === 0) {
stack.push(componentType);
}
});
if (!stack.length) {
throw new Error('Circle exists in dependency graph.');
}
while (stack.length) {
var currComponentType = stack.pop();
var currVertex = dependencyGraph[currComponentType];
callback(currComponentType, currVertex.predecessor.slice());
zrUtil.each(currVertex.successor, removeEdge);
}
function removeEdge(succComponentType) {
enterCount[succComponentType]--;
if (enterCount[succComponentType] === 0) {
stack.push(succComponentType);
}
}
};
function initDepndency(opts) {
var currComponentType = opts.type;
var thisItem = createDependencyMapItem(currComponentType);
zrUtil.each(opts.depends || [], function (depComponentType) {
if (zrUtil.indexOf(thisItem.predecessor, depComponentType) < 0) {
thisItem.predecessor.push(depComponentType);
}
var thatItem = createDependencyMapItem(depComponentType);
if (zrUtil.indexOf(thatItem.successor, depComponentType) < 0) {
thatItem.successor.push(currComponentType);
}
});
}
function createDependencyMapItem(componentType) {
if (!dependencyGraph[componentType]) {
dependencyGraph[componentType] = {predecessor: [], successor: []};
}
return dependencyGraph[componentType];
}
return ComponentModel;
});
\ No newline at end of file
......@@ -123,11 +123,12 @@ define(function (require) {
var componentsMap = this._componentsMap;
var components = this._components;
for (var name in newOption) {
var componentOption = newOption[name];
// 如果不存在对应的 component model 则直接 merge
if (! ComponentModel.has(name)) {
if (typeof componentOption === 'object') {
var modelNames = [];
// 如果不存在对应的 component model 则直接 merge
zrUtil.each(newOption, function (componentOption, name) {
if (!ComponentModel.has(name)) {
if (componentOption && typeof componentOption === 'object') {
option[name] = option[name] == null
? zrUtil.clone(componentOption)
: zrUtil.merge(option[name], componentOption);
......@@ -137,40 +138,48 @@ define(function (require) {
}
}
else {
// Normalize
if (! (componentOption instanceof Array)) {
componentOption = [componentOption];
modelNames.push(name);
}
});
ComponentModel.topologicalTavel(modelNames, function (name, depends) {
var componentOption = newOption[name];
// Normalize
if (!(componentOption instanceof Array)) {
componentOption = [componentOption];
}
if (!componentsMap[name]) {
componentsMap[name] = [];
}
for (var i = 0; i < componentOption.length; i++) {
var componentModel = componentsMap[name][i];
if (componentModel) {
componentModel.mergeOption(
componentOption[i], this
);
}
if (! componentsMap[name]) {
componentsMap[name] = [];
else {
componentModel = ComponentModel.create(
name, componentOption[i], this,
this._getComponentsByTypes(depends)
);
componentsMap[name][i] = componentModel;
components.push(componentModel);
}
for (var i = 0; i < componentOption.length; i++) {
var componentModel = componentsMap[name][i];
if (componentModel) {
componentModel.mergeOption(
componentOption[i], this
);
if (componentModel) {
// 同步 Option
if (componentOption instanceof Array) {
option[name] = option[name] || [];
option[name][i] = componentModel.option;
}
else {
componentModel = ComponentModel.create(
name, componentOption[i], this
);
componentsMap[name][i] = componentModel;
components.push(componentModel);
}
if (componentModel) {
// 同步 Option
if (componentOption instanceof Array) {
option[name] = option[name] || [];
option[name][i] = componentModel.option;
}
else {
option[name] = componentModel.option;
}
option[name] = componentModel.option;
}
}
}
}
});
},
/**
......@@ -278,6 +287,24 @@ define(function (require) {
for (i = 0; i < series.length; i++) {
series[i].restore();
}
},
/**
* @private
* @param {Array.<string>|string} types model types
* @return {Object} key: {string} type, value: {Array.<Object>} models
*/
_getComponentsByTypes: function (types) {
if (!(types instanceof Array)) {
types = types ? [types] : [];
}
var ret = {};
zrUtil.each(types, function (type) {
ret[type] = (this._componentsMap[type] || []).slice();
}, this);
return ret;
}
});
......
......@@ -9,7 +9,7 @@ define(function (require) {
* @alias module:echarts/model/Model
* @constructor
*/
function Model(option, parentModel) {
function Model(option, parentModel, ecModel, dependentModels) {
/**
* @type {module:echarts/model/Model}
......@@ -23,6 +23,12 @@ define(function (require) {
*/
this.option = option;
/**
* @type {Object}
* @readOnly
*/
this.dependentModels = dependentModels;
this.init.apply(this, arguments);
}
......
require.config({
packages: [{
main: 'echarts',
location: '../src',
name: 'echarts'
}, {
main: 'zrender',
location: '../../zrender-dev3.0/src',
name: 'zrender'
}]
packages: [
{
main: 'echarts',
location: '../src',
name: 'echarts'
},
{
main: 'zrender',
location: '../../zrender-dev3.0/src',
name: 'zrender'
}
],
urlArgs: '_v_=' + Math.random()
});
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Jasmine Spec Runner v2.3.4</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine-2.3.4/jasmine_favicon.png">
<link rel="stylesheet" href="ut/lib/jasmine-2.3.4/jasmine.css">
<script src="ut/lib/jasmine-2.3.4/jasmine.js"></script>
<script src="ut/lib/jasmine-2.3.4/jasmine-html.js"></script>
<script src="ut/lib/jasmine-2.3.4/boot.js"></script>
</head>
<body>
<script src="ut/all.js"></script>
</body>
</html>
Copyright (c) 2008-2014 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
document.write('<script src="ut/spec/common/helper.js"><\/script>');
// Specs ...
document.write('<script src="ut/spec/model/Component.js"><\/script>');
/**
Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
The location of `boot.js` can be specified and/or overridden in `jasmine.yml`.
[jasmine-gem]: http://github.com/pivotal/jasmine-gem
*/
(function() {
/**
* ## Require &amp; Instantiate
*
* Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
*/
window.jasmine = jasmineRequire.core(jasmineRequire);
/**
* Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
*/
jasmineRequire.html(jasmine);
/**
* Create the Jasmine environment. This is used to run all specs in a project.
*/
var env = jasmine.getEnv();
/**
* ## The Global Interface
*
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
*/
var jasmineInterface = jasmineRequire.interface(jasmine, env);
/**
* Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
*/
extend(window, jasmineInterface);
/**
* ## Runner Parameters
*
* More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
*/
var queryString = new jasmine.QueryString({
getWindowLocation: function() { return window.location; }
});
var catchingExceptions = queryString.getParam("catch");
env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions);
var throwingExpectationFailures = queryString.getParam("throwFailures");
env.throwOnExpectationFailure(throwingExpectationFailures);
/**
* ## Reporters
* The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
*/
var htmlReporter = new jasmine.HtmlReporter({
env: env,
onRaiseExceptionsClick: function() { queryString.navigateWithNewParam("catch", !env.catchingExceptions()); },
onThrowExpectationsClick: function() { queryString.navigateWithNewParam("throwFailures", !env.throwingExpectationFailures()); },
addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
getContainer: function() { return document.body; },
createElement: function() { return document.createElement.apply(document, arguments); },
createTextNode: function() { return document.createTextNode.apply(document, arguments); },
timer: new jasmine.Timer()
});
/**
* The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
*/
env.addReporter(jasmineInterface.jsApiReporter);
env.addReporter(htmlReporter);
/**
* Filter which specs will be run by matching the start of the full name against the `spec` query param.
*/
var specFilter = new jasmine.HtmlSpecFilter({
filterString: function() { return queryString.getParam("spec"); }
});
env.specFilter = function(spec) {
return specFilter.matches(spec.getFullName());
};
/**
* Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
*/
window.setTimeout = window.setTimeout;
window.setInterval = window.setInterval;
window.clearTimeout = window.clearTimeout;
window.clearInterval = window.clearInterval;
/**
* ## Execution
*
* Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
*/
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
htmlReporter.initialize();
env.execute();
};
/**
* Helper function for readability above.
*/
function extend(destination, source) {
for (var property in source) destination[property] = source[property];
return destination;
}
}());
/*
Copyright (c) 2008-2015 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
function getJasmineRequireObj() {
if (typeof module !== 'undefined' && module.exports) {
return exports;
} else {
window.jasmineRequire = window.jasmineRequire || {};
return window.jasmineRequire;
}
}
getJasmineRequireObj().console = function(jRequire, j$) {
j$.ConsoleReporter = jRequire.ConsoleReporter();
};
getJasmineRequireObj().ConsoleReporter = function() {
var noopTimer = {
start: function(){},
elapsed: function(){ return 0; }
};
function ConsoleReporter(options) {
var print = options.print,
showColors = options.showColors || false,
onComplete = options.onComplete || function() {},
timer = options.timer || noopTimer,
specCount,
failureCount,
failedSpecs = [],
pendingCount,
ansi = {
green: '\x1B[32m',
red: '\x1B[31m',
yellow: '\x1B[33m',
none: '\x1B[0m'
},
failedSuites = [];
print('ConsoleReporter is deprecated and will be removed in a future version.');
this.jasmineStarted = function() {
specCount = 0;
failureCount = 0;
pendingCount = 0;
print('Started');
printNewline();
timer.start();
};
this.jasmineDone = function() {
printNewline();
for (var i = 0; i < failedSpecs.length; i++) {
specFailureDetails(failedSpecs[i]);
}
if(specCount > 0) {
printNewline();
var specCounts = specCount + ' ' + plural('spec', specCount) + ', ' +
failureCount + ' ' + plural('failure', failureCount);
if (pendingCount) {
specCounts += ', ' + pendingCount + ' pending ' + plural('spec', pendingCount);
}
print(specCounts);
} else {
print('No specs found');
}
printNewline();
var seconds = timer.elapsed() / 1000;
print('Finished in ' + seconds + ' ' + plural('second', seconds));
printNewline();
for(i = 0; i < failedSuites.length; i++) {
suiteFailureDetails(failedSuites[i]);
}
onComplete(failureCount === 0);
};
this.specDone = function(result) {
specCount++;
if (result.status == 'pending') {
pendingCount++;
print(colored('yellow', '*'));
return;
}
if (result.status == 'passed') {
print(colored('green', '.'));
return;
}
if (result.status == 'failed') {
failureCount++;
failedSpecs.push(result);
print(colored('red', 'F'));
}
};
this.suiteDone = function(result) {
if (result.failedExpectations && result.failedExpectations.length > 0) {
failureCount++;
failedSuites.push(result);
}
};
return this;
function printNewline() {
print('\n');
}
function colored(color, str) {
return showColors ? (ansi[color] + str + ansi.none) : str;
}
function plural(str, count) {
return count == 1 ? str : str + 's';
}
function repeat(thing, times) {
var arr = [];
for (var i = 0; i < times; i++) {
arr.push(thing);
}
return arr;
}
function indent(str, spaces) {
var lines = (str || '').split('\n');
var newArr = [];
for (var i = 0; i < lines.length; i++) {
newArr.push(repeat(' ', spaces).join('') + lines[i]);
}
return newArr.join('\n');
}
function specFailureDetails(result) {
printNewline();
print(result.fullName);
for (var i = 0; i < result.failedExpectations.length; i++) {
var failedExpectation = result.failedExpectations[i];
printNewline();
print(indent(failedExpectation.message, 2));
print(indent(failedExpectation.stack, 2));
}
printNewline();
}
function suiteFailureDetails(result) {
for (var i = 0; i < result.failedExpectations.length; i++) {
printNewline();
print(colored('red', 'An error was thrown in an afterAll'));
printNewline();
print(colored('red', 'AfterAll ' + result.failedExpectations[i].message));
}
printNewline();
}
}
return ConsoleReporter;
};
/*
Copyright (c) 2008-2015 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
jasmineRequire.html = function(j$) {
j$.ResultsNode = jasmineRequire.ResultsNode();
j$.HtmlReporter = jasmineRequire.HtmlReporter(j$);
j$.QueryString = jasmineRequire.QueryString();
j$.HtmlSpecFilter = jasmineRequire.HtmlSpecFilter();
};
jasmineRequire.HtmlReporter = function(j$) {
var noopTimer = {
start: function() {},
elapsed: function() { return 0; }
};
function HtmlReporter(options) {
var env = options.env || {},
getContainer = options.getContainer,
createElement = options.createElement,
createTextNode = options.createTextNode,
onRaiseExceptionsClick = options.onRaiseExceptionsClick || function() {},
onThrowExpectationsClick = options.onThrowExpectationsClick || function() {},
addToExistingQueryString = options.addToExistingQueryString || defaultQueryString,
timer = options.timer || noopTimer,
results = [],
specsExecuted = 0,
failureCount = 0,
pendingSpecCount = 0,
htmlReporterMain,
symbols,
failedSuites = [];
this.initialize = function() {
clearPrior();
htmlReporterMain = createDom('div', {className: 'jasmine_html-reporter'},
createDom('div', {className: 'banner'},
createDom('a', {className: 'title', href: 'http://jasmine.github.io/', target: '_blank'}),
createDom('span', {className: 'version'}, j$.version)
),
createDom('ul', {className: 'symbol-summary'}),
createDom('div', {className: 'alert'}),
createDom('div', {className: 'results'},
createDom('div', {className: 'failures'})
)
);
getContainer().appendChild(htmlReporterMain);
symbols = find('.symbol-summary');
};
var totalSpecsDefined;
this.jasmineStarted = function(options) {
totalSpecsDefined = options.totalSpecsDefined || 0;
timer.start();
};
var summary = createDom('div', {className: 'summary'});
var topResults = new j$.ResultsNode({}, '', null),
currentParent = topResults;
this.suiteStarted = function(result) {
currentParent.addChild(result, 'suite');
currentParent = currentParent.last();
};
this.suiteDone = function(result) {
if (result.status == 'failed') {
failedSuites.push(result);
}
if (currentParent == topResults) {
return;
}
currentParent = currentParent.parent;
};
this.specStarted = function(result) {
currentParent.addChild(result, 'spec');
};
var failures = [];
this.specDone = function(result) {
if(noExpectations(result) && typeof console !== 'undefined' && typeof console.error !== 'undefined') {
console.error('Spec \'' + result.fullName + '\' has no expectations.');
}
if (result.status != 'disabled') {
specsExecuted++;
}
symbols.appendChild(createDom('li', {
className: noExpectations(result) ? 'empty' : result.status,
id: 'spec_' + result.id,
title: result.fullName
}
));
if (result.status == 'failed') {
failureCount++;
var failure =
createDom('div', {className: 'spec-detail failed'},
createDom('div', {className: 'description'},
createDom('a', {title: result.fullName, href: specHref(result)}, result.fullName)
),
createDom('div', {className: 'messages'})
);
var messages = failure.childNodes[1];
for (var i = 0; i < result.failedExpectations.length; i++) {
var expectation = result.failedExpectations[i];
messages.appendChild(createDom('div', {className: 'result-message'}, expectation.message));
messages.appendChild(createDom('div', {className: 'stack-trace'}, expectation.stack));
}
failures.push(failure);
}
if (result.status == 'pending') {
pendingSpecCount++;
}
};
this.jasmineDone = function() {
var banner = find('.banner');
var alert = find('.alert');
alert.appendChild(createDom('span', {className: 'duration'}, 'finished in ' + timer.elapsed() / 1000 + 's'));
banner.appendChild(
createDom('div', { className: 'run-options' },
createDom('span', { className: 'trigger' }, 'Options'),
createDom('div', { className: 'payload' },
createDom('div', { className: 'exceptions' },
createDom('input', {
className: 'raise',
id: 'raise-exceptions',
type: 'checkbox'
}),
createDom('label', { className: 'label', 'for': 'raise-exceptions' }, 'raise exceptions')),
createDom('div', { className: 'throw-failures' },
createDom('input', {
className: 'throw',
id: 'throw-failures',
type: 'checkbox'
}),
createDom('label', { className: 'label', 'for': 'throw-failures' }, 'stop spec on expectation failure'))
)
));
var raiseCheckbox = find('#raise-exceptions');
raiseCheckbox.checked = !env.catchingExceptions();
raiseCheckbox.onclick = onRaiseExceptionsClick;
var throwCheckbox = find('#throw-failures');
throwCheckbox.checked = env.throwingExpectationFailures();
throwCheckbox.onclick = onThrowExpectationsClick;
var optionsMenu = find('.run-options'),
optionsTrigger = optionsMenu.querySelector('.trigger'),
optionsPayload = optionsMenu.querySelector('.payload'),
isOpen = /\bopen\b/;
optionsTrigger.onclick = function() {
if (isOpen.test(optionsPayload.className)) {
optionsPayload.className = optionsPayload.className.replace(isOpen, '');
} else {
optionsPayload.className += ' open';
}
};
if (specsExecuted < totalSpecsDefined) {
var skippedMessage = 'Ran ' + specsExecuted + ' of ' + totalSpecsDefined + ' specs - run all';
alert.appendChild(
createDom('span', {className: 'bar skipped'},
createDom('a', {href: '?', title: 'Run all specs'}, skippedMessage)
)
);
}
var statusBarMessage = '';
var statusBarClassName = 'bar ';
if (totalSpecsDefined > 0) {
statusBarMessage += pluralize('spec', specsExecuted) + ', ' + pluralize('failure', failureCount);
if (pendingSpecCount) { statusBarMessage += ', ' + pluralize('pending spec', pendingSpecCount); }
statusBarClassName += (failureCount > 0) ? 'failed' : 'passed';
} else {
statusBarClassName += 'skipped';
statusBarMessage += 'No specs found';
}
alert.appendChild(createDom('span', {className: statusBarClassName}, statusBarMessage));
for(i = 0; i < failedSuites.length; i++) {
var failedSuite = failedSuites[i];
for(var j = 0; j < failedSuite.failedExpectations.length; j++) {
var errorBarMessage = 'AfterAll ' + failedSuite.failedExpectations[j].message;
var errorBarClassName = 'bar errored';
alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessage));
}
}
var results = find('.results');
results.appendChild(summary);
summaryList(topResults, summary);
function summaryList(resultsTree, domParent) {
var specListNode;
for (var i = 0; i < resultsTree.children.length; i++) {
var resultNode = resultsTree.children[i];
if (resultNode.type == 'suite') {
var suiteListNode = createDom('ul', {className: 'suite', id: 'suite-' + resultNode.result.id},
createDom('li', {className: 'suite-detail'},
createDom('a', {href: specHref(resultNode.result)}, resultNode.result.description)
)
);
summaryList(resultNode, suiteListNode);
domParent.appendChild(suiteListNode);
}
if (resultNode.type == 'spec') {
if (domParent.getAttribute('class') != 'specs') {
specListNode = createDom('ul', {className: 'specs'});
domParent.appendChild(specListNode);
}
var specDescription = resultNode.result.description;
if(noExpectations(resultNode.result)) {
specDescription = 'SPEC HAS NO EXPECTATIONS ' + specDescription;
}
if(resultNode.result.status === 'pending' && resultNode.result.pendingReason !== '') {
specDescription = specDescription + ' PENDING WITH MESSAGE: ' + resultNode.result.pendingReason;
}
specListNode.appendChild(
createDom('li', {
className: resultNode.result.status,
id: 'spec-' + resultNode.result.id
},
createDom('a', {href: specHref(resultNode.result)}, specDescription)
)
);
}
}
}
if (failures.length) {
alert.appendChild(
createDom('span', {className: 'menu bar spec-list'},
createDom('span', {}, 'Spec List | '),
createDom('a', {className: 'failures-menu', href: '#'}, 'Failures')));
alert.appendChild(
createDom('span', {className: 'menu bar failure-list'},
createDom('a', {className: 'spec-list-menu', href: '#'}, 'Spec List'),
createDom('span', {}, ' | Failures ')));
find('.failures-menu').onclick = function() {
setMenuModeTo('failure-list');
};
find('.spec-list-menu').onclick = function() {
setMenuModeTo('spec-list');
};
setMenuModeTo('failure-list');
var failureNode = find('.failures');
for (var i = 0; i < failures.length; i++) {
failureNode.appendChild(failures[i]);
}
}
};
return this;
function find(selector) {
return getContainer().querySelector('.jasmine_html-reporter ' + selector);
}
function clearPrior() {
// return the reporter
var oldReporter = find('');
if(oldReporter) {
getContainer().removeChild(oldReporter);
}
}
function createDom(type, attrs, childrenVarArgs) {
var el = createElement(type);
for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];
if (typeof child === 'string') {
el.appendChild(createTextNode(child));
} else {
if (child) {
el.appendChild(child);
}
}
}
for (var attr in attrs) {
if (attr == 'className') {
el[attr] = attrs[attr];
} else {
el.setAttribute(attr, attrs[attr]);
}
}
return el;
}
function pluralize(singular, count) {
var word = (count == 1 ? singular : singular + 's');
return '' + count + ' ' + word;
}
function specHref(result) {
return addToExistingQueryString('spec', result.fullName);
}
function defaultQueryString(key, value) {
return '?' + key + '=' + value;
}
function setMenuModeTo(mode) {
htmlReporterMain.setAttribute('class', 'jasmine_html-reporter ' + mode);
}
function noExpectations(result) {
return (result.failedExpectations.length + result.passedExpectations.length) === 0 &&
result.status === 'passed';
}
}
return HtmlReporter;
};
jasmineRequire.HtmlSpecFilter = function() {
function HtmlSpecFilter(options) {
var filterString = options && options.filterString() && options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
var filterPattern = new RegExp(filterString);
this.matches = function(specName) {
return filterPattern.test(specName);
};
}
return HtmlSpecFilter;
};
jasmineRequire.ResultsNode = function() {
function ResultsNode(result, type, parent) {
this.result = result;
this.type = type;
this.parent = parent;
this.children = [];
this.addChild = function(result, type) {
this.children.push(new ResultsNode(result, type, this));
};
this.last = function() {
return this.children[this.children.length - 1];
};
}
return ResultsNode;
};
jasmineRequire.QueryString = function() {
function QueryString(options) {
this.navigateWithNewParam = function(key, value) {
options.getWindowLocation().search = this.fullStringWithNewParam(key, value);
};
this.fullStringWithNewParam = function(key, value) {
var paramMap = queryStringToParamMap();
paramMap[key] = value;
return toQueryString(paramMap);
};
this.getParam = function(key) {
return queryStringToParamMap()[key];
};
return this;
function toQueryString(paramMap) {
var qStrPairs = [];
for (var prop in paramMap) {
qStrPairs.push(encodeURIComponent(prop) + '=' + encodeURIComponent(paramMap[prop]));
}
return '?' + qStrPairs.join('&');
}
function queryStringToParamMap() {
var paramStr = options.getWindowLocation().search.substring(1),
params = [],
paramMap = {};
if (paramStr.length > 0) {
params = paramStr.split('&');
for (var i = 0; i < params.length; i++) {
var p = params[i].split('=');
var value = decodeURIComponent(p[1]);
if (value === 'true' || value === 'false') {
value = JSON.parse(value);
}
paramMap[decodeURIComponent(p[0])] = value;
}
}
return paramMap;
}
}
return QueryString;
};
body { overflow-y: scroll; }
.jasmine_html-reporter { background-color: #eee; padding: 5px; margin: -8px; font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333; }
.jasmine_html-reporter a { text-decoration: none; }
.jasmine_html-reporter a:hover { text-decoration: underline; }
.jasmine_html-reporter p, .jasmine_html-reporter h1, .jasmine_html-reporter h2, .jasmine_html-reporter h3, .jasmine_html-reporter h4, .jasmine_html-reporter h5, .jasmine_html-reporter h6 { margin: 0; line-height: 14px; }
.jasmine_html-reporter .banner, .jasmine_html-reporter .symbol-summary, .jasmine_html-reporter .summary, .jasmine_html-reporter .result-message, .jasmine_html-reporter .spec .description, .jasmine_html-reporter .spec-detail .description, .jasmine_html-reporter .alert .bar, .jasmine_html-reporter .stack-trace { padding-left: 9px; padding-right: 9px; }
.jasmine_html-reporter .banner { position: relative; }
.jasmine_html-reporter .banner .title { background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAAAZCAMAAACGusnyAAACdlBMVEX/////AP+AgICqVaqAQICZM5mAVYCSSZKAQICOOY6ATYCLRouAQICJO4mSSYCIRIiPQICHPIeOR4CGQ4aMQICGPYaLRoCFQ4WKQICPPYWJRYCOQoSJQICNPoSIRICMQoSHQICHRICKQoOHQICKPoOJO4OJQYOMQICMQ4CIQYKLQICIPoKLQ4CKQICNPoKJQISMQ4KJQoSLQYKJQISLQ4KIQoSKQYKIQICIQISMQoSKQYKLQIOLQoOJQYGLQIOKQIOMQoGKQYOLQYGKQIOLQoGJQYOJQIOKQYGJQIOKQoGKQIGLQIKLQ4KKQoGLQYKJQIGKQYKJQIGKQIKJQoGKQYKLQIGKQYKLQIOJQoKKQoOJQYKKQIOJQoKKQoOKQIOLQoKKQYOLQYKJQIOKQoKKQYKKQoKJQYOKQYKLQIOKQoKLQYOKQYKLQIOJQoGKQYKJQYGJQoGKQYKLQoGLQYGKQoGJQYKKQYGJQIKKQoGJQYKLQIKKQYGLQYKKQYGKQYGKQYKJQYOKQoKJQYOKQYKLQYOLQYOKQYKLQYOKQoKKQYKKQYOKQYOJQYKKQYKLQYKKQIKKQoKKQYKKQYKKQoKJQIKKQYKLQYKKQYKKQIKKQYKKQYKKQYKKQIKKQYKJQYGLQYGKQYKKQYKKQYGKQIKKQYGKQYOJ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hNDE4MjtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIgLz48cGF0aAogICAgICAgICAgICAgZD0ibSA3MTYuMjg5LDM3Ni41OSAzNy42NDA2LDAgMCwxODQuODE2IC0zNy42NDA2LDAgMCwtMTg0LjgxNiB6IgogICAgICAgICAgICAgaW5rc2NhcGU6Y29ubmVjdG9yLWN1cnZhdHVyZT0iMCIKICAgICAgICAgICAgIGlkPSJwYXRoNTYiCiAgICAgICAgICAgICBzdHlsZT0iZmlsbDojOGE0MTgyO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIiAvPjwvZz48L2c+PC9nPjwvZz48L3N2Zz4=') no-repeat, none; -moz-background-size: 100%; -o-background-size: 100%; -webkit-background-size: 100%; background-size: 100%; display: block; float: left; width: 90px; height: 25px; }
.jasmine_html-reporter .banner .version { margin-left: 14px; position: relative; top: 6px; }
.jasmine_html-reporter #jasmine_content { position: fixed; right: 100%; }
.jasmine_html-reporter .version { color: #aaa; }
.jasmine_html-reporter .banner { margin-top: 14px; }
.jasmine_html-reporter .duration { color: #fff; float: right; line-height: 28px; padding-right: 9px; }
.jasmine_html-reporter .symbol-summary { overflow: hidden; *zoom: 1; margin: 14px 0; }
.jasmine_html-reporter .symbol-summary li { display: inline-block; height: 8px; width: 14px; font-size: 16px; }
.jasmine_html-reporter .symbol-summary li.passed { font-size: 14px; }
.jasmine_html-reporter .symbol-summary li.passed:before { color: #007069; content: "\02022"; }
.jasmine_html-reporter .symbol-summary li.failed { line-height: 9px; }
.jasmine_html-reporter .symbol-summary li.failed:before { color: #ca3a11; content: "\d7"; font-weight: bold; margin-left: -1px; }
.jasmine_html-reporter .symbol-summary li.disabled { font-size: 14px; }
.jasmine_html-reporter .symbol-summary li.disabled:before { color: #bababa; content: "\02022"; }
.jasmine_html-reporter .symbol-summary li.pending { line-height: 17px; }
.jasmine_html-reporter .symbol-summary li.pending:before { color: #ba9d37; content: "*"; }
.jasmine_html-reporter .symbol-summary li.empty { font-size: 14px; }
.jasmine_html-reporter .symbol-summary li.empty:before { color: #ba9d37; content: "\02022"; }
.jasmine_html-reporter .run-options { float: right; margin-right: 5px; border: 1px solid #8a4182; color: #8a4182; position: relative; line-height: 20px; }
.jasmine_html-reporter .run-options .trigger { cursor: pointer; padding: 8px 16px; }
.jasmine_html-reporter .run-options .payload { position: absolute; display: none; right: -1px; border: 1px solid #8a4182; background-color: #eee; white-space: nowrap; padding: 4px 8px; }
.jasmine_html-reporter .run-options .payload.open { display: block; }
.jasmine_html-reporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
.jasmine_html-reporter .bar.failed { background-color: #ca3a11; }
.jasmine_html-reporter .bar.passed { background-color: #007069; }
.jasmine_html-reporter .bar.skipped { background-color: #bababa; }
.jasmine_html-reporter .bar.errored { background-color: #ca3a11; }
.jasmine_html-reporter .bar.menu { background-color: #fff; color: #aaa; }
.jasmine_html-reporter .bar.menu a { color: #333; }
.jasmine_html-reporter .bar a { color: white; }
.jasmine_html-reporter.spec-list .bar.menu.failure-list, .jasmine_html-reporter.spec-list .results .failures { display: none; }
.jasmine_html-reporter.failure-list .bar.menu.spec-list, .jasmine_html-reporter.failure-list .summary { display: none; }
.jasmine_html-reporter .results { margin-top: 14px; }
.jasmine_html-reporter .summary { margin-top: 14px; }
.jasmine_html-reporter .summary ul { list-style-type: none; margin-left: 14px; padding-top: 0; padding-left: 0; }
.jasmine_html-reporter .summary ul.suite { margin-top: 7px; margin-bottom: 7px; }
.jasmine_html-reporter .summary li.passed a { color: #007069; }
.jasmine_html-reporter .summary li.failed a { color: #ca3a11; }
.jasmine_html-reporter .summary li.empty a { color: #ba9d37; }
.jasmine_html-reporter .summary li.pending a { color: #ba9d37; }
.jasmine_html-reporter .summary li.disabled a { color: #bababa; }
.jasmine_html-reporter .description + .suite { margin-top: 0; }
.jasmine_html-reporter .suite { margin-top: 14px; }
.jasmine_html-reporter .suite a { color: #333; }
.jasmine_html-reporter .failures .spec-detail { margin-bottom: 28px; }
.jasmine_html-reporter .failures .spec-detail .description { background-color: #ca3a11; }
.jasmine_html-reporter .failures .spec-detail .description a { color: white; }
.jasmine_html-reporter .result-message { padding-top: 14px; color: #333; white-space: pre; }
.jasmine_html-reporter .result-message span.result { display: block; }
.jasmine_html-reporter .stack-trace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666; border: 1px solid #ddd; background: white; white-space: pre; }
此差异已折叠。
(function (context) {
/**
* @public
* @type {Object}
*/
var helper = context.utHelper = {};
/**
* @public
*/
helper.g = function (id) {
return document.getElementById(id);
};
/**
* @public
*/
helper.removeEl = function (el) {
var parent = helper.parentEl(el);
parent && parent.removeChild(el);
};
/**
* @public
*/
helper.parentEl = function (el) {
//parentElement for ie.
return el.parentElement || el.parentNode;
};
/**
* 得到head
*
* @public
*/
helper.getHeadEl = function (s) {
return document.head
|| document.getElementsByTagName('head')[0]
|| document.documentElement;
};
/**
* Load javascript script
*
* @param {string} resource Like 'xx/xx/xx.js';
*/
helper.loadScript = function (url, id, callback) {
var head = helper.getHeadEl();
var script = document.createElement('script');
script.setAttribute('type', 'text/javascript');
script.setAttribute('charset', 'utf-8');
if (id) {
script.setAttribute('id', id);
}
script.setAttribute('src', url);
// @see jquery
// Attach handlers for all browsers
script.onload = script.onreadystatechange = function () {
if (!script.readyState || /loaded|complete/.test(script.readyState)) {
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
// Dereference the script
script = undefined;
callback && callback();
}
};
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
// This arises when a base node is used (jquery #2709 and #4378).
head.insertBefore(script, head.firstChild);
};
/**
* Reset package loader, where esl is cleaned and reloaded.
*
* @public
*/
helper.resetPackageLoader = function (then) {
// Clean esl
var eslEl = helper.g('esl');
if (eslEl) {
helper.removeEl(eslEl);
}
var eslConfig = helper.g('esl');
if (eslConfig) {
helper.removeEl(eslConfig);
}
context.define = null;
context.require = null;
// Import esl.
helper.loadScript('esl.js', 'esl', function () {
helper.loadScript('config.js', 'config', function () {
then();
});
});
};
/**
* @public
* @param {Array.<string>} deps
* @param {Array.<Function>} testFnList
* @param {Function} done All done callback.
*/
helper.resetPackageLoaderEachTest = function (deps, testFnList, done) {
var i = -1;
next();
function next() {
i++;
if (testFnList.length <= i) {
done();
return;
}
helper.resetPackageLoader(function () {
window.require(deps, function () {
testFnList[i].apply(null, arguments);
next();
});
});
}
};
})(window);
\ No newline at end of file
describe('Component', function() {
var utHelper = window.utHelper;
beforeEach(function (done) {
utHelper.resetPackageLoader(done);
});
describe('topologicalTavel', function () {
function testCase(name, doTest) {
it(name, function (done) {
window.require(['echarts/model/Component'], function () {
doTest.apply(null, arguments);
done();
});
});
}
function xtestCase() {} // jshint ignore:line
testCase('topologicalTavel1', function (ComponentModel) {
ComponentModel.extend({type: 'm1', depends: ['a1', 'a2']});
var result = [];
ComponentModel.topologicalTavel(['m1'], function (componentType, depends) {
result.push([componentType, depends]);
});
expect(result).toEqual([['a2', []], ['a1', []], ['m1', ['a1', 'a2']]]);
});
testCase('topologicalTavel2', function (ComponentModel) {
ComponentModel.extend({type: 'm1', depends: ['a1', 'a2']});
var result = [];
ComponentModel.topologicalTavel([], function (componentType, depends) {
result.push([componentType, depends]);
});
expect(result).toEqual([]);
});
xtestCase('topologicalTavel3_loop', function (ComponentModel) {
ComponentModel.extend({type: 'm1', depends: ['a1', 'a2']});
ComponentModel.extend({type: 'm2', depends: ['m1', 'a2']});
ComponentModel.extend({type: 'a1', depends: ['m2', 'a2']});
var result = [];
ComponentModel.topologicalTavel(['m1', 'm2', 'a1'], function (componentType, depends) {
result.push([componentType, depends]);
});
expect(result).toEqual([]);
});
});
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册