projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Basic tests for GViz support
[dygraphs.git]
/
auto_tests
/
tests
/
fast_canvas_proxy.js
diff --git
a/auto_tests/tests/fast_canvas_proxy.js
b/auto_tests/tests/fast_canvas_proxy.js
index
1e4bfaf
..
a06fe40
100644
(file)
--- a/
auto_tests/tests/fast_canvas_proxy.js
+++ b/
auto_tests/tests/fast_canvas_proxy.js
@@
-3,13
+3,13
@@
*
* @author danvdk@gmail.com (Dan Vanderkam)
*/
*
* @author danvdk@gmail.com (Dan Vanderkam)
*/
-var fastCanvasProxyTestCase = TestCase("fast-canvas-proxy");
+describe("fast-canvas-proxy", function() {
-
fastCanvasProxyTestCase.prototype.setUp =
function() {
-};
+
beforeEach(
function() {
+}
)
;
-
fastCanvasProxyTestCase.prototype.tearDown =
function() {
-};
+
afterEach(
function() {
+}
)
;
var fakeCanvasContext = {
moveTo: function() {},
var fakeCanvasContext = {
moveTo: function() {},
@@
-32,7
+32,7
@@
function extractMoveToAndLineToCalls(proxy) {
return out;
}
return out;
}
-
fastCanvasProxyTestCase.prototype.testExtraMoveTosElided =
function() {
+
it('testExtraMoveTosElided',
function() {
var htx = new Proxy(fakeCanvasContext);
var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx);
var htx = new Proxy(fakeCanvasContext);
var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx);
@@
-43,12
+43,12
@@
fastCanvasProxyTestCase.prototype.testExtraMoveTosElided = function() {
fastProxy.moveTo(3, 1);
fastProxy.stroke();
fastProxy.moveTo(3, 1);
fastProxy.stroke();
- assert
Equals
([['moveTo', 1, 1],
+ assert
.deepEqual
([['moveTo', 1, 1],
['lineTo', 2, 1],
['lineTo', 3, 1]], extractMoveToAndLineToCalls(htx));
['lineTo', 2, 1],
['lineTo', 3, 1]], extractMoveToAndLineToCalls(htx));
-};
+}
)
;
-
fastCanvasProxyTestCase.prototype.testConsecutiveMoveTosElided =
function() {
+
it('testConsecutiveMoveTosElided',
function() {
var htx = new Proxy(fakeCanvasContext);
var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx);
var htx = new Proxy(fakeCanvasContext);
var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx);
@@
-59,12
+59,12
@@
fastCanvasProxyTestCase.prototype.testConsecutiveMoveTosElided = function() {
fastProxy.moveTo(3.2, 3);
fastProxy.stroke();
fastProxy.moveTo(3.2, 3);
fastProxy.stroke();
- assert
Equals
([['moveTo', 1, 1],
+ assert
.deepEqual
([['moveTo', 1, 1],
['lineTo', 2, 1],
['moveTo', 3.2, 3]], extractMoveToAndLineToCalls(htx));
['lineTo', 2, 1],
['moveTo', 3.2, 3]], extractMoveToAndLineToCalls(htx));
-};
+}
)
;
-
fastCanvasProxyTestCase.prototype.testSuperfluousSegmentsElided =
function() {
+
it('testSuperfluousSegmentsElided',
function() {
var htx = new Proxy(fakeCanvasContext);
var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx);
var htx = new Proxy(fakeCanvasContext);
var fastProxy = DygraphCanvasRenderer._fastCanvasProxy(htx);
@@
-90,10
+90,12
@@
fastCanvasProxyTestCase.prototype.testSuperfluousSegmentsElided = function() {
fastProxy.moveTo(3, 0); // dodge the "don't touch the last pixel" rule.
fastProxy.stroke();
fastProxy.moveTo(3, 0); // dodge the "don't touch the last pixel" rule.
fastProxy.stroke();
- assert
Equals
([['moveTo', 0.6, 1],
+ assert
.deepEqual
([['moveTo', 0.6, 1],
['lineTo', 1.0, 5],
['lineTo', 1.2, 0],
['lineTo', 1.7, 30],
['lineTo', 1.8, -30],
['moveTo', 3, 0]], extractMoveToAndLineToCalls(htx));
['lineTo', 1.0, 5],
['lineTo', 1.2, 0],
['lineTo', 1.7, 30],
['lineTo', 1.8, -30],
['moveTo', 3, 0]], extractMoveToAndLineToCalls(htx));
-};
+});
+
+});