This is the second CL of several that will eventually replace TokenService with
[chromium-blink-merge.git] / chrome / browser / signin / token_service_unittest.h
bloba12634f8196a9813ef5a181265cb4494db97f65e
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // This file defines a unit test harness for the profile's token service.
7 #ifndef CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_UNITTEST_H_
8 #define CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_UNITTEST_H_
10 #include "base/message_loop/message_loop.h"
11 #include "base/synchronization/waitable_event.h"
12 #include "chrome/browser/signin/token_service.h"
13 #include "chrome/test/base/testing_profile.h"
14 #include "content/public/browser/notification_details.h"
15 #include "content/public/browser/notification_source.h"
16 #include "content/public/test/test_browser_thread_bundle.h"
17 #include "content/public/test/test_notification_tracker.h"
18 #include "google_apis/gaia/gaia_auth_consumer.h"
19 #include "testing/gtest/include/gtest/gtest.h"
21 class FakeSigninManagerBase;
23 class TokenServiceTestHarness : public testing::Test {
24 protected:
25 TokenServiceTestHarness();
26 virtual ~TokenServiceTestHarness();
28 virtual void SetUp() OVERRIDE;
29 virtual void TearDown() OVERRIDE;
31 virtual scoped_ptr<TestingProfile> CreateProfile();
32 void UpdateCredentialsOnService();
33 TestingProfile* profile() const { return profile_.get(); }
34 TokenService* service() const { return service_; }
35 const GaiaAuthConsumer::ClientLoginResult& credentials() const {
36 return credentials_;
39 void CreateSigninManager(const std::string& username);
41 private:
42 content::TestBrowserThreadBundle thread_bundle_;
44 FakeSigninManagerBase* signin_manager_;
45 TokenService* service_;
46 GaiaAuthConsumer::ClientLoginResult credentials_;
47 std::string oauth_token_;
48 std::string oauth_secret_;
49 scoped_ptr<TestingProfile> profile_;
52 #endif // CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_UNITTEST_H_