diff options
author | mkwst@chromium.org <mkwst@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2013-09-18 14:54:39 +0000 |
---|---|---|
committer | mkwst@chromium.org <mkwst@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2013-09-18 14:54:39 +0000 |
commit | f8d4928aba6f0cd3b7fa71b456b8a264da956f53 (patch) | |
tree | a5e02d86c4414517203e0f8246337ac9da93b7cf /third_party/WebKit/LayoutTests/fast/canvas | |
parent | e28ddd8168cad55a404970e52b651c45652692fb (diff) | |
download | chromium_src-f8d4928aba6f0cd3b7fa71b456b8a264da956f53.zip chromium_src-f8d4928aba6f0cd3b7fa71b456b8a264da956f53.tar.gz chromium_src-f8d4928aba6f0cd3b7fa71b456b8a264da956f53.tar.bz2 |
Improve generated "Not enough arguments." TypeError exceptions.
BUG=270033
Review URL: https://chromiumcodereview.appspot.com/24203002
git-svn-id: svn://svn.chromium.org/blink/trunk@157966 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/canvas')
20 files changed, 75 insertions, 53 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-lineDash-invalid-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-lineDash-invalid-expected.txt index b2203e6..1c4ff67 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-lineDash-invalid-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-lineDash-invalid-expected.txt @@ -8,7 +8,7 @@ PASS trySettingLineDash([1, Infinity]) is initialLineDash PASS trySettingLineDash([1, -Infinity]) is initialLineDash PASS trySettingLineDash([1, NaN]) is initialLineDash PASS trySettingLineDash([1, 'string']) is initialLineDash -PASS trySettingLineDashWithNoArgs() threw exception TypeError: Not enough arguments. +PASS trySettingLineDashWithNoArgs() threw exception TypeError: Failed to execute 'setLineDash' on 'CanvasRenderingContext2D': 1 argument required, but only 0 present.. PASS trySettingLineDashOffset(Infinity) is initialLineDashOffset PASS trySettingLineDashOffset(-Infinity) is initialLineDashOffset PASS trySettingLineDashOffset(NaN) is initialLineDashOffset diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-drawImage-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-drawImage-expected.txt index 071180a..65fd6fc 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-drawImage-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-drawImage-expected.txt @@ -3,9 +3,9 @@ Test the behavior of CanvasRenderingContext2D.drawImage() when called with diffe On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS ctx.drawImage() threw exception TypeError: Not enough arguments. -PASS ctx.drawImage(imageElement) threw exception TypeError: Not enough arguments. -PASS ctx.drawImage(imageElement, 0) threw exception TypeError: Not enough arguments. +PASS ctx.drawImage() threw exception TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': 3 arguments required, but only 0 present.. +PASS ctx.drawImage(imageElement) threw exception TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': 3 arguments required, but only 1 present.. +PASS ctx.drawImage(imageElement, 0) threw exception TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': 3 arguments required, but only 2 present.. PASS ctx.drawImage(imageElement, 0, 0) is undefined PASS ctx.drawImage(imageElement, 0, 0, 0) threw exception TypeError: Type error. PASS ctx.drawImage(imageElement, 0, 0, 0, 0) is undefined @@ -15,8 +15,8 @@ PASS ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0) threw exception TypeError: PASS ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0) is undefined PASS ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0, 0) threw exception TypeError: Type error. PASS ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) threw exception TypeError: Type error. -PASS ctx.drawImage(canvasElement) threw exception TypeError: Not enough arguments. -PASS ctx.drawImage(canvasElement, 0) threw exception TypeError: Not enough arguments. +PASS ctx.drawImage(canvasElement) threw exception TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': 3 arguments required, but only 1 present.. +PASS ctx.drawImage(canvasElement, 0) threw exception TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': 3 arguments required, but only 2 present.. PASS ctx.drawImage(canvasElement, 0, 0) is undefined PASS ctx.drawImage(canvasElement, 0, 0, 0) threw exception TypeError: Type error. PASS ctx.drawImage(canvasElement, 0, 0, 0, 0) is undefined diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-drawImageFromRect-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-drawImageFromRect-expected.txt index 2f7da17..fa0137c 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-drawImageFromRect-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-drawImageFromRect-expected.txt @@ -3,7 +3,7 @@ Test the behavior of CanvasRenderingContext2D.drawImageFromRect() when called wi On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS ctx.drawImageFromRect() threw exception TypeError: Not enough arguments. +PASS ctx.drawImageFromRect() threw exception TypeError: Failed to execute 'drawImageFromRect' on 'CanvasRenderingContext2D': 1 argument required, but only 0 present.. PASS ctx.drawImageFromRect(imageElement) is undefined PASS ctx.drawImageFromRect(imageElement, 0) is undefined PASS ctx.drawImageFromRect(imageElement, 0, 0) is undefined diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-fillText-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-fillText-expected.txt index ccc5fa5..9cc7219 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-fillText-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-fillText-expected.txt @@ -3,9 +3,9 @@ Test the behavior of CanvasRenderingContext2D.fillText() when called with differ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS ctx.fillText() threw exception TypeError: Not enough arguments. -PASS ctx.fillText('moo') threw exception TypeError: Not enough arguments. -PASS ctx.fillText('moo',0) threw exception TypeError: Not enough arguments. +PASS ctx.fillText() threw exception TypeError: Failed to execute 'fillText' on 'CanvasRenderingContext2D': 3 arguments required, but only 0 present.. +PASS ctx.fillText('moo') threw exception TypeError: Failed to execute 'fillText' on 'CanvasRenderingContext2D': 3 arguments required, but only 1 present.. +PASS ctx.fillText('moo',0) threw exception TypeError: Failed to execute 'fillText' on 'CanvasRenderingContext2D': 3 arguments required, but only 2 present.. PASS ctx.fillText('moo',0,0) is undefined PASS ctx.fillText('moo',0,0,0) is undefined PASS ctx.fillText('moo',0,0,0,0) is undefined diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-setFillColor-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-setFillColor-expected.txt index 4bd69d6..87e8742 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-setFillColor-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-setFillColor-expected.txt @@ -3,7 +3,7 @@ Test the behavior of CanvasRenderingContext2D.setFillColor() when called with di On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS ctx.setFillColor() threw exception TypeError: Not enough arguments. +PASS ctx.setFillColor() threw exception TypeError: Failed to execute 'setFillColor' on 'CanvasRenderingContext2D': 1 argument required, but only 0 present.. PASS ctx.setFillColor('red') is undefined PASS ctx.setFillColor(0) is undefined PASS ctx.setFillColor(0, 0) is undefined diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-setShadow-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-setShadow-expected.txt index 0eabe6f..2f1ee31 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-setShadow-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-setShadow-expected.txt @@ -3,9 +3,9 @@ Test the behavior of CanvasRenderingContext2D.setShadow() when called with diffe On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS ctx.setShadow() threw exception TypeError: Not enough arguments. -PASS ctx.setShadow(0) threw exception TypeError: Not enough arguments. -PASS ctx.setShadow(0, 0) threw exception TypeError: Not enough arguments. +PASS ctx.setShadow() threw exception TypeError: Failed to execute 'setShadow' on 'CanvasRenderingContext2D': 3 arguments required, but only 0 present.. +PASS ctx.setShadow(0) threw exception TypeError: Failed to execute 'setShadow' on 'CanvasRenderingContext2D': 3 arguments required, but only 1 present.. +PASS ctx.setShadow(0, 0) threw exception TypeError: Failed to execute 'setShadow' on 'CanvasRenderingContext2D': 3 arguments required, but only 2 present.. PASS ctx.setShadow(0, 0, 0) is undefined PASS ctx.setShadow(0, 0, 0, 0) is undefined PASS ctx.setShadow(0, 0, 0, 0, 0) is undefined diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-setStrokeColor-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-setStrokeColor-expected.txt index d02517b..0c48451 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-setStrokeColor-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-setStrokeColor-expected.txt @@ -3,7 +3,7 @@ Test the behavior of CanvasRenderingContext2D.setStrokeColor() when called with On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS ctx.setStrokeColor() threw exception TypeError: Not enough arguments. +PASS ctx.setStrokeColor() threw exception TypeError: Failed to execute 'setStrokeColor' on 'CanvasRenderingContext2D': 1 argument required, but only 0 present.. PASS ctx.setStrokeColor('red') is undefined PASS ctx.setStrokeColor(0) is undefined PASS ctx.setStrokeColor(0, 0) is undefined diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-strokeText-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-strokeText-expected.txt index d217251..a7ecdfa 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-strokeText-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-overloads-strokeText-expected.txt @@ -3,9 +3,9 @@ Test the behavior of CanvasRenderingContext2D.strokeText() when called with diff On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS ctx.strokeText() threw exception TypeError: Not enough arguments. -PASS ctx.strokeText('moo') threw exception TypeError: Not enough arguments. -PASS ctx.strokeText('moo',0) threw exception TypeError: Not enough arguments. +PASS ctx.strokeText() threw exception TypeError: Failed to execute 'strokeText' on 'CanvasRenderingContext2D': 3 arguments required, but only 0 present.. +PASS ctx.strokeText('moo') threw exception TypeError: Failed to execute 'strokeText' on 'CanvasRenderingContext2D': 3 arguments required, but only 1 present.. +PASS ctx.strokeText('moo',0) threw exception TypeError: Failed to execute 'strokeText' on 'CanvasRenderingContext2D': 3 arguments required, but only 2 present.. PASS ctx.strokeText('moo',0,0) is undefined PASS ctx.strokeText('moo',0,0,0) is undefined PASS ctx.strokeText('moo',0,0,0,0) is undefined diff --git a/third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-valid-image-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-valid-image-expected.txt index b5ad5aa..833abb1 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-valid-image-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-valid-image-expected.txt @@ -3,9 +3,9 @@ This test checks behavior of valid arguments to Canvas::drawImage that use a val On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS ctx.drawImage() threw exception TypeError: Not enough arguments. -PASS ctx.drawImage(myImage) threw exception TypeError: Not enough arguments. -PASS ctx.drawImage(myImage, 0) threw exception TypeError: Not enough arguments. +PASS ctx.drawImage() threw exception TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': 3 arguments required, but only 0 present.. +PASS ctx.drawImage(myImage) threw exception TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': 3 arguments required, but only 1 present.. +PASS ctx.drawImage(myImage, 0) threw exception TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': 3 arguments required, but only 2 present.. PASS ctx.drawImage(myImage, 0, 0) did not throw exception. PASS ctx.drawImage(myImage, 0, 0, 20, 20) did not throw exception. PASS ctx.drawImage(myImage, 0, 0, 20, 20, 0, 0, 20, 20) did not throw exception. diff --git a/third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-valid-image.html b/third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-valid-image.html index 5e870be..541f4c2 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-valid-image.html +++ b/third_party/WebKit/LayoutTests/fast/canvas/drawImage-with-valid-image.html @@ -7,7 +7,9 @@ window.jsTestIsAsync = true; description("This test checks behavior of valid arguments to Canvas::drawImage that use a valid source image."); - var TypeError = "TypeError: Not enough arguments"; + function ExpectedNotEnoughArgumentsMessage(num) { + return "\"TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': 3 arguments required, but only " + num + " present.\""; + } var IndexSizeError = "IndexSizeError: Index or size was negative, or greater than the allowed value."; // Create image @@ -20,13 +22,13 @@ var ctx = document.createElement("canvas").getContext('2d'); function draw() { // No arguments should get exception - shouldThrow("ctx.drawImage()", "TypeError"); + shouldThrow("ctx.drawImage()", ExpectedNotEnoughArgumentsMessage(0)); // image argument only should get exception - shouldThrow("ctx.drawImage(myImage)", "TypeError"); + shouldThrow("ctx.drawImage(myImage)", ExpectedNotEnoughArgumentsMessage(1)); // image argument plus one number should get exception - shouldThrow("ctx.drawImage(myImage, 0)", "TypeError"); + shouldThrow("ctx.drawImage(myImage, 0)", ExpectedNotEnoughArgumentsMessage(2)); // image argument plus 2 numbers shouldNotThrow("ctx.drawImage(myImage, 0, 0)"); @@ -151,4 +153,4 @@ </script> <script src="../js/resources/js-test-post.js"></script> </body> -</html>
\ No newline at end of file +</html> diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-lineDash-invalid.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-lineDash-invalid.js index cef6395..35f73df 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-lineDash-invalid.js +++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-lineDash-invalid.js @@ -36,7 +36,7 @@ shouldBe("trySettingLineDash([1, Infinity])", "initialLineDash"); shouldBe("trySettingLineDash([1, -Infinity])", "initialLineDash"); shouldBe("trySettingLineDash([1, NaN])", "initialLineDash"); shouldBe("trySettingLineDash([1, 'string'])", "initialLineDash"); -shouldThrow("trySettingLineDashWithNoArgs()", "'TypeError: Not enough arguments'"); +shouldThrow("trySettingLineDashWithNoArgs()", '"TypeError: Failed to execute \'setLineDash\' on \'CanvasRenderingContext2D\': 1 argument required, but only 0 present."'); shouldBe("trySettingLineDashOffset(Infinity)", "initialLineDashOffset"); shouldBe("trySettingLineDashOffset(-Infinity)", "initialLineDashOffset"); diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-drawImage.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-drawImage.js index e57acae..3d9580d 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-drawImage.js +++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-drawImage.js @@ -2,13 +2,16 @@ description("Test the behavior of CanvasRenderingContext2D.drawImage() when call var ctx = document.createElement('canvas').getContext('2d'); +function ExpectedNotEnoughArgumentsMessage(num) { + return "\"TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': 3 arguments required, but only " + num + " present.\""; +} + var TypeError = "TypeError: Type error"; -var TypeErrorNotEnoughArguments = "TypeError: Not enough arguments"; var imageElement = document.createElement("img"); -shouldThrow("ctx.drawImage()", "TypeErrorNotEnoughArguments"); -shouldThrow("ctx.drawImage(imageElement)", "TypeErrorNotEnoughArguments"); -shouldThrow("ctx.drawImage(imageElement, 0)", "TypeErrorNotEnoughArguments"); +shouldThrow("ctx.drawImage()", ExpectedNotEnoughArgumentsMessage(0)); +shouldThrow("ctx.drawImage(imageElement)", ExpectedNotEnoughArgumentsMessage(1)); +shouldThrow("ctx.drawImage(imageElement, 0)", ExpectedNotEnoughArgumentsMessage(2)); shouldBe("ctx.drawImage(imageElement, 0, 0)", "undefined"); shouldThrow("ctx.drawImage(imageElement, 0, 0, 0)", "TypeError"); shouldBe("ctx.drawImage(imageElement, 0, 0, 0, 0)", "undefined"); @@ -20,8 +23,8 @@ shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0, 0)", "TypeError shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", "TypeError"); var canvasElement = document.createElement("canvas"); -shouldThrow("ctx.drawImage(canvasElement)", "TypeErrorNotEnoughArguments"); -shouldThrow("ctx.drawImage(canvasElement, 0)", "TypeErrorNotEnoughArguments"); +shouldThrow("ctx.drawImage(canvasElement)", ExpectedNotEnoughArgumentsMessage(1)); +shouldThrow("ctx.drawImage(canvasElement, 0)", ExpectedNotEnoughArgumentsMessage(2)); shouldBe("ctx.drawImage(canvasElement, 0, 0)", "undefined"); shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0)", "TypeError"); shouldBe("ctx.drawImage(canvasElement, 0, 0, 0, 0)", "undefined"); diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-drawImageFromRect.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-drawImageFromRect.js index 6a5c0a8..0f40f31 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-drawImageFromRect.js +++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-drawImageFromRect.js @@ -2,10 +2,12 @@ description("Test the behavior of CanvasRenderingContext2D.drawImageFromRect() w var ctx = document.createElement('canvas').getContext('2d'); -var NotEnoughArguments = "TypeError: Not enough arguments"; +function ExpectedNotEnoughArgumentsMessage(num) { + return "\"TypeError: Failed to execute 'drawImageFromRect' on 'CanvasRenderingContext2D': 1 argument required, but only " + num + " present.\""; +} var imageElement = document.createElement("img"); -shouldThrow("ctx.drawImageFromRect()", "NotEnoughArguments"); +shouldThrow("ctx.drawImageFromRect()", ExpectedNotEnoughArgumentsMessage(0)); shouldBe("ctx.drawImageFromRect(imageElement)", "undefined"); shouldBe("ctx.drawImageFromRect(imageElement, 0)", "undefined"); shouldBe("ctx.drawImageFromRect(imageElement, 0, 0)", "undefined"); diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-fillText.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-fillText.js index 1344e63..c6b7865 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-fillText.js +++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-fillText.js @@ -2,12 +2,15 @@ description("Test the behavior of CanvasRenderingContext2D.fillText() when calle var ctx = document.createElement('canvas').getContext('2d'); -var NotEnoughArguments = "TypeError: Not enough arguments"; +function ExpectedNotEnoughArgumentsMessage(num) { + return "\"TypeError: Failed to execute 'fillText' on 'CanvasRenderingContext2D': 3 arguments required, but only " + num + " present.\""; +} + var TypeError = "TypeError: Type error"; -shouldThrow("ctx.fillText()", "NotEnoughArguments"); -shouldThrow("ctx.fillText('moo')", "NotEnoughArguments"); -shouldThrow("ctx.fillText('moo',0)", "NotEnoughArguments"); +shouldThrow("ctx.fillText()", ExpectedNotEnoughArgumentsMessage(0)); +shouldThrow("ctx.fillText('moo')", ExpectedNotEnoughArgumentsMessage(1)); +shouldThrow("ctx.fillText('moo',0)", ExpectedNotEnoughArgumentsMessage(2)); shouldBe("ctx.fillText('moo',0,0)", "undefined"); shouldBe("ctx.fillText('moo',0,0,0)", "undefined"); shouldBe("ctx.fillText('moo',0,0,0,0)", "undefined"); diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-setFillColor.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-setFillColor.js index dfa6d0a..b2e5dfd 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-setFillColor.js +++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-setFillColor.js @@ -2,10 +2,13 @@ description("Test the behavior of CanvasRenderingContext2D.setFillColor() when c var ctx = document.createElement('canvas').getContext('2d'); +function ExpectedNotEnoughArgumentsMessage(num) { + return "\"TypeError: Failed to execute 'setFillColor' on 'CanvasRenderingContext2D': 1 argument required, but only " + num + " present.\""; +} + var TypeError = "TypeError: Type error"; -var TypeErrorNotEnoughArguments = "TypeError: Not enough arguments"; -shouldThrow("ctx.setFillColor()", "TypeErrorNotEnoughArguments"); +shouldThrow("ctx.setFillColor()", ExpectedNotEnoughArgumentsMessage(0)); shouldBe("ctx.setFillColor('red')", "undefined"); shouldBe("ctx.setFillColor(0)", "undefined"); shouldBe("ctx.setFillColor(0, 0)", "undefined"); diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-setShadow.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-setShadow.js index 211bfe0..be94257 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-setShadow.js +++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-setShadow.js @@ -2,12 +2,15 @@ description("Test the behavior of CanvasRenderingContext2D.setShadow() when call var ctx = document.createElement('canvas').getContext('2d'); +function ExpectedNotEnoughArgumentsMessage(num) { + return "\"TypeError: Failed to execute 'setShadow' on 'CanvasRenderingContext2D': 3 arguments required, but only " + num + " present.\""; +} + var TypeError = "TypeError: Type error"; -var TypeErrorNotEnoughArguments = "TypeError: Not enough arguments"; -shouldThrow("ctx.setShadow()", "TypeErrorNotEnoughArguments"); -shouldThrow("ctx.setShadow(0)", "TypeErrorNotEnoughArguments"); -shouldThrow("ctx.setShadow(0, 0)", "TypeErrorNotEnoughArguments"); +shouldThrow("ctx.setShadow()", ExpectedNotEnoughArgumentsMessage(0)); +shouldThrow("ctx.setShadow(0)", ExpectedNotEnoughArgumentsMessage(1)); +shouldThrow("ctx.setShadow(0, 0)", ExpectedNotEnoughArgumentsMessage(2)); shouldBe("ctx.setShadow(0, 0, 0)", "undefined"); shouldBe("ctx.setShadow(0, 0, 0, 0)", "undefined"); shouldBe("ctx.setShadow(0, 0, 0, 0, 0)", "undefined"); diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-setStrokeColor.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-setStrokeColor.js index cd1bc14..399d2ba 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-setStrokeColor.js +++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-setStrokeColor.js @@ -2,10 +2,13 @@ description("Test the behavior of CanvasRenderingContext2D.setStrokeColor() when var ctx = document.createElement('canvas').getContext('2d'); +function ExpectedNotEnoughArgumentsMessage(num) { + return "\"TypeError: Failed to execute 'setStrokeColor' on 'CanvasRenderingContext2D': 1 argument required, but only " + num + " present.\""; +} + var TypeError = "TypeError: Type error"; -var TypeErrorNotEnoughArguments = "TypeError: Not enough arguments"; -shouldThrow("ctx.setStrokeColor()", "TypeErrorNotEnoughArguments"); +shouldThrow("ctx.setStrokeColor()", ExpectedNotEnoughArgumentsMessage(0)); shouldBe("ctx.setStrokeColor('red')", "undefined"); shouldBe("ctx.setStrokeColor(0)", "undefined"); shouldBe("ctx.setStrokeColor(0, 0)", "undefined"); diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-strokeText.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-strokeText.js index 037bb0b..f794ed1 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-strokeText.js +++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-strokeText.js @@ -2,11 +2,13 @@ description("Test the behavior of CanvasRenderingContext2D.strokeText() when cal var ctx = document.createElement('canvas').getContext('2d'); -var NotEnoughArguments = "TypeError: Not enough arguments"; +function ExpectedMessage(num) { + return "\"TypeError: Failed to execute 'strokeText' on 'CanvasRenderingContext2D': 3 arguments required, but only " + num + " present.\""; +} -shouldThrow("ctx.strokeText()", "NotEnoughArguments"); -shouldThrow("ctx.strokeText('moo')", "NotEnoughArguments"); -shouldThrow("ctx.strokeText('moo',0)", "NotEnoughArguments"); +shouldThrow("ctx.strokeText()", ExpectedMessage(0)); +shouldThrow("ctx.strokeText('moo')", ExpectedMessage(1)); +shouldThrow("ctx.strokeText('moo',0)", ExpectedMessage(2)); shouldBe("ctx.strokeText('moo',0,0)", "undefined"); shouldBe("ctx.strokeText('moo',0,0,0)", "undefined"); shouldBe("ctx.strokeText('moo',0,0,0,0)", "undefined"); diff --git a/third_party/WebKit/LayoutTests/fast/canvas/webgl/context-creation-and-destruction-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/webgl/context-creation-and-destruction-expected.txt index e06910a..be478a1 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/webgl/context-creation-and-destruction-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/webgl/context-creation-and-destruction-expected.txt @@ -1,3 +1,4 @@ +CONSOLE MESSAGE: WARNING: WebGL contexts have exceeded the maximum allowed backbuffer area. Oldest context will be lost. Test that contexts are freed and garbage collected reasonably On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". diff --git a/third_party/WebKit/LayoutTests/fast/canvas/webgl/texImageTest-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/webgl/texImageTest-expected.txt index a8f798b..a54987a 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/webgl/texImageTest-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/webgl/texImageTest-expected.txt @@ -2,7 +2,7 @@ Test of texImage2d and texSubImage2d On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS context.texImage2D(context.TEXTURE_2D) threw exception TypeError: Not enough arguments. +PASS context.texImage2D(context.TEXTURE_2D) threw exception TypeError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': 6 arguments required, but only 1 present.. PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 64, 64, 0, context.RGBA, context.UNSIGNED_BYTE, null) is undefined. PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, context.RGBA, context.UNSIGNED_BYTE, 0) threw exception TypeError: Type error. PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 2, 2, 0, context.RGBA, context.UNSIGNED_BYTE, array) is undefined. @@ -13,7 +13,7 @@ PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, context.RGBA, conte PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, context.RGBA, context.UNSIGNED_BYTE, canvas2d) is undefined. PASS context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, true) is undefined. PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, context.RGBA, context.UNSIGNED_BYTE, video) is undefined. -PASS context.texSubImage2D(context.TEXTURE_2D) threw exception TypeError: Not enough arguments. +PASS context.texSubImage2D(context.TEXTURE_2D) threw exception TypeError: Failed to execute 'texSubImage2D' on 'WebGLRenderingContext': 7 arguments required, but only 1 present.. PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, null) is undefined. PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0) threw exception TypeError: Type error. PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0) threw exception TypeError: Type error. |