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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "base/threading/platform_thread.h" | 7 #include "base/threading/platform_thread.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
10 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" | 10 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" |
11 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" | 11 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
12 #include "chrome/browser/sync/test/integration/single_client_status_change_check
er.h" | 12 #include "chrome/browser/sync/test/integration/single_client_status_change_check
er.h" |
13 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" | 13 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" |
14 #include "chrome/browser/sync/test/integration/sync_test.h" | 14 #include "chrome/browser/sync/test/integration/sync_test.h" |
15 #include "components/browser_sync/browser/profile_sync_service.h" | 15 #include "components/browser_sync/profile_sync_service.h" |
16 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 16 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
17 #include "google_apis/gaia/google_service_auth_error.h" | 17 #include "google_apis/gaia/google_service_auth_error.h" |
18 #include "net/http/http_status_code.h" | 18 #include "net/http/http_status_code.h" |
19 #include "net/url_request/url_request_status.h" | 19 #include "net/url_request/url_request_status.h" |
20 | 20 |
21 using bookmarks_helper::AddURL; | 21 using bookmarks_helper::AddURL; |
22 using sync_integration_test_util::AwaitCommitActivityCompletion; | 22 using sync_integration_test_util::AwaitCommitActivityCompletion; |
23 | 23 |
24 const char kShortLivedOAuth2Token[] = | 24 const char kShortLivedOAuth2Token[] = |
25 "{" | 25 "{" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 GetFakeServer()->SetAuthenticated(); | 299 GetFakeServer()->SetAuthenticated(); |
300 SetOAuth2TokenResponse(kValidOAuth2Token, | 300 SetOAuth2TokenResponse(kValidOAuth2Token, |
301 net::HTTP_OK, | 301 net::HTTP_OK, |
302 net::URLRequestStatus::SUCCESS); | 302 net::URLRequestStatus::SUCCESS); |
303 | 303 |
304 // Verify that the next sync cycle is successful, and uses the new auth token. | 304 // Verify that the next sync cycle is successful, and uses the new auth token. |
305 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); | 305 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0)))); |
306 std::string new_token = GetSyncService((0))->GetAccessTokenForTest(); | 306 std::string new_token = GetSyncService((0))->GetAccessTokenForTest(); |
307 ASSERT_NE(old_token, new_token); | 307 ASSERT_NE(old_token, new_token); |
308 } | 308 } |
OLD | NEW |