Implement IdentityManager::StartObservingCookieChanges API

CL implements IdentityManager::StartObservingCookieChanges as a wrapper to
GaiaCookieManagerService::InitCookieListener API.

As for the unittest, the following was done:

- Removed the call to GCMS::InitCookieListener() from IdentityManagerTest
ctor. Reason: up to this point, all existing tests pass without this method
being invoked, given that no calls to GCMS::OnCookieChange() were actually
coming from network::CookieManager through mojo (GCMS inherits from
network::mojom::CookieChangeListener). Instead SimulateCookieDeletedByUser()
was being used to call GCMS::OnCookieChange().

- Actually calls GCMS::InitCookieListener() from the newly added
IdentityManagerTest.StartObservingCookieChanges test, though the newly added
IdentityManager::StartObservingCookieChanges API.
From this test, dispatch a cookie change through the mojo pipe with a
known cause, so that the test blocks on the expected IdentityManager
observer call (OnAccountsCookieDeletedByUserAction).

BUG=926864

Change-Id: I88d4499831e80252716a605e2fa346b73d5289d6
Reviewed-on: https://chromium-review.googlesource.com/c/1460016
Commit-Queue: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630292}
6 files changed