mozilla/r2d2b2g — pull request #647 by bkase (2013-06-20 18:26:33+00:00)
Title: Simulator unloads on last tab, so adb can unload. Fixes #641

Thanks for help narrowing down this bug @nickdesaulniers!

This patch makes `adb` be killed like it's supposed to after running `make test`.
`adb.js` was being loaded twice because:
`1) require("main") -> require("simulator") -> require("adb") // in test-main.js`
and
`2) require("simulator") -> require("adb") // in test-receipts`

This seemed reasonable, but it looks like we have to move those two top-level requires inside of the test cases so that the second loading executes completely after the first one. Also, we weren't killing `adb` after the last tab was closed (parameter-less unload will do `Simulator.kill` and will kill `adb` if necessary)