| 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 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_WIFI_CREDENTIALS_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_WIFI_CREDENTIALS_HELPER_H_ |
| 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_WIFI_CREDENTIALS_HELPER_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_WIFI_CREDENTIALS_HELPER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "components/wifi_sync/wifi_credential.h" | 11 #include "components/sync_wifi/wifi_credential.h" |
| 12 #include "components/wifi_sync/wifi_security_class.h" | 12 #include "components/sync_wifi/wifi_security_class.h" |
| 13 | 13 |
| 14 class Profile; | 14 class Profile; |
| 15 | 15 |
| 16 // Functions needed by multiple wifi_credentials integration | 16 // Functions needed by multiple wifi_credentials integration |
| 17 // tests. This module is platfrom-agnostic, and calls out to | 17 // tests. This module is platfrom-agnostic, and calls out to |
| 18 // platform-specific code as needed. | 18 // platform-specific code as needed. |
| 19 namespace wifi_credentials_helper { | 19 namespace wifi_credentials_helper { |
| 20 | 20 |
| 21 // Performs common setup steps, such as configuring factories. Should | 21 // Performs common setup steps, such as configuring factories. Should |
| 22 // be called before SyncTest::SetUp. | 22 // be called before SyncTest::SetUp. |
| 23 void SetUp(); | 23 void SetUp(); |
| 24 | 24 |
| 25 // Initializes the clients. This includes associating their Chrome | 25 // Initializes the clients. This includes associating their Chrome |
| 26 // Profiles with platform-specific networking state. Should be called | 26 // Profiles with platform-specific networking state. Should be called |
| 27 // before adding/removing/modifying WiFi credentials. | 27 // before adding/removing/modifying WiFi credentials. |
| 28 void SetupClients(); | 28 void SetupClients(); |
| 29 | 29 |
| 30 // Checks if the verifier has any items in it. Returns true iff the | 30 // Checks if the verifier has any items in it. Returns true iff the |
| 31 // verifier has no items. | 31 // verifier has no items. |
| 32 bool VerifierIsEmpty(); | 32 bool VerifierIsEmpty(); |
| 33 | 33 |
| 34 // Compares the BrowserContext for |profile_index| with the | 34 // Compares the BrowserContext for |profile_index| with the |
| 35 // verifier. Returns true iff their WiFi credentials match. | 35 // verifier. Returns true iff their WiFi credentials match. |
| 36 bool ProfileMatchesVerifier(int profile_index); | 36 bool ProfileMatchesVerifier(int profile_index); |
| 37 | 37 |
| 38 // Returns true iff all BrowserContexts match with the verifier. | 38 // Returns true iff all BrowserContexts match with the verifier. |
| 39 bool AllProfilesMatch(); | 39 bool AllProfilesMatch(); |
| 40 | 40 |
| 41 // Returns a new WifiCredential constructed from the given parameters. | 41 // Returns a new WifiCredential constructed from the given parameters. |
| 42 std::unique_ptr<wifi_sync::WifiCredential> MakeWifiCredential( | 42 std::unique_ptr<sync_wifi::WifiCredential> MakeWifiCredential( |
| 43 const std::string& ssid, | 43 const std::string& ssid, |
| 44 wifi_sync::WifiSecurityClass security_class, | 44 sync_wifi::WifiSecurityClass security_class, |
| 45 const std::string& passphrase); | 45 const std::string& passphrase); |
| 46 | 46 |
| 47 // Adds a WiFi credential to the service at index |profile_index|, | 47 // Adds a WiFi credential to the service at index |profile_index|, |
| 48 // and the verifier (if the SyncTest uses a verifier). | 48 // and the verifier (if the SyncTest uses a verifier). |
| 49 void AddWifiCredential(int profile_index, | 49 void AddWifiCredential(int profile_index, |
| 50 const std::string& sync_id, | 50 const std::string& sync_id, |
| 51 const wifi_sync::WifiCredential& credential); | 51 const sync_wifi::WifiCredential& credential); |
| 52 | 52 |
| 53 // Returns the set of WifiCredentials configured in local network | 53 // Returns the set of WifiCredentials configured in local network |
| 54 // settings, for |profile|. | 54 // settings, for |profile|. |
| 55 wifi_sync::WifiCredential::CredentialSet GetWifiCredentialsForProfile( | 55 sync_wifi::WifiCredential::CredentialSet GetWifiCredentialsForProfile( |
| 56 const Profile* profile); | 56 const Profile* profile); |
| 57 | 57 |
| 58 } // namespace wifi_credentials_helper | 58 } // namespace wifi_credentials_helper |
| 59 | 59 |
| 60 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_WIFI_CREDENTIALS_HELPER_H_ | 60 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_WIFI_CREDENTIALS_HELPER_H_ |
| OLD | NEW |