OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
10 #include "chrome/browser/signin/signin_manager.h" | 10 #include "chrome/browser/signin/signin_manager.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 file_thread_.Start(); | 64 file_thread_.Start(); |
65 io_thread_.StartIOThread(); | 65 io_thread_.StartIOThread(); |
66 profile_->CreateRequestContext(); | 66 profile_->CreateRequestContext(); |
67 CreateSyncService(); | 67 CreateSyncService(); |
68 service_->AddObserver(&observer_); | 68 service_->AddObserver(&observer_); |
69 service_->set_synchronous_sync_configuration(); | 69 service_->set_synchronous_sync_configuration(); |
70 } | 70 } |
71 | 71 |
72 virtual void TearDown() { | 72 virtual void TearDown() { |
73 service_->RemoveObserver(&observer_); | 73 service_->RemoveObserver(&observer_); |
| 74 service_->Shutdown(); |
74 service_.reset(); | 75 service_.reset(); |
75 profile_.reset(); | 76 profile_.reset(); |
76 | 77 |
77 // Pump messages posted by the sync core thread (which may end up | 78 // Pump messages posted by the sync core thread (which may end up |
78 // posting on the IO thread). | 79 // posting on the IO thread). |
79 ui_loop_.RunAllPending(); | 80 ui_loop_.RunAllPending(); |
80 io_thread_.Stop(); | 81 io_thread_.Stop(); |
81 file_thread_.Stop(); | 82 file_thread_.Stop(); |
82 ui_loop_.RunAllPending(); | 83 ui_loop_.RunAllPending(); |
83 } | 84 } |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 343 |
343 // Preload the tokens. | 344 // Preload the tokens. |
344 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest( | 345 TokenServiceFactory::GetForProfile(profile_.get())->IssueAuthTokenForTest( |
345 GaiaConstants::kSyncService, "sync_token"); | 346 GaiaConstants::kSyncService, "sync_token"); |
346 service_->fail_initial_download(); | 347 service_->fail_initial_download(); |
347 | 348 |
348 service_->Initialize(); | 349 service_->Initialize(); |
349 EXPECT_FALSE(service_->sync_initialized()); | 350 EXPECT_FALSE(service_->sync_initialized()); |
350 EXPECT_FALSE(service_->GetBackendForTest()); | 351 EXPECT_FALSE(service_->GetBackendForTest()); |
351 } | 352 } |
OLD | NEW |