Chromium Code Reviews| Index: chrome/test/data/android/barcode_detection.html |
| diff --git a/chrome/test/data/android/barcode_detection.html b/chrome/test/data/android/barcode_detection.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..acb04893ce77a90eb3adba266bdf0216630cd25e |
| --- /dev/null |
| +++ b/chrome/test/data/android/barcode_detection.html |
| @@ -0,0 +1,23 @@ |
| +<html> |
| +<title>test</title> |
| +<body> |
| +</body> |
| +<script> |
| + var img = new Image(); |
| + |
| + img.onload = function() { |
| + var detector = new BarcodeDetector(); |
| + |
| + detector.detect(img) |
| + .then(detectedObjects => { |
| + document.title = 'found ' + detectedObjects.length + ' shapes'; |
|
Maria
2017/02/28 18:40:56
wouldn't you want to test that detected object has
mcasas
2017/02/28 21:06:57
Done.
|
| + }) |
| + .catch(error => { |
| + document.title = 'Error during detection: ' + error.message; |
| + }); |
| + } |
| + |
| + // "https://chromium.org" encoded as QR code in base64 |
| + img.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUoAAAFKAQMAAABB54RGAAAABlBMVEX///8AAABVwtN+AAABUUlEQVRoge2ZwY3FIAxELf0CUlJap6QUEMkbbA+wi5Q92l+aOYQQHqcRZiAiFEVRFPVt0tAtcl7iD20HPjeipVDvHPcz6fr4uHXXUaJl0G5i62MnKOua2USrombsw9/wmWhhdHpKtC5qzaDOXjnbf/WVaBIaQqmMBz4TLYX+0TP2eQWIZqLh3wF3I/b3za4/iJZC4yzW7dQL03v3aYmWQ5d0j6MZZm4LkmgyakNx46F2NNPXQEI0EzUAfCw+jXyiSrQWupZKX4uCI/W+GxLNRj0v4vjsPns+2Yom0XwUq23ucyJI/EQLoksqcd7dveWXiKaj6yRv4emopkTLoIgjCPtGzZuqRrQU6h3sbrEgJYwlWg0dv8LGZQeK5mYs0Tqo53y7UtSxzxEtirYDlAHzjWgd1JqZHC/cJr7UV6JZaGgN+/6veV+GRLNRiqIoivoO/QAJkSlOdmbU0AAAAABJRU5ErkJggg=='; |
| +</script> |
| +</html> |