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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 protected: | 54 protected: |
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 std::string(), | 59 std::string(), |
60 kTestingUsername, | 60 kTestingUsername, |
61 std::string(), | 61 std::string(), |
62 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS, | 62 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS, |
63 false, | 63 NULL, |
64 OneClickSigninSyncStarter::NO_CONFIRMATION, | 64 OneClickSigninSyncStarter::NO_CONFIRMATION, |
65 signin::SOURCE_UNKNOWN, | 65 signin::SOURCE_UNKNOWN, |
66 callback | 66 callback |
67 ); | 67 ); |
68 } | 68 } |
69 | 69 |
70 scoped_ptr<TestingProfile> profile_; | 70 scoped_ptr<TestingProfile> profile_; |
71 | 71 |
72 // Deletes itself when SigninFailed() or SigninSuccess() is called. | 72 // Deletes itself when SigninFailed() or SigninSuccess() is called. |
73 OneClickSigninSyncStarter* sync_starter_; | 73 OneClickSigninSyncStarter* sync_starter_; |
(...skipping 24 matching lines...) Expand all Loading... |
98 } | 98 } |
99 | 99 |
100 // Verifies that there is no crash when the callback is NULL. | 100 // Verifies that there is no crash when the callback is NULL. |
101 TEST_F(OneClickSigninSyncStarterTest, CallbackNull) { | 101 TEST_F(OneClickSigninSyncStarterTest, CallbackNull) { |
102 CreateSyncStarter(OneClickSigninSyncStarter::Callback()); | 102 CreateSyncStarter(OneClickSigninSyncStarter::Callback()); |
103 sync_starter_->SigninFailed(GoogleServiceAuthError( | 103 sync_starter_->SigninFailed(GoogleServiceAuthError( |
104 GoogleServiceAuthError::REQUEST_CANCELED)); | 104 GoogleServiceAuthError::REQUEST_CANCELED)); |
105 EXPECT_EQ(0, failed_count_); | 105 EXPECT_EQ(0, failed_count_); |
106 EXPECT_EQ(0, succeeded_count_); | 106 EXPECT_EQ(0, succeeded_count_); |
107 } | 107 } |
OLD | NEW |