Convert Google Now's State Change Gathering Mechanism to use Promises

Now that Promises have arrived in stable, we can start using them.
This change converts onStateChange to use promises and adds rudimentary
unit test support to handle this new feature.

V8's Promises are not used because the Javascript test harness expects
tests to complete synchronously. Promises, which run asynchronously, may
still be pending at the completion of a test, causing the test case to fail.

BUG=164227

Review URL: https://codereview.chromium.org/158003003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250992 0039d316-1c4b-4281-b951-d872f2087c98
3 files changed