Skip to content

Commit

Permalink
Merge branch 'dev-master' of github.com:yui/yui3 into dev-master
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed Apr 1, 2013
2 parents 4a6f464 + 1b26af0 commit 69b9d4a
Show file tree
Hide file tree
Showing 5 changed files with 187 additions and 4 deletions.
34 changes: 34 additions & 0 deletions src/tabview/tests/perf/tabview-benchmark.js
@@ -0,0 +1,34 @@
YUI.add('tabview-benchmark', function (Y) {
var suite = Y.BenchmarkSuite = new Benchmark.Suite();

suite.add('new Y.TabView()', function() {
var tabview = new Y.TabView({
children: [{
label: 'foo',
content: '<p>foo content</p>'
}, {
label: 'bar',
content: '<p>bar content</p>'
}, {
label: 'baz',
content: '<p>baz content</p>'
}]
});
});

suite.add('new Y.TabView().destroy', function() {
var tabview = new Y.TabView({
children: [{
label: 'foo',
content: '<p>foo content</p>'
}, {
label: 'bar',
content: '<p>bar content</p>'
}, {
label: 'baz',
content: '<p>baz content</p>'
}]
}).destroy(true);
});

}, '@VERSION@', {requires: ['tabview']});
62 changes: 62 additions & 0 deletions src/tabview/tests/perf/tabview.html
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Benchmarks</title>
</head>
<body class="yui3-skin-sam">

<p><button id="start">Start Benchmarks</button></p>

<div id="log"></div>
<applet code="nano" archive="https://github.com/bestiejs/benchmark.js/raw/v1.0.0/nano.jar" style="display: none;"></applet>
<script src="http://pieisgood.org/misc/benchmark/benchmark.js"></script>

<script src="../../../../build/yui/yui.js"></script>
<script>
var Y = YUI({
modules: {
'tabview-benchmark': {
fullpath: 'tabview-benchmark.js',
requires: ['tabview']
},

'test-console': {
fullpath : '../../../common/tests/assets/test-console.js',
requires : ['console-filters'],
skinnable: true
},

'skin-sam-test-console': {
fullpath: '../../../common/tests/assets/test-console.css',
type : 'css'
}
},

useBrowserConsole: false
}).use('tabview-benchmark', 'test-console', function (Y) {
var suite = Y.BenchmarkSuite,
start = Y.one('#start');

suite.on('start', function () {
start.set('disabled', true);
Y.log('Starting benchmarks.');
});

suite.on('cycle', function (bench) {
Y.log(String(bench));
});

suite.on('complete', function () {
start.set('disabled', false);
Y.log('Finished.');
});

start.on('click', function () {
suite.run(true);
});
});
</script>

</body>
</html>
19 changes: 19 additions & 0 deletions src/transition/tests/perf/transition-benchmark.js
@@ -0,0 +1,19 @@
YUI.add('transition-benchmark', function (Y) {
var suite = Y.BenchmarkSuite = new Benchmark.Suite(),
testNode = Y.one('#demo');

suite.add('new Y.Transition()', function() {
new Y.Transition(demo, {
width: 0,
height: {
value: 0,
delay: 1
},
easing: 'ease-in',
duration: 500,
iterations: 10
})
});


}, '@VERSION@', {requires: ['transition']});
71 changes: 71 additions & 0 deletions src/transition/tests/perf/transition.html
@@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Benchmarks</title>

<style>
#demo {
background: #ccc;
width: 100px;
height: 100px;
}
</style>
</head>
<body class="yui3-skin-sam">

<p><button id="start">Start Benchmarks</button></p>

<div id="log"></div>
<div id="demo"></div>
<applet code="nano" archive="https://github.com/bestiejs/benchmark.js/raw/v1.0.0/nano.jar" style="display: none;"></applet>
<script src="http://pieisgood.org/misc/benchmark/benchmark.js"></script>

<script src="../../../../build/yui/yui.js"></script>
<script>
var Y = YUI({
modules: {
'transition-benchmark': {
fullpath: 'transition-benchmark.js',
requires: ['transition']
},

'test-console': {
fullpath : '../../../common/tests/assets/test-console.js',
requires : ['console-filters'],
skinnable: true
},

'skin-sam-test-console': {
fullpath: '../../../common/tests/assets/test-console.css',
type : 'css'
}
},

useBrowserConsole: false
}).use('transition-benchmark', 'test-console', function (Y) {
var suite = Y.BenchmarkSuite,
start = Y.one('#start');

suite.on('start', function () {
start.set('disabled', true);
Y.log('Starting benchmarks.');
});

suite.on('cycle', function (bench) {
Y.log(String(bench));
});

suite.on('complete', function () {
start.set('disabled', false);
Y.log('Finished.');
});

start.on('click', function () {
suite.run(true);
});
});
</script>

</body>
</html>
5 changes: 1 addition & 4 deletions src/transition/tests/unit/transition.html
Expand Up @@ -774,14 +774,11 @@ <h1>Transition Tests</h1>
node.transition({
easing: 'ease',
duration: 0.1,
height: 0,
transform: 'rotate(180deg)'
}, function(e) {
test.resume(function() {
if (!(Y.UA.ie < 10)) {
Y.Assert.areEqual(1, parseInt(e.elapsedTime * 10));
node.setStyle('height', '100px');
Y.Assert.areEqual('matrix(-1, -8.74228e-008, 8.74228e-008, -1, 0, 0)', node.getComputedStyle(Y.Transition._TRANSFORM));
Y.Assert.isNotUndefined(node.getComputedStyle(Y.Transition._TRANSFORM));
}
});
});
Expand Down

0 comments on commit 69b9d4a

Please sign in to comment.