Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6212)

Unified Diff: chrome/common/net/gaia/gaia_auth_fetcher_unittest.h

Issue 9348022: [cros] Use mocked URLFetcher and other mocks in ExistingUserController tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/net/gaia/gaia_auth_fetcher_unittest.h
diff --git a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.h b/chrome/common/net/gaia/gaia_auth_fetcher_unittest.h
deleted file mode 100644
index 9f6a7baeb5db904b079f3ad458364c5d8e878025..0000000000000000000000000000000000000000
--- a/chrome/common/net/gaia/gaia_auth_fetcher_unittest.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// A collection of classes that are useful when testing things that use a
-// GaiaAuthFetcher.
-
-#ifndef CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_UNITTEST_H_
-#define CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_UNITTEST_H_
-#pragma once
-
-#include <string>
-
-#include "chrome/common/net/gaia/gaia_auth_fetcher.h"
-#include "content/test/test_url_fetcher_factory.h"
-#include "net/url_request/url_request_status.h"
-
-// Responds as though ClientLogin returned from the server.
-class MockFetcher : public TestURLFetcher {
- public:
- MockFetcher(bool success,
- const GURL& url,
- const std::string& results,
- content::URLFetcher::RequestType request_type,
- content::URLFetcherDelegate* d);
-
- MockFetcher(const GURL& url,
- const net::URLRequestStatus& status,
- int response_code,
- const net::ResponseCookies& cookies,
- const std::string& results,
- content::URLFetcher::RequestType request_type,
- content::URLFetcherDelegate* d);
-
- virtual ~MockFetcher();
-
- virtual void Start() OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(MockFetcher);
-};
-
-template<typename T>
-class MockFactory : public content::URLFetcherFactory,
- public ScopedURLFetcherFactory {
- public:
- MockFactory()
- : ScopedURLFetcherFactory(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
- success_(true) {
- }
- ~MockFactory() {}
- content::URLFetcher* CreateURLFetcher(
- int id,
- const GURL& url,
- content::URLFetcher::RequestType request_type,
- content::URLFetcherDelegate* d) OVERRIDE {
- return new T(success_, url, results_, request_type, d);
- }
- void set_success(bool success) {
- success_ = success;
- }
- void set_results(const std::string& results) {
- results_ = results;
- }
- private:
- bool success_;
- std::string results_;
- DISALLOW_COPY_AND_ASSIGN(MockFactory);
-};
-
-#endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_FETCHER_UNITTEST_H_
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/common/net/gaia/gaia_auth_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698