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