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