projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d037a49
)
Update the hidpi test to work on a wider variety of platforms (e.g. when running...
author
Paul Holden
<paul.holden@gmail.com>
Mon, 25 Aug 2014 01:58:19 +0000
(21:58 -0400)
committer
Paul Holden
<paul.holden@gmail.com>
Mon, 25 Aug 2014 01:58:19 +0000
(21:58 -0400)
auto_tests/tests/hidpi.js
patch
|
blob
|
blame
|
history
diff --git
a/auto_tests/tests/hidpi.js
b/auto_tests/tests/hidpi.js
index
17a75a0
..
c595065
100644
(file)
--- a/
auto_tests/tests/hidpi.js
+++ b/
auto_tests/tests/hidpi.js
@@
-17,7
+17,10
@@
hidpiTestCase.prototype.tearDown = function() {
window.devicePixelRatio = savePixelRatio;
};
window.devicePixelRatio = savePixelRatio;
};
-hidpiTestCase.prototype.testNameGoesHere = function() {
+hidpiTestCase.prototype.testDoesntCreateScrollbars = function() {
+ var sw = document.body.scrollWidth;
+ var cw = document.body.clientWidth;
+
var graph = document.getElementById("graph");
graph.style.width = "70%"; // more than half.
graph.style.height = "200px";
var graph = document.getElementById("graph");
graph.style.width = "70%"; // more than half.
graph.style.height = "200px";
@@
-32,8
+35,10
@@
hidpiTestCase.prototype.testNameGoesHere = function() {
var g = new Dygraph(graph, data, opts);
var g = new Dygraph(graph, data, opts);
+ // Adding the graph shouldn't cause the width of the page to change.
+ // (essentially, we're checking that we don't end up with a scrollbar)
// See http://stackoverflow.com/a/2146905/388951
// See http://stackoverflow.com/a/2146905/388951
-
var hasHorizontalScrollbar = (document.body.scrollWidth >
document.body.clientWidth);
- assertEquals(
false, hasHorizontalScrollbar
);
+
assertEquals(cw,
document.body.clientWidth);
+ assertEquals(
sw, document.body.scrollWidth
);
};
};