+ * Updates path attributes to match fill/stroke operations.
+ *
+ * This sets fillStyle to undefined for stroked paths,
+ * and strokeStyle to undefined for filled paths, to simplify
+ * matchers such as numLinesDrawn.
+ *
+ * @private
+ * @param {Array.<Object>} List of operations.
+ */
+CanvasAssertions.cleanPathAttrs_ = function(calls) {
+ var isStroked = true;
+ for (var i = calls.length - 1; i >= 0; --i) {
+ var call = calls[i];
+ var name = call.name;
+ if (name == 'stroke') {
+ isStroked = true;
+ } else if (name == 'fill') {
+ isStroked = false;
+ } else if (name == 'lineTo') {
+ if (isStroked) {
+ call.properties.fillStyle = undefined;
+ } else {
+ call.properties.strokeStyle = undefined;
+ }
+ }
+ }
+};
+
+
+/**