summaryrefslogtreecommitdiff
path: root/testing/resources/javascript/color_methods_expected.txt
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-23 21:38:28 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-23 21:38:28 +0000
commit5ff1ddeb54a425e1af25607646697e93a39bd51d (patch)
tree31266c1e22ab146883cc165bc7925a341ce28a9d /testing/resources/javascript/color_methods_expected.txt
parent401077e47c49c3b1cb865ee6f1f29a931a6ca45b (diff)
downloadpdfium-5ff1ddeb54a425e1af25607646697e93a39bd51d.tar.xz
Test color.convert() and equal() from JS (and fix comparison logic).
Currently, color.equal(a, b) may not give the same result as color.equal(b, a) since arg1 is converted to be the type of arg2, and some of these conversions lose information. Instead promote to the type with the most components in the hope of preserving the most information. Better error message when there are the right number of parameters but the types are wrong. Change-Id: I1d93fa29db4fb65e0f7c07c3ba7d9ca87ebf7bc9 Reviewed-on: https://pdfium-review.googlesource.com/c/44413 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'testing/resources/javascript/color_methods_expected.txt')
-rw-r--r--testing/resources/javascript/color_methods_expected.txt57
1 files changed, 57 insertions, 0 deletions
diff --git a/testing/resources/javascript/color_methods_expected.txt b/testing/resources/javascript/color_methods_expected.txt
new file mode 100644
index 0000000000..2552a5e4ba
--- /dev/null
+++ b/testing/resources/javascript/color_methods_expected.txt
@@ -0,0 +1,57 @@
+Alert: PASS: color.convert() threw error color.convert: Incorrect number of parameters passed to function.
+Alert: PASS: color.convert(1) threw error color.convert: Incorrect number of parameters passed to function.
+Alert: PASS: color.convert(undefined, 'RGB') threw error color.convert: Incorrect parameter type.
+Alert: PASS: color.convert('BOGUS', 'RGB') threw error color.convert: Incorrect parameter type.
+Alert: PASS: color.convert('{}', 'RGB') threw error color.convert: Incorrect parameter type.
+Alert: PASS: color.convert(['T'], 'BOGUS') = T
+Alert: PASS: color.convert(['T'], 'T') = T
+Alert: PASS: color.convert(['T'], 'G') = T
+Alert: PASS: color.convert(['T'], 'RGB') = T
+Alert: PASS: color.convert(['T'], 'CMYK') = T
+Alert: PASS: color.convert(['G', 0.50], 'BOGUS') = T
+Alert: PASS: color.convert(['G', 0.50], 'T') = T
+Alert: PASS: color.convert(['G', 0.50], 'G') = G,0.5
+Alert: PASS: color.convert(['G', 0.50], 'RGB') = RGB,0.5,0.5,0.5
+Alert: PASS: color.convert(['G', 0.50], 'CMYK') = CMYK,0,0,0,0.5
+Alert: PASS: color.convert(['RGB', 0.25, 0.50, 0.75], 'BOGUS') = T
+Alert: PASS: color.convert(['RGB', 0.25, 0.50, 0.75], 'T') = T
+Alert: PASS: color.convert(['RGB', 1.00, 1.00, 1.00], 'G') = G,1
+Alert: PASS: color.convert(['RGB', 0.25, 0.50, 0.75], 'RGB') = RGB,0.25,0.5,0.75
+Alert: PASS: color.convert(['RGB', 0.25, 0.50, 0.75], 'CMYK') = CMYK,0.75,0.5,0.25,0.25
+Alert: PASS: color.convert(['CMYK',0.25,0.25,0.25,0.50], 'BOGUS') = T
+Alert: PASS: color.convert(['CMYK',0.25,0.25,0.25,0.50], 'T') = T
+Alert: PASS: color.convert(['CMYK',0.25,0.25,0.25,0.50], 'G') = G,0.25
+Alert: PASS: color.convert(['CMYK',0.25,0.25,0.25,0.50], 'RGB') = RGB,0.25,0.25,0.25
+Alert: PASS: color.convert(['CMYK',0.25,0.25,0.25,0.50], 'CMYK') = CMYK,0.25,0.25,0.25,0.5
+Alert: PASS: color.equal() threw error color.equal: Incorrect number of parameters passed to function.
+Alert: PASS: color.equal(1) threw error color.equal: Incorrect number of parameters passed to function.
+Alert: PASS: color.equal(undefined, undefined) threw error color.equal: Incorrect parameter type.
+Alert: PASS: color.equal(undefined, 'BOGUS') threw error color.equal: Incorrect parameter type.
+Alert: PASS: color.equal('BOGUS', 'BOGUS') threw error color.equal: Incorrect parameter type.
+Alert: PASS: color.equal('BOGUS', ['T']) threw error color.equal: Incorrect parameter type.
+Alert: PASS: color.equal(['T'], 'BOGUS') threw error color.equal: Incorrect parameter type.
+Alert: PASS: color.equal(['T'], ['T']) = true
+Alert: PASS: color.equal(['T'], ['G', 0]) = false
+Alert: PASS: color.equal(['T'], ['RGB', 0, 0, 0]) = false
+Alert: PASS: color.equal(['T'], ['CMYK', 0, 0, 0, 0]) = false
+Alert: PASS: color.equal(['G', 0.50], ['T']) = false
+Alert: PASS: color.equal(['G', 0.50], ['G', 0]) = false
+Alert: PASS: color.equal(['G', 0.50], ['G', 0.50]) = true
+Alert: PASS: color.equal(['G', 0.50], ['RGB', 0, 0, 0]) = false
+Alert: PASS: color.equal(['G', 0.50], ['RGB', 0.50, 0.50, 0.50]) = true
+Alert: PASS: color.equal(['G', 0.50], ['CMYK', 0, 0, 0, 0]) = false
+Alert: PASS: color.equal(['G', 0.50], ['CMYK', 0, 0, 0, 0.50]) = true
+Alert: PASS: color.equal(['RGB', 0.25, 0.25, 0.25], ['T']) = false
+Alert: PASS: color.equal(['RGB', 0.25, 0.25, 0.25], ['G', 0]) = false
+Alert: PASS: color.equal(['RGB', 0.25, 0.25, 0.25], ['G', 0.25]) = true
+Alert: PASS: color.equal(['RGB', 0.25, 0.25, 0.25], ['RGB', 0, 0, 0]) = false
+Alert: PASS: color.equal(['RGB', 0.25, 0.25, 0.25], ['RGB', 0.25, 0.25, 0.25]) = true
+Alert: PASS: color.equal(['RGB', 0.25, 0.25, 0.25], ['CMYK', 0, 0, 0, 0]) = false
+Alert: PASS: color.equal(['RGB', 0.25, 0.25, 0.25], ['CMYK', 0.75, 0.75, 0.75, 0.75]) = true
+Alert: PASS: color.equal(['CMYK', 0.25, 0.25, 0.25, 0.50], ['T']) = false
+Alert: PASS: color.equal(['CMYK', 0.00, 0.25, 0.25, 0.50], ['G', 0]) = false
+Alert: PASS: color.equal(['CMYK', 0.00, 0.00, 0.00, 0.50], ['G', 0.50]) = true
+Alert: PASS: color.equal(['CMYK', 0.75, 0.50, 0.25, 0.25], ['RGB', 0, 0, 0]) = false
+Alert: PASS: color.equal(['CMYK', 0.75, 0.50, 0.25, 0.25], ['RGB', 0.25, 0.50, 0.75]) = true
+Alert: PASS: color.equal(['CMYK', 0.25, 0.25, 0.25, 0.50], ['CMYK', 0, 0, 0, 0]) = false
+Alert: PASS: color.equal(['CMYK', 0.25, 0.25, 0.25, 0.50], ['CMYK', 0.25, 0.25, 0.25, 0.50]) = true