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/sync/test/integration/profile_sync_service_harness.h" | 5 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <ostream> | 9 #include <ostream> |
10 #include <sstream> | 10 #include <sstream> |
11 | 11 |
12 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/ptr_util.h" |
14 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
15 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 17 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
17 #include "chrome/browser/sync/profile_sync_service_factory.h" | 18 #include "chrome/browser/sync/profile_sync_service_factory.h" |
18 #include "chrome/browser/sync/test/integration/quiesce_status_change_checker.h" | 19 #include "chrome/browser/sync/test/integration/quiesce_status_change_checker.h" |
19 #include "chrome/browser/sync/test/integration/single_client_status_change_check
er.h" | 20 #include "chrome/browser/sync/test/integration/single_client_status_change_check
er.h" |
20 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
21 #include "chrome/browser/ui/browser_finder.h" | 22 #include "chrome/browser/ui/browser_finder.h" |
22 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 23 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
23 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 24 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // Still waiting on sync setup. | 92 // Still waiting on sync setup. |
92 return false; | 93 return false; |
93 } | 94 } |
94 | 95 |
95 std::string GetDebugMessage() const override { return "Sync Setup"; } | 96 std::string GetDebugMessage() const override { return "Sync Setup"; } |
96 }; | 97 }; |
97 | 98 |
98 } // namespace | 99 } // namespace |
99 | 100 |
100 // static | 101 // static |
101 ProfileSyncServiceHarness* ProfileSyncServiceHarness::Create( | 102 std::unique_ptr<ProfileSyncServiceHarness> ProfileSyncServiceHarness::Create( |
102 Profile* profile, | 103 Profile* profile, |
103 const std::string& username, | 104 const std::string& username, |
104 const std::string& password, | 105 const std::string& password, |
105 SigninType signin_type) { | 106 SigninType signin_type) { |
106 return new ProfileSyncServiceHarness(profile, | 107 return base::WrapUnique( |
107 username, | 108 new ProfileSyncServiceHarness(profile, username, password, signin_type)); |
108 password, | |
109 signin_type); | |
110 } | 109 } |
111 | 110 |
112 ProfileSyncServiceHarness::ProfileSyncServiceHarness( | 111 ProfileSyncServiceHarness::ProfileSyncServiceHarness( |
113 Profile* profile, | 112 Profile* profile, |
114 const std::string& username, | 113 const std::string& username, |
115 const std::string& password, | 114 const std::string& password, |
116 SigninType signin_type) | 115 SigninType signin_type) |
117 : profile_(profile), | 116 : profile_(profile), |
118 service_(ProfileSyncServiceFactory::GetForProfile(profile)), | 117 service_(ProfileSyncServiceFactory::GetForProfile(profile)), |
119 username_(username), | 118 username_(username), |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 | 543 |
545 std::string ProfileSyncServiceHarness::GetServiceStatus() { | 544 std::string ProfileSyncServiceHarness::GetServiceStatus() { |
546 std::unique_ptr<base::DictionaryValue> value( | 545 std::unique_ptr<base::DictionaryValue> value( |
547 syncer::sync_ui_util::ConstructAboutInformation( | 546 syncer::sync_ui_util::ConstructAboutInformation( |
548 service(), service()->signin(), chrome::GetChannel())); | 547 service(), service()->signin(), chrome::GetChannel())); |
549 std::string service_status; | 548 std::string service_status; |
550 base::JSONWriter::WriteWithOptions( | 549 base::JSONWriter::WriteWithOptions( |
551 *value, base::JSONWriter::OPTIONS_PRETTY_PRINT, &service_status); | 550 *value, base::JSONWriter::OPTIONS_PRETTY_PRINT, &service_status); |
552 return service_status; | 551 return service_status; |
553 } | 552 } |
OLD | NEW |