function initializeCookieStorageMock(maxAge, path, domain, secure) {
  // Initialize cookie storage mock.
  mockCookieStorage = {};
  stubs.replace(
      goog.net.cookies,
      'set',
      function(key, value, actualMaxAge, actualPath,
               actualDomain, actualSecure) {
        assertEquals(maxAge, actualMaxAge);
        assertEquals(path, actualPath);
        assertEquals(domain, actualDomain);
        assertEquals(secure, actualSecure);
        mockCookieStorage[key] = value;
      });
  stubs.replace(
      goog.net.cookies,
      'get',
      function(key) {
        return mockCookieStorage[key];
      });
  stubs.replace(
      goog.net.cookies,
      'remove',
      function(key, actualPath, actualDomain) {
        assertEquals(path, actualPath);
        assertEquals(domain, actualDomain);
        delete mockCookieStorage[key];
      });
}
Stubs the cookie setter/getter/remover and asserts the expected cookie config
is passed on each call.
@param {*} maxAge  The max age in seconds (from now). Use -1 to
    set a session cookie. If not provided, the default is -1
    (i.e. set a session cookie).
@param {*} path  The path of the cookie. If not present then this
    uses the full request path.
@param {*} domain  The domain of the cookie, or null to not
    specify a domain attribute (browser will use the full request host name).
    If not provided, the default is null (i.e. let browser use full request
    host name).
@param {*} secure Whether the cookie should only be sent over
    a secure channel.