1 // Copyright 2011 Google Inc. All Rights Reserved.
4 * @fileoverview Regression test based on an optimization w/
5 * unforeseen consequences.
6 * @author danvk@google.com (Dan Vanderkam)
9 var SelectionTestCase
= TestCase("selection");
11 SelectionTestCase
.prototype.setUp
= function() {
12 document
.body
.innerHTML
= "<div id='graph'></div>";
15 SelectionTestCase
.prototype.testSetGetSelection
= function() {
16 var graph
= document
.getElementById("graph");
17 var g
= new Dygraph(graph
,
25 assertEquals(0, g
.getSelection());
27 assertEquals(1, g
.getSelection());
29 assertEquals(2, g
.getSelection());
32 SelectionTestCase
.prototype.testSetGetSelectionDense
= function() {
33 var graph
= document
.getElementById("graph");
34 var g
= new Dygraph(graph
,
43 assertEquals(0, g
.getSelection());
45 assertEquals(1, g
.getSelection());
47 assertEquals(2, g
.getSelection());
49 assertEquals(3, g
.getSelection());