Index: LayoutTests/inspector/profiler/canvas2d/canvas2d-api-changes.html |
diff --git a/LayoutTests/inspector/profiler/canvas2d/canvas2d-api-changes.html b/LayoutTests/inspector/profiler/canvas2d/canvas2d-api-changes.html |
deleted file mode 100644 |
index ee25d080514dd94c1a5fd036aef10e7d334008ae..0000000000000000000000000000000000000000 |
--- a/LayoutTests/inspector/profiler/canvas2d/canvas2d-api-changes.html |
+++ /dev/null |
@@ -1,187 +0,0 @@ |
-<html> |
-<head> |
-<script src="../../../http/tests/inspector/inspector-test.js"></script> |
-<script> |
- |
-var CanvasRenderingContext2DResource = {}; |
- |
-/** |
- * @const |
- * @type {Array.<string>} |
- */ |
-CanvasRenderingContext2DResource.AttributeProperties = [ |
- "strokeStyle", |
- "fillStyle", |
- "globalAlpha", |
- "lineWidth", |
- "lineCap", |
- "lineJoin", |
- "miterLimit", |
- "shadowOffsetX", |
- "shadowOffsetY", |
- "shadowBlur", |
- "shadowColor", |
- "globalCompositeOperation", |
- "font", |
- "textAlign", |
- "textBaseline", |
- "lineDashOffset", |
- "imageSmoothingEnabled", |
- // FIXME: Temporary properties implemented in JSC, but not in V8. |
- "webkitLineDash", |
- "webkitLineDashOffset" |
-]; |
- |
-/** |
- * @const |
- * @type {Array.<string>} |
- */ |
-CanvasRenderingContext2DResource.PathMethods = [ |
- "beginPath", |
- "moveTo", |
- "closePath", |
- "lineTo", |
- "quadraticCurveTo", |
- "bezierCurveTo", |
- "arcTo", |
- "arc", |
- "rect", |
- "ellipse" |
-]; |
- |
-/** |
- * @const |
- * @type {Array.<string>} |
- */ |
-CanvasRenderingContext2DResource.TransformationMatrixMethods = [ |
- "scale", |
- "rotate", |
- "translate", |
- "transform", |
- "setTransform", |
- "resetTransform" |
-]; |
- |
-/** |
- * @const |
- * @type {Array.<string>} |
- */ |
-CanvasRenderingContext2DResource.IgnoreProperties = [ |
- "canvas", |
- "createLinearGradient", |
- "createRadialGradient", |
- "createPattern", |
- "save", |
- "restore", |
- "clip", |
- "getLineDash", |
- "setLineDash", |
- // Ignore the properties below. |
- "clearRect", |
- "clearShadow", |
- "createImageData", |
- "drawFocusIfNeeded", |
- "drawImage", |
- "drawImageFromRect", |
- "fill", |
- "fillRect", |
- "fillText", |
- "getContextAttributes", |
- "getImageData", |
- "isPointInPath", |
- "isPointInStroke", |
- "measureText", |
- "putImageData", |
- "setAlpha", |
- "setCompositeOperation", |
- "setFillColor", |
- "setLineCap", |
- "setLineJoin", |
- "setLineWidth", |
- "setMiterLimit", |
- "setShadow", |
- "setStrokeColor", |
- "stroke", |
- "strokeRect", |
- "strokeText", |
-]; |
- |
-function collectPropertyNames(obj) |
-{ |
- var propertyNames = []; |
- for (var property in obj) |
- propertyNames.push(property); |
- propertyNames.sort(); |
- return propertyNames; |
-} |
- |
-function test() |
-{ |
- var canvas = document.createElement("canvas"); |
- var ctx = canvas.getContext("2d"); |
- if (!ctx) { |
- output("ERROR: Could not create canvas 2D context."); |
- return; |
- } |
- output("New properties and functions that should be manually examined (should be empty to pass the test):"); |
- var propertyNames = collectPropertyNames(ctx); |
- var trackedProperties = CanvasRenderingContext2DResource.AttributeProperties.concat(CanvasRenderingContext2DResource.PathMethods, CanvasRenderingContext2DResource.TransformationMatrixMethods, CanvasRenderingContext2DResource.IgnoreProperties); |
- for (var i = 0; i < propertyNames.length; ++i) { |
- var property = propertyNames[i]; |
- if (trackedProperties.indexOf(property) !== -1) |
- continue; |
- output(property); |
- } |
- |
- var gradient = ctx.createLinearGradient(0, 0, 1, 1); |
- if (!gradient) { |
- output("ERROR: Could not create a gradient object."); |
- return; |
- } |
- output("New properties and functions of CanvasGradient object that should be manually examined (should be empty to pass the test):"); |
- propertyNames = collectPropertyNames(gradient); |
- for (var i = 0; i < propertyNames.length; ++i) { |
- var property = propertyNames[i]; |
- if (property === "addColorStop") |
- continue; |
- output(property); |
- } |
- |
- var pattern = ctx.createPattern(canvas, "repeat"); |
- if (!pattern) { |
- output("ERROR: Could not create a pattern object."); |
- return; |
- } |
- output("New properties and functions of CanvasPattern object that should be manually examined (should be empty to pass the test):"); |
- for (var property in pattern) { |
- if (property == "setTransform") |
- continue; |
- output(property); |
- } |
-} |
- |
-function runTest() |
-{ |
- if (window.testRunner) { |
- testRunner.dumpAsText(); |
- testRunner.waitUntilDone(); |
- } |
- try { |
- test(); |
- } finally { |
- if (window.testRunner) |
- testRunner.notifyDone(); |
- } |
-} |
- |
-</script> |
-</head> |
-<body onload="runTest()"> |
-<p> |
-Test to catch Canvas 2D API changes. |
-If this test should ever fail, we should re-examine the Canvas 2D state saving/restoring logic in the |
-InjectedScriptModule to include any latest changes to the API. |
- |
-</p> |
-</body> |
-</html> |