Skip to content

Commit

Permalink
Update accessibility documentation.
Browse files Browse the repository at this point in the history
Move existing overview to accessibility/ subdirectory and make
accessibility.md a table of contents.

Migrate ChromeVox documentation to markdown.
Add new documentation for PATTS and BRLTTY.
Update accessibility LayoutTests documentation.

BUG=none
[email protected],[email protected]
NOTRY=true

Review-Url: https://codereview.chromium.org/2701603002
Cr-Commit-Position: refs/heads/master@{#450865}
  • Loading branch information
minorninth authored and Commit bot committed Feb 16, 2017
1 parent 5bd386b commit 2f48975
Show file tree
Hide file tree
Showing 7 changed files with 908 additions and 514 deletions.
519 changes: 7 additions & 512 deletions docs/accessibility.md

Large diffs are not rendered by default.

65 changes: 65 additions & 0 deletions docs/accessibility/brltty.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# BRLTTY in Chrome OS

Chrome OS uses the open-source [BRLTTY](http://mielke.cc/brltty/)
library to provide support for refreshable braille displays.

We typically ship with a stable release build of BRLTTY plus some
cherry-picked patches.

## Updating BRLTTY or adding a patch

First, follow the public
[Chromium OS Developer Guide](http://www.chromium.org/chromium-os/developer-guide) to check out the source.
At a minimum you'll need to create a chroot.
You do not need to build everything from source.
You do need to start the devserver.

Next, flash your device to a very recent test build. Internally at Google
you can do this with the following command when the dev server is running,
where CHROMEBOOK_IP_ADDRESS is the IP address of your Chromebook already
in developer mode, and $BOARD is your Chromebook's board name.

```cros flash ssh://CHROMEBOOK_IP_ADDRESS xbuddy://remote/$BOARD/latest-dev/test```

The BRLTTY files can be found in this directory:

```third_party/chromiumos-overlay/app-accessibility/brltty```

The first thing you'll need to do is edit the ebuild symlink to change the
revision number. The real file is something like brltty-5.4.ebuild,
but the revision will be something like brltty-5.4-r5.ebuild. You'll need
to increment it.

To increment it from r5 to r6, you'd do something like this:

```
rm brltty-5.4-r5.ebuild
ln -s brltty-5.4.ebuild brltty-5.4-r6.ebuild
git add brltty-5.4-r6.ebuild
```

The changes we make are all patches against a stable release of brltty.
To add a new patch, put it in the files/ directory and reference it in
brltty.bashrc

Once you're done adding patches or making other changes, flash it to your
device like this:

```
emerge-$BOARD brltty
cros deploy CHROMEBOOK_IP_ADDRESS brltty
```

After that, reboot your Chromebook and verify that brltty works.

To upload a change, use repo, something like this:

```
repo start <branch_name> .
git commit -a
BUG=chromium:12345
TEST=Write what you tested here
repo upload .
```

Note that you shouldn't need to run cros_workon.
131 changes: 131 additions & 0 deletions docs/accessibility/chromevox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# ChromeVox (for developers)

ChromeVox is the built-in screen reader on Chrome OS. It was originally
developed as a separate extension but now the code lives inside of the Chromium
tree and it's built as part of Chrome OS.

To start or stop ChromeVox on Chrome OS, press Ctrl+Alt+Z at any time.

## Developer Info

Code location: ```chrome/browser/resources/chromeos/chromevox```

Ninja target: it's built as part of "chrome", but you can build and run
chromevox_tests to test it (Chrome OS target only - you must have target_os =
"chromeos" in your GN args first).

## Developing On Linux

ChromeVox for Chrome OS development is done on Linux.

See [ChromeVox on Desktop Linux](chromevox_on_desktop_linux.md)
for more information.

## ChromeVox Next

ChromeVox Next is the code name we use for a major new rewrite to ChromeVox that
uses the automation API instead of content scripts. The code is part of
ChromeVox (unique ChromeVox Next code is found in
chrome/browser/resources/chromeos/chromevox/cvox2).

ChromeVox contains all of the classic and next code in the same codebase, it
switches its behavior dynamically based on the mode:

* Next: as of version 56 of Chrome/Chrome OS, this is default. ChromeVox uses new key/braille bindings, earcons, speech/braille output style, the Next engine (Automation API), and other major/minor improvements
* Next Compat: in order to maintain compatibility with some clients of the ChromeVox Classic js APIs, some sites have been whitelisted for this mode. ChromeVox will inject classic content scripts, but expose a Next-like user experience (like above)
* Classic: as of version 56 of Chrome/Chrome OS, this mode gets enabled via a keyboard toggle Search+Q. Once enabled, ChromeVox will behave like it did in the past including keyboard bindings, earcons, speech/braille output style, and the underlying engine (content scripts).
* Classic compat for some sites that require Next, while running in Classic, ChromeVox will use the Next engine but expose a Classic user experience (like above)

Once it's ready, the plan is to retire everything other than Next mode.

## ChromeVox Next

To test ChromeVox Next, click on the Gear icon in the upper-right of the screen
to open the ChromeVox options (or press the keyboard shortcut Search+Shift+O, O)
and then click the box to opt into ChromeVox Next.

If you are running m56 or later, you already have ChromeVox Next on by
default. To switch back to Classic, press Search+Q.

## Debugging ChromeVox

There are options available that may assist in debugging ChromeVox. Here are a
few use cases.

### Feature development

When developing a new feature, it may be helpful to save time by not having to
go through a compile cycle. This can be achieved by setting
```chromevox_compress_js``` to 0 in
chrome/browser/resources/chromeos/chromevox/BUILD.gn, or by using a debug build.

In a debug build or with chromevox_compress_js off, the unflattened files in the
Chrome out directory (e.g. out/Release/resources/chromeos/chromevox/). Now you
can hack directly on the copy of ChromeVox in out/ and toggle ChromeVox to pick
up your changes (via Ctrl+Alt+Z).

### Fixing bugs

The easiest way to debug ChromeVox is from an external browser. Start Chrome
with this command-line flag:

```out/Release/chrome --remote-debugging-port=9222```

Now open http://localhost:9222 in a separate instance of the browser, and debug the ChromeVox extension background page from there.

Another option is to use emacs jade (available through -mx
package-list-packages).

It also talks to localhost:9222 but integrates more tightly into emacs instead.

Another option is to use the built-in developer console. Go to the
ChromeVox options page with Search+Shift+o, o; then, substitute the
“options.html” path with “background.html”, and then open up the
inspector.

### Running tests

Build the chromevox_tests target. To run
lots of tests in parallel, run it like this:

```out/Release/chromevox_tests --test-launcher-jobs=20```

Use a test filter if you only want to run some of the tests from a
particular test suite - for example, most of the ChromeVox Next tests
have "E2E" in them (for "end-to-end"), so to only run those:

```out/Release/chromevox_tests --test-launcher-jobs=20 --gtest_filter="*E2E*"```

## ChromeVox for other platforms

ChromeVox can be run as an installable extension, separate from a
linux Chrome OS build.

### From source

chrome/browser/resources/chromeos/chromevox/tools has the required scripts that pack ChromeVox as an extension and make any necessary manifest changes.

### From Webstore

Alternatively, the webstore has the stable version of ChromeVox.

To install without interacting with the webstore UI, place the
following json block in
/opt/google/chrome-unstable/extensions/kgejglhpjiefppelpmljglcjbhoiplfn.json

```
{
"external_update_url": "https://clients2.google.com/service/update2/crx"
}
```

If you're using the desktop Linux version of Chrome, we recommend you
use Voxin for speech. Run chrome with: “google-chrome
--enable-speech-dispatcher” and select a voice provided by the speechd
package from the ChromeVox options page (ChromeVox+o, o). As of the
latest revision of Chrome 44, speechd support has become stable enough
to use with ChromeVox, but still requires the flag.

In the ChromeVox options page, select the flat keymap and use sticky
mode (double press quickly of insert) to emulate a modal screen
reader.
110 changes: 110 additions & 0 deletions docs/accessibility/chromevox_on_desktop_linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# ChromeVox on Desktop Linux

## Starting ChromeVox

On Chrome OS, you can enable spoken feedback (ChromeVox) by pressing Ctrl+Alt+Z.

If you have a Chromebook, this gives you speech support built-in. If you're
building Chrome from source and running it on desktop Linux, speech and braille
won't be included by default. Here's how to enable it.

## Compiling the Chrome OS version of Chrome

First follow the public instructions for
[Chrome checkout and build](https://www.chromium.org/developers/how-tos/get-the-code).

Create a GN configuration with "chromeos" as the target OS, for example:

```> gn args out/ChromeOSRelease```

...in editor, add this line:

```
target_os = "chromeos"
is_component_build = true
is_debug = false
```

Note: Only ```target_os = "chromeos"``` is required, the others are recommended
for a good experience but you can configure Chrome however you like otherwise.
Note that Native Client is required, so do not put enable_nacl = false in
your file anywhere!

Now build Chrome as usual, e.g.:

```ninja -C out/cros chrome```

And run it as usual to see a mostly-complete Chrome OS desktop inside
of a window:

```out/cros/chrome```

By default you'll be logged in as the default user. If you want to
simulate the login manager too, run it like this:

```out/cros/chrome --login-manager```

You can run any of the above under it’s own X session (avoiding any
window manager key combo conflicts) by doing something like

```startx out/cros/chrome```

## Speech

If you want speech, you just need to copy the speech synthesis data
files to /usr/share like it would be on a Chrome OS device:

```
git clone https://chromium.googlesource.com/chromiumos/platform/assets
sudo cp assets /usr/share/chromeos-assets
```

Next, move to that directory and unzip the NaCl executables. You only need
to do the one for your host architecture:

```
cd /usr/share/chromeos-assets/speech_synthesis/patts
unzip tts_service_x86-64.nexe.zip
```

Finally, fix the permissions:

```
sudo chmod oug+r -R /usr/share/chromeos-assets
```

**Be sure to check permissions of /usr/share/chromeos-assets, some
users report they need to chmod or chown too, it really depends
on your system.**

After you do that, just run "chrome" as above
(e.g. out/cros/chrome) and press Ctrl+Alt+Z, and you should hear it
speak! If not, check the logs.

## Braille

ChromeVox uses extension APIs to deliver braille to Brltty through
libbrlapi and uses Liblouis to perform translation and
backtranslation.

Once built, Chrome and ChromeVox will use your machine’s running
Brltty daemon to display braille if ChromeVox is running. Simply
ensure you have a display connected before running Chrome and that
Brltty is running.

Testing against the latest releases of Brltty (e.g. 5.4 at time of
writing) is encouraged.

For more general information, see [ChromeVox](chromevox.md)

# Using ChromeVox

ChromeVox keyboard shortcuts use Search. On Linux that's usually your
Windows key. If some shortcuts don't work, you may need to remove
Gnome keyboard shortcut bindings, or use "startx", as suggested above,
or remap it.

* Search+Space: Click
* Search+Left/Right: navigate linearly
* Search+Period: Open ChromeVox menus
* Search+H: jump to next heading on page
Loading

0 comments on commit 2f48975

Please sign in to comment.