| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 EXPECT_TRUE( | 188 EXPECT_TRUE( |
| 189 service_->sync_service_url().spec() == | 189 service_->sync_service_url().spec() == |
| 190 ProfileSyncService::kSyncServerUrl || | 190 ProfileSyncService::kSyncServerUrl || |
| 191 service_->sync_service_url().spec() == | 191 service_->sync_service_url().spec() == |
| 192 ProfileSyncService::kDevServerUrl); | 192 ProfileSyncService::kDevServerUrl); |
| 193 } | 193 } |
| 194 | 194 |
| 195 // Tests that the sync service doesn't forget to notify observers about | 195 // Tests that the sync service doesn't forget to notify observers about |
| 196 // setup state. | 196 // setup state. |
| 197 TEST(ProfileSyncServiceTestBasic, SetupInProgress) { | 197 TEST(ProfileSyncServiceTestBasic, SetupInProgress) { |
| 198 scoped_ptr<TestingProfile> profile(new TestingProfile()); |
| 198 ProfileSyncService service( | 199 ProfileSyncService service( |
| 199 NULL, NULL, NULL, NULL, ProfileSyncService::MANUAL_START); | 200 NULL, profile.get(), NULL, NULL, |
| 201 ProfileSyncService::MANUAL_START); |
| 200 TestProfileSyncServiceObserver observer(&service); | 202 TestProfileSyncServiceObserver observer(&service); |
| 201 service.AddObserver(&observer); | 203 service.AddObserver(&observer); |
| 202 service.SetSetupInProgress(true); | 204 service.SetSetupInProgress(true); |
| 203 EXPECT_TRUE(observer.first_setup_in_progress()); | 205 EXPECT_TRUE(observer.first_setup_in_progress()); |
| 204 service.SetSetupInProgress(false); | 206 service.SetSetupInProgress(false); |
| 205 EXPECT_FALSE(observer.first_setup_in_progress()); | 207 EXPECT_FALSE(observer.first_setup_in_progress()); |
| 206 service.RemoveObserver(&observer); | 208 service.RemoveObserver(&observer); |
| 207 } | 209 } |
| 208 | 210 |
| 209 TEST_F(ProfileSyncServiceTest, DisabledByPolicy) { | 211 TEST_F(ProfileSyncServiceTest, DisabledByPolicy) { |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 EXPECT_TRUE(token_status.next_token_request_time.is_null()); | 516 EXPECT_TRUE(token_status.next_token_request_time.is_null()); |
| 515 | 517 |
| 516 // Simulate successful connection. | 518 // Simulate successful connection. |
| 517 service_->OnConnectionStatusChange(syncer::CONNECTION_OK); | 519 service_->OnConnectionStatusChange(syncer::CONNECTION_OK); |
| 518 token_status = service_->GetSyncTokenStatus(); | 520 token_status = service_->GetSyncTokenStatus(); |
| 519 EXPECT_EQ(syncer::CONNECTION_OK, token_status.connection_status); | 521 EXPECT_EQ(syncer::CONNECTION_OK, token_status.connection_status); |
| 520 } | 522 } |
| 521 | 523 |
| 522 } // namespace | 524 } // namespace |
| 523 } // namespace browser_sync | 525 } // namespace browser_sync |
| OLD | NEW |