If we remove the logic, we will have the below failures.
```
 1) public interface #launch "before each" hook:

JavaScriptError: (17) TypeError: this.getHomescreen(...) is null

Remote Stack:

@app://system.gaiamobile.org/js/homescreen_launcher.js, line 192

at Error.MarionetteError (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/error.js:67:13)

at Object.Client._handleCallback (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:476:19)

at Client._sendCommand (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:510:21)

at TcpSync.send (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/drivers/tcp-sync.js:100:10)

at Object.send (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:457:36)

at Object.Client._sendCommand (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:503:19)

at Object._executeScript (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:1468:19)

at Object.executeAsyncScript (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:1249:19)

at Object.Client.waitForSync (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:676:14)

at Object.Client.waitFor (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:650:60)

at waitForAppSync (/home/travis/build/mozilla-b2g/marionette-apps/lib/waitforapp.js:51:10)

at waitForApp (/home/travis/build/mozilla-b2g/marionette-apps/lib/waitforapp.js:21:5)

at /home/travis/build/mozilla-b2g/marionette-apps/lib/launch.js:38:12

at /home/travis/build/mozilla-b2g/marionette-apps/lib/getapp.js:83:12

at Object.Mgmt.getAll (/home/travis/build/mozilla-b2g/marionette-apps/lib/mgmt.js:58:14)

at Object.Client._handleCallback (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:484:23)

at Client._sendCommand (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:510:21)

at TcpSync.send (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/drivers/tcp-sync.js:100:10)

at Object.send (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:457:36)

at Object.Client._sendCommand (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:503:19)

at Object._executeScript (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:1468:19)

at Object.executeAsyncScript (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/marionette-client/lib/marionette/client.js:1249:19)

at Object.Mgmt.getAll (/home/travis/build/mozilla-b2g/marionette-apps/lib/mgmt.js:37:19)

at list (/home/travis/build/mozilla-b2g/marionette-apps/lib/list.js:14:20)

at getApp (/home/travis/build/mozilla-b2g/marionette-apps/lib/getapp.js:45:10)

at launch (/home/travis/build/mozilla-b2g/marionette-apps/lib/launch.js:29:10)

at Context.client.scope.searchTimeout (/home/travis/build/mozilla-b2g/marionette-apps/test/index_test.js:13:21)

at Hook.Runnable.run (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/mocha/lib/runnable.js:194:15)

at next (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/mocha/lib/runner.js:244:10)

at Runner.hook (/home/travis/build/mozilla-b2g/marionette-apps/node_modules/mocha/lib/runner.js:255:5)

at process.startup.processNextTick.process._tickCallback (node.js:245:9)
```
Please refer to https://travis-ci.org/mozilla-b2g/marionette-apps/builds/25122880.