Bug 1281800 - Add wpt for fillText() in Canvas. r=jmuizelaar, Ms2ger
authorvincentliu <vliu@mozilla.com>
Tue, 19 Jul 2016 10:53:51 +0800
changeset 330733 2d8e504f0e0c7f27c7caa913449e2036a2528f95
parent 330732 1c09aef633ab9dd7102555bfc7d384331e4b0a36
child 330734 b5bb0ea5c5c89315744395a6b8d1b88a735cc7eb
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmuizelaar, Ms2ger
bugs1281800, 100644
milestone50.0a1
Bug 1281800 - Add wpt for fillText() in Canvas. r=jmuizelaar, Ms2ger --- .../2d.text.draw.fill.maxWidth.negative.html.ini | 5 ---- .../2d.text.draw.fill.maxWidth.zero.html.ini | 5 ---- testing/web-platform/meta/MANIFEST.json | 6 ++++ .../2d.text.draw.fill.maxWidth.NaN.html | 32 ++++++++++++++++++++++ .../tests/2dcontext/tools/tests2dtext.yaml | 13 +++++++++ 5 files changed, 51 insertions(+), 10 deletions(-) delete mode 100644 testing/web-platform/meta/2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.negative.html.ini delete mode 100644 testing/web-platform/meta/2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.zero.html.ini create mode 100644 testing/web-platform/tests/2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.NaN.html
testing/web-platform/meta/2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.negative.html.ini
testing/web-platform/meta/2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.zero.html.ini
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.NaN.html
testing/web-platform/tests/2dcontext/tools/tests2dtext.yaml
deleted file mode 100644
--- a/testing/web-platform/meta/2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.negative.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[2d.text.draw.fill.maxWidth.negative.html]
-  type: testharness
-  [fillText handles maxWidth correctly]
-    expected: FAIL
-
deleted file mode 100644
--- a/testing/web-platform/meta/2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.zero.html.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[2d.text.draw.fill.maxWidth.zero.html]
-  type: testharness
-  [fillText handles maxWidth correctly]
-    expected: FAIL
-
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -36092,16 +36092,22 @@
       "WebCryptoAPI/generateKey/test_failures.html",
       "WebCryptoAPI/generateKey/test_successes.html",
       "web-animations/interfaces/AnimationTimeline/idlharness.html",
       "WebCryptoAPI/generateKey/successes.worker.js"
     ],
     "deleted_reftests": {},
     "items": {
       "testharness": {
+        "2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.NaN.html": [
+          {
+            "path": "2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.NaN.html",
+            "url": "/2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.NaN.html"
+          }
+        ],
         "WebCryptoAPI/generateKey/failures_AES-CBC.worker.js": [
           {
             "path": "WebCryptoAPI/generateKey/failures_AES-CBC.worker.js",
             "url": "/WebCryptoAPI/generateKey/failures_AES-CBC.worker"
           }
         ],
         "WebCryptoAPI/generateKey/failures_AES-CTR.worker.js": [
           {
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.NaN.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. -->
+<title>Canvas test: 2d.text.draw.fill.maxWidth.NaN</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<link rel="stylesheet" href="/common/canvas-tests.css">
+<body class="show_output">
+
+<h1>2d.text.draw.fill.maxWidth.NaN</h1>
+<p class="desc">fillText handles maxWidth correctly</p>
+
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+var t = async_test("fillText handles maxWidth correctly");
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.font = '35px Arial, sans-serif';
+ctx.fillText('fail fail fail fail fail', 5, 35, NaN);
+_assertGreen(ctx, 100, 50);
+
+
+});
+</script>
+
--- a/testing/web-platform/tests/2dcontext/tools/tests2dtext.yaml
+++ b/testing/web-platform/tests/2dcontext/tools/tests2dtext.yaml
@@ -315,16 +315,29 @@
     ctx.fillStyle = '#0f0';
     ctx.fillRect(0, 0, 100, 50);
     ctx.fillStyle = '#f00';
     ctx.font = '35px Arial, sans-serif';
     ctx.fillText('fail fail fail fail fail', 5, 35, -1);
     _assertGreen(ctx, 100, 50);
   expected: green
 
+- name: 2d.text.draw.fill.maxWidth.NaN
+  desc: fillText handles maxWidth correctly
+  testing:
+    - 2d.text.draw.maxwidth
+  code: |
+    ctx.fillStyle = '#0f0';
+    ctx.fillRect(0, 0, 100, 50);
+    ctx.fillStyle = '#f00';
+    ctx.font = '35px Arial, sans-serif';
+    ctx.fillText('fail fail fail fail fail', 5, 35, NaN);
+    _assertGreen(ctx, 100, 50);
+  expected: green
+
 - name: 2d.text.draw.stroke.basic
   desc: strokeText draws stroked text
   manual:
   testing:
     - 2d.text.draw
     - 2d.text.draw.stroke
   code: |
     ctx.fillStyle = '#000';