2 * @fileoverview Test cases for resizing.
4 * @author konigsberg@google.com (Robert Konigsberg)
6 var ResizeTestCase
= TestCase("resize");
8 ResizeTestCase
.prototype.setUp
= function() {
9 document
.body
.innerHTML
= "<div id='graph'></div>";
12 ResizeTestCase
.prototype.tearDown
= function() {
15 ResizeTestCase
.prototype.testResizeMaintainsMouseOperations
= function() {
16 document
.body
.innerHTML
=
17 '<div id="graph" style="width: 640px; height: 480px;"></div>' +
19 var graph
= document
.getElementById("graph");
21 var callbackCount
= 0;
22 var callback
= function() {
26 // Strum the mouse along the y-coordinate y, from 0 to x2. These are DOM values.
27 var strum
= function(g
, y
, x2
) {
28 DygraphOps
.dispatchMouseDown_Point(g
, 0, y
);
29 for (var x
= 0; x
< x2
; x
++) {
30 DygraphOps
.dispatchMouseMove_Point(g
, x
, y
);
32 DygraphOps
.dispatchMouseUp_Point(g
, x2
- 1, y
);
35 g
= new Dygraph(graph
,
43 { highlightCallback
: callback
});
46 assertEquals(6, callbackCount
);
48 document
.getElementById("graph").style
.width
= "500px";
53 assertEquals(6, callbackCount
);