| Index: chrome/browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc
|
| diff --git a/chrome/browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc b/chrome/browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc
|
| index db170202d3a06153abec77884ec94a18eea90889..eac3c438f7a4351d6c714dbcdfc1ef36fd780f93 100644
|
| --- a/chrome/browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc
|
| +++ b/chrome/browser/sync/test/integration/two_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/profile_sync_service_harness.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 wifi_sync::WifiCredential;
|
| +using SsidBytes = wifi_sync::WifiCredential::SsidBytes;
|
|
|
| class TwoClientWifiCredentialsSyncTest : public SyncTest {
|
| public:
|
| TwoClientWifiCredentialsSyncTest() : SyncTest(TWO_CLIENT) {}
|
| ~TwoClientWifiCredentialsSyncTest() 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(TwoClientWifiCredentialsSyncTest);
|
| };
|
| @@ -27,3 +43,20 @@ IN_PROC_BROWSER_TEST_F(TwoClientWifiCredentialsSyncTest, NoCredentials) {
|
| ASSERT_TRUE(wifi_credentials_helper::VerifierIsEmpty());
|
| ASSERT_TRUE(wifi_credentials_helper::AllProfilesMatch());
|
| }
|
| +
|
| +IN_PROC_BROWSER_TEST_F(TwoClientWifiCredentialsSyncTest, SingleCredential) {
|
| + ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
|
| + const size_t kProfileAIndex = 0;
|
| + const size_t kProfileBIndex = 1;
|
| + wifi_credentials_helper::AddWifiCredential(
|
| + kProfileAIndex,
|
| + "fake_id",
|
| + WifiCredential(
|
| + WifiCredential::MakeSsidBytes("fake-ssid"),
|
| + wifi_sync::SECURITY_CLASS_NONE,
|
| + "fake_passphrase"));
|
| + ASSERT_TRUE(GetClient(kProfileAIndex)->AwaitMutualSyncCycleCompletion(
|
| + GetClient(kProfileBIndex)));
|
| + ASSERT_FALSE(wifi_credentials_helper::VerifierIsEmpty());
|
| + ASSERT_TRUE(wifi_credentials_helper::AllProfilesMatch());
|
| +}
|
|
|