OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/scoped_ptr.h" | 5 #include "base/scoped_ptr.h" |
6 #include "base/scoped_temp_dir.h" | 6 #include "base/scoped_temp_dir.h" |
7 #include "base/test/test_file_util.h" | 7 #include "base/test/test_file_util.h" |
8 #include "base/waitable_event.h" | 8 #include "base/waitable_event.h" |
9 #include "chrome/browser/sync/engine/all_status.h" | 9 #include "chrome/browser/sync/engine/all_status.h" |
10 #include "chrome/browser/sync/engine/auth_watcher.h" | 10 #include "chrome/browser/sync/engine/auth_watcher.h" |
11 #include "chrome/browser/sync/engine/net/gaia_authenticator.h" | 11 #include "chrome/browser/sync/engine/net/gaia_authenticator.h" |
12 #include "chrome/browser/sync/engine/net/http_return.h" | 12 #include "chrome/browser/sync/engine/net/http_return.h" |
13 #include "chrome/browser/sync/notifier/listener/talk_mediator_impl.h" | |
14 #include "chrome/browser/sync/util/user_settings.h" | 13 #include "chrome/browser/sync/util/user_settings.h" |
15 #include "chrome/common/deprecated/event_sys-inl.h" | 14 #include "chrome/common/deprecated/event_sys-inl.h" |
| 15 #include "chrome/common/net/notifier/listener/talk_mediator_impl.h" |
16 #include "chrome/test/sync/engine/mock_server_connection.h" | 16 #include "chrome/test/sync/engine/mock_server_connection.h" |
17 #include "chrome/test/sync/engine/test_directory_setter_upper.h" | 17 #include "chrome/test/sync/engine/test_directory_setter_upper.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 static FilePath::CharType kUserSettingsDB[] = | 20 static FilePath::CharType kUserSettingsDB[] = |
21 FILE_PATH_LITERAL("Settings.sqlite3"); | 21 FILE_PATH_LITERAL("Settings.sqlite3"); |
22 static const char* kTestUserAgent = "useragent"; | 22 static const char* kTestUserAgent = "useragent"; |
23 static const char* kTestServiceId = "serviceid"; | 23 static const char* kTestServiceId = "serviceid"; |
24 static const char* kTestGaiaURL = "http://gaia_url"; | 24 static const char* kTestGaiaURL = "http://gaia_url"; |
25 static const char* kUserDisplayName = "Mr. Auth Watcher"; | 25 static const char* kUserDisplayName = "Mr. Auth Watcher"; |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 EXPECT_EQ(AuthWatcherEvent::AUTHENTICATION_ATTEMPT_START, ConsumeNextEvent()); | 224 EXPECT_EQ(AuthWatcherEvent::AUTHENTICATION_ATTEMPT_START, ConsumeNextEvent()); |
225 EXPECT_EQ(AuthWatcherEvent::AUTH_SUCCEEDED, ConsumeNextEvent()); | 225 EXPECT_EQ(AuthWatcherEvent::AUTH_SUCCEEDED, ConsumeNextEvent()); |
226 | 226 |
227 auth_watcher()->RenewAuthToken("updated_token"); | 227 auth_watcher()->RenewAuthToken("updated_token"); |
228 EXPECT_EQ(AuthWatcherEvent::AUTH_RENEWED, ConsumeNextEvent()); | 228 EXPECT_EQ(AuthWatcherEvent::AUTH_RENEWED, ConsumeNextEvent()); |
229 EXPECT_EQ(gaia_auth()->renewed_token(), "updated_token"); | 229 EXPECT_EQ(gaia_auth()->renewed_token(), "updated_token"); |
230 EXPECT_EQ(connection()->auth_token(), "updated_token"); | 230 EXPECT_EQ(connection()->auth_token(), "updated_token"); |
231 } | 231 } |
232 | 232 |
233 } // namespace browser_sync | 233 } // namespace browser_sync |
OLD | NEW |