OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h" | 5 #include "chrome/browser/ui/sync/one_click_signin_sync_starter.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 void CreateSyncStarter(OneClickSigninSyncStarter::Callback callback) { | 55 void CreateSyncStarter(OneClickSigninSyncStarter::Callback callback) { |
56 sync_starter_ = new OneClickSigninSyncStarter( | 56 sync_starter_ = new OneClickSigninSyncStarter( |
57 profile_.get(), | 57 profile_.get(), |
58 NULL, | 58 NULL, |
59 kTestingUsername, | 59 kTestingUsername, |
60 std::string(), | 60 std::string(), |
61 "refresh_token", | 61 "refresh_token", |
62 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS, | 62 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS, |
63 NULL, | 63 NULL, |
64 OneClickSigninSyncStarter::NO_CONFIRMATION, | 64 OneClickSigninSyncStarter::NO_CONFIRMATION, |
| 65 GURL(), |
65 callback); | 66 callback); |
66 } | 67 } |
67 | 68 |
68 content::TestBrowserThreadBundle thread_bundle_; | 69 content::TestBrowserThreadBundle thread_bundle_; |
69 | 70 |
70 scoped_ptr<TestingProfile> profile_; | 71 scoped_ptr<TestingProfile> profile_; |
71 | 72 |
72 // Deletes itself when SigninFailed() or SigninSuccess() is called. | 73 // Deletes itself when SigninFailed() or SigninSuccess() is called. |
73 OneClickSigninSyncStarter* sync_starter_; | 74 OneClickSigninSyncStarter* sync_starter_; |
74 | 75 |
(...skipping 22 matching lines...) Expand all Loading... |
97 } | 98 } |
98 | 99 |
99 // Verifies that there is no crash when the callback is NULL. | 100 // Verifies that there is no crash when the callback is NULL. |
100 TEST_F(OneClickSigninSyncStarterTest, CallbackNull) { | 101 TEST_F(OneClickSigninSyncStarterTest, CallbackNull) { |
101 CreateSyncStarter(OneClickSigninSyncStarter::Callback()); | 102 CreateSyncStarter(OneClickSigninSyncStarter::Callback()); |
102 sync_starter_->SigninFailed(GoogleServiceAuthError( | 103 sync_starter_->SigninFailed(GoogleServiceAuthError( |
103 GoogleServiceAuthError::REQUEST_CANCELED)); | 104 GoogleServiceAuthError::REQUEST_CANCELED)); |
104 EXPECT_EQ(0, failed_count_); | 105 EXPECT_EQ(0, failed_count_); |
105 EXPECT_EQ(0, succeeded_count_); | 106 EXPECT_EQ(0, succeeded_count_); |
106 } | 107 } |
OLD | NEW |