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

Side by Side Diff: chrome/browser/net/gaia/token_service_unittest.h

Issue 7465041: GTTF: Use a fresh TestingBrowserProcess for each test, part #4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file defines a unit test harness for the profile's token service. 5 // This file defines a unit test harness for the profile's token service.
6 6
7 #ifndef CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_UNITTEST_H_ 7 #ifndef CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_UNITTEST_H_
8 #define CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_UNITTEST_H_ 8 #define CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_UNITTEST_H_
9 #pragma once 9 #pragma once
10 10
11 #include "base/synchronization/waitable_event.h" 11 #include "base/synchronization/waitable_event.h"
12 #include "chrome/browser/net/gaia/token_service.h" 12 #include "chrome/browser/net/gaia/token_service.h"
13 #include "chrome/browser/webdata/web_data_service.h" 13 #include "chrome/browser/webdata/web_data_service.h"
14 #include "chrome/common/net/gaia/gaia_auth_consumer.h" 14 #include "chrome/common/net/gaia/gaia_auth_consumer.h"
15 #include "chrome/test/base/signaling_task.h" 15 #include "chrome/test/base/signaling_task.h"
16 #include "chrome/test/base/test_notification_tracker.h" 16 #include "chrome/test/base/test_notification_tracker.h"
17 #include "chrome/test/base/testing_profile.h" 17 #include "chrome/test/base/testing_profile.h"
18 #include "chrome/test/testing_browser_process_test.h"
18 #include "content/common/notification_details.h" 19 #include "content/common/notification_details.h"
19 #include "content/common/notification_source.h" 20 #include "content/common/notification_source.h"
20 #include "testing/gtest/include/gtest/gtest.h" 21 #include "testing/gtest/include/gtest/gtest.h"
21 22
22 // TestNotificationTracker doesn't do a deep copy on the notification details. 23 // TestNotificationTracker doesn't do a deep copy on the notification details.
23 // We have to in order to read it out, or we have a bad ptr, since the details 24 // We have to in order to read it out, or we have a bad ptr, since the details
24 // are a reference on the stack. 25 // are a reference on the stack.
25 class TokenAvailableTracker : public TestNotificationTracker { 26 class TokenAvailableTracker : public TestNotificationTracker {
26 public: 27 public:
27 TokenAvailableTracker(); 28 TokenAvailableTracker();
(...skipping 21 matching lines...) Expand all
49 } 50 }
50 51
51 private: 52 private:
52 virtual void Observe(int type, 53 virtual void Observe(int type,
53 const NotificationSource& source, 54 const NotificationSource& source,
54 const NotificationDetails& details); 55 const NotificationDetails& details);
55 56
56 TokenService::TokenRequestFailedDetails details_; 57 TokenService::TokenRequestFailedDetails details_;
57 }; 58 };
58 59
59 class TokenServiceTestHarness : public testing::Test { 60 class TokenServiceTestHarness : public TestingBrowserProcessTest {
60 public: 61 public:
61 TokenServiceTestHarness(); 62 TokenServiceTestHarness();
62 virtual ~TokenServiceTestHarness(); 63 virtual ~TokenServiceTestHarness();
63 64
64 virtual void SetUp(); 65 virtual void SetUp();
65 66
66 virtual void TearDown(); 67 virtual void TearDown();
67 68
68 void WaitForDBLoadCompletion(); 69 void WaitForDBLoadCompletion();
69 70
70 MessageLoopForUI message_loop_; 71 MessageLoopForUI message_loop_;
71 BrowserThread ui_thread_; // Mostly so DCHECKS pass. 72 BrowserThread ui_thread_; // Mostly so DCHECKS pass.
72 BrowserThread db_thread_; // WDS on here 73 BrowserThread db_thread_; // WDS on here
73 74
74 TokenService service_; 75 TokenService service_;
75 TokenAvailableTracker success_tracker_; 76 TokenAvailableTracker success_tracker_;
76 TokenFailedTracker failure_tracker_; 77 TokenFailedTracker failure_tracker_;
77 GaiaAuthConsumer::ClientLoginResult credentials_; 78 GaiaAuthConsumer::ClientLoginResult credentials_;
78 scoped_ptr<TestingProfile> profile_; 79 scoped_ptr<TestingProfile> profile_;
79 }; 80 };
80 81
81 #endif // CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_UNITTEST_H_ 82 #endif // CHROME_BROWSER_NET_GAIA_TOKEN_SERVICE_UNITTEST_H_
OLDNEW
« no previous file with comments | « chrome/browser/net/gaia/gaia_oauth_fetcher_unittest.cc ('k') | chrome/browser/notifications/desktop_notifications_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698