| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/wifi_credentials_helper.h" | 5 #include "chrome/browser/sync/test/integration/wifi_credentials_helper.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 WifiCredentialSet other_profile_credentials = | 122 WifiCredentialSet other_profile_credentials = |
| 123 GetWifiCredentialsForProfile(test()->GetProfile(i)); | 123 GetWifiCredentialsForProfile(test()->GetProfile(i)); |
| 124 if (!CredentialsMatch(profile0_credentials, other_profile_credentials)) { | 124 if (!CredentialsMatch(profile0_credentials, other_profile_credentials)) { |
| 125 LOG(ERROR) << "Profile " << i << " " << "does not match with profile 0."; | 125 LOG(ERROR) << "Profile " << i << " " << "does not match with profile 0."; |
| 126 return false; | 126 return false; |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 return true; | 129 return true; |
| 130 } | 130 } |
| 131 | 131 |
| 132 scoped_ptr<WifiCredential> MakeWifiCredential(const std::string& ssid, | 132 std::unique_ptr<WifiCredential> MakeWifiCredential( |
| 133 WifiSecurityClass security_class, | 133 const std::string& ssid, |
| 134 const std::string& passphrase) { | 134 WifiSecurityClass security_class, |
| 135 const std::string& passphrase) { |
| 135 return WifiCredential::Create(WifiCredential::MakeSsidBytesForTest(ssid), | 136 return WifiCredential::Create(WifiCredential::MakeSsidBytesForTest(ssid), |
| 136 security_class, | 137 security_class, |
| 137 passphrase); | 138 passphrase); |
| 138 } | 139 } |
| 139 | 140 |
| 140 void AddWifiCredential(int profile_index, | 141 void AddWifiCredential(int profile_index, |
| 141 const std::string& sync_id, | 142 const std::string& sync_id, |
| 142 const WifiCredential& credential) { | 143 const WifiCredential& credential) { |
| 143 AddWifiCredentialToProfile(test()->GetProfile(profile_index), credential); | 144 AddWifiCredentialToProfile(test()->GetProfile(profile_index), credential); |
| 144 if (test()->use_verifier()) | 145 if (test()->use_verifier()) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 155 #if defined(OS_CHROMEOS) | 156 #if defined(OS_CHROMEOS) |
| 156 return wifi_credentials_helper::chromeos:: | 157 return wifi_credentials_helper::chromeos:: |
| 157 GetWifiCredentialsForProfileChromeOs(profile); | 158 GetWifiCredentialsForProfileChromeOs(profile); |
| 158 #else | 159 #else |
| 159 NOTREACHED(); | 160 NOTREACHED(); |
| 160 return WifiCredential::MakeSet(); | 161 return WifiCredential::MakeSet(); |
| 161 #endif | 162 #endif |
| 162 } | 163 } |
| 163 | 164 |
| 164 } // namespace wifi_credentials_helper | 165 } // namespace wifi_credentials_helper |
| OLD | NEW |