From 32ddef6e835e69c59fdbfdce8a68a38981995e44 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sat, 26 Oct 2013 18:49:20 -0500 Subject: [PATCH] range selector tests pass --- auto_tests/tests/CanvasAssertions.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/auto_tests/tests/CanvasAssertions.js b/auto_tests/tests/CanvasAssertions.js index 9550912..97279cf 100644 --- a/auto_tests/tests/CanvasAssertions.js +++ b/auto_tests/tests/CanvasAssertions.js @@ -183,15 +183,20 @@ CanvasAssertions.assertBalancedSaveRestore = function(proxy) { CanvasAssertions.numLinesDrawn = function(proxy, color) { CanvasAssertions.cleanPathAttrs_(proxy.calls__); var num_lines = 0; + var num_potential_calls = 0; for (var i = 0; i < proxy.calls__.length; i++) { var call = proxy.calls__[i]; - - // note: Don't simplify these two conditionals into one. The - // separation simplifies debugging tricky tests. - if (call.name == "lineTo") { + if (call.name == "beginPath") { + num_potential_calls = 0; + } else if (call.name == "lineTo") { + num_potential_calls++; + } else if (call.name == "stroke") { + // note: Don't simplify these two conditionals into one. The + // separation simplifies debugging tricky tests. if (call.properties.strokeStyle == color) { - num_lines++; + num_lines += num_potential_calls; } + num_potential_calls = 0; } } return num_lines; -- 2.7.4