| Index: chrome/browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc
|
| diff --git a/chrome/browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc b/chrome/browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc
|
| index f8c68aa85ee5442ed0fc8d3004451227ee119b84..9de53b86cd42dcd8361adf537c60b31a44e16b4f 100644
|
| --- a/chrome/browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc
|
| +++ b/chrome/browser/sync/test/integration/single_client_wifi_credentials_sync_test.cc
|
| @@ -4,20 +4,36 @@
|
|
|
| #include "base/command_line.h"
|
| #include "base/macros.h"
|
| +#include "chrome/browser/sync/test/integration/sync_integration_test_util.h"
|
| #include "chrome/browser/sync/test/integration/sync_test.h"
|
| #include "chrome/browser/sync/test/integration/wifi_credentials_helper.h"
|
| #include "chrome/common/chrome_switches.h"
|
| +#include "components/wifi_sync/wifi_credential.h"
|
| +#include "components/wifi_sync/wifi_security_class.h"
|
| +
|
| +using sync_integration_test_util::AwaitCommitActivityCompletion;
|
| +using wifi_sync::WifiCredential;
|
|
|
| class SingleClientWifiCredentialsSyncTest : public SyncTest {
|
| public:
|
| SingleClientWifiCredentialsSyncTest() : SyncTest(SINGLE_CLIENT) {}
|
| ~SingleClientWifiCredentialsSyncTest() override {}
|
|
|
| + void SetUp() override {
|
| + wifi_credentials_helper::SetUp();
|
| + SyncTest::SetUp();
|
| + }
|
| +
|
| void SetUpCommandLine(base::CommandLine* command_line) override {
|
| SyncTest::SetUpCommandLine(command_line);
|
| command_line->AppendSwitch(switches::kEnableWifiCredentialSync);
|
| }
|
|
|
| + bool SetupClients() override {
|
| + return SyncTest::SetupClients() &&
|
| + wifi_credentials_helper::SetupClients();
|
| + }
|
| +
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(SingleClientWifiCredentialsSyncTest);
|
| };
|
| @@ -27,3 +43,18 @@ IN_PROC_BROWSER_TEST_F(SingleClientWifiCredentialsSyncTest, NoCredentials) {
|
| ASSERT_TRUE(wifi_credentials_helper::VerifierIsEmpty());
|
| ASSERT_TRUE(wifi_credentials_helper::ProfileMatchesVerifier(0));
|
| }
|
| +
|
| +IN_PROC_BROWSER_TEST_F(SingleClientWifiCredentialsSyncTest, SingleCredential) {
|
| + ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
|
| + const size_t kProfileNumber = 0;
|
| + wifi_credentials_helper::AddWifiCredential(
|
| + kProfileNumber,
|
| + "fake_id",
|
| + WifiCredential(
|
| + WifiCredential::MakeSsidBytes("fake-ssid"),
|
| + wifi_sync::SECURITY_CLASS_NONE,
|
| + "fake_passphrase"));
|
| + ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0))));
|
| + ASSERT_FALSE(wifi_credentials_helper::VerifierIsEmpty());
|
| + ASSERT_TRUE(wifi_credentials_helper::ProfileMatchesVerifier(0));
|
| +}
|
|
|