Bug 542481

Summary: An OCRHelper class to read widget text
Product: [Eclipse Project] Platform Reporter: Mickael Istria <mistria>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: akurtakov, azerr, daniel_megert, wim.jongman
Version: 4.8Keywords: helpwanted
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Mickael Istria CLA 2018-12-06 13:12:41 EST
The Test harness should provide an OCRHelper method that would delegate to software like `tesseract` to read the screen content. That would make it very handy to test some cases of rendering like code minings.
Command I tried successfully is `tesseract /path/to/screenshot.png stdout -psm 6` for a text editor; we can replace the path/to/screenshot by stdin and send the image of the widget to stdin stream.
Usage could look like
```
styledText.setText("class A {}");
assertEquals("0 references\nclass A {}", OCRHelper.read(styledText))
```
Comment 1 Alexander Kurtakov CLA 2019-02-12 13:59:28 EST
Remove target.