summaryrefslogtreecommitdiffstats
path: root/toolkit/content/tests/widgets/test_image_recognition_unsupported.html
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/content/tests/widgets/test_image_recognition_unsupported.html')
-rw-r--r--toolkit/content/tests/widgets/test_image_recognition_unsupported.html36
1 files changed, 36 insertions, 0 deletions
diff --git a/toolkit/content/tests/widgets/test_image_recognition_unsupported.html b/toolkit/content/tests/widgets/test_image_recognition_unsupported.html
new file mode 100644
index 0000000000..8c5ca08504
--- /dev/null
+++ b/toolkit/content/tests/widgets/test_image_recognition_unsupported.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Image recognition unsupported</title>
+ <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+ <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
+ <script src="head.js"></script>
+ <link rel="stylesheet" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+</head>
+<body>
+<p id="display"></p>
+
+<div id="content">
+ <img src="image.png" />
+</div>
+
+<pre id="test">
+<script class="testbody">
+ /**
+ * This test is for platforms that do not support text recognition.
+ */
+ add_task(async () => {
+ const img = document.querySelector("#content img");
+
+ info("Recognizing the current image text is not supported on this platform.");
+ try {
+ await img.recognizeCurrentImageText();
+ ok(false, "Recognizing the text should not be supported.");
+ } catch (error) {
+ ok(error, "Expected unsupported message: " + error.message);
+ }
+ });
+</script>
+</pre>
+</body>
+</html>