Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5291)

Unified Diff: chrome/browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc

Issue 843483004: sync: add more integration tests for wifi_sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@submit-4.3-syncable-service
Patch Set: use directory-level deps (instead of file-level) Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..92c951ef8e1171b6e31004d895f9c5bba527e7f8 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,19 +4,34 @@
#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 {}
+ // SyncTest implementation.
+ 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);
}
pneubeck (no reviews) 2015/01/30 14:38:45 usually we put empty lines between function /defin
mukesh agrawal 2015/01/30 22:28:14 Done.
+ bool SetupClients() override {
+ return SyncTest::SetupClients() &&
+ wifi_credentials_helper::SetupClients();
+ }
private:
DISALLOW_COPY_AND_ASSIGN(TwoClientWifiCredentialsSyncTest);
@@ -27,3 +42,21 @@ 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.";
+
+ scoped_ptr<WifiCredential> credential =
+ wifi_credentials_helper::MakeWifiCredential(
+ "fake-ssid", wifi_sync::SECURITY_CLASS_PSK, "fake_passphrase");
+ ASSERT_TRUE(credential);
+
+ const size_t profile_a_index = 0;
+ const size_t profile_b_index = 1;
+ wifi_credentials_helper::AddWifiCredential(
+ profile_a_index, "fake_id", *credential);
+ ASSERT_TRUE(GetClient(profile_a_index)->AwaitMutualSyncCycleCompletion(
+ GetClient(profile_b_index)));
+ EXPECT_FALSE(wifi_credentials_helper::VerifierIsEmpty());
+ EXPECT_TRUE(wifi_credentials_helper::AllProfilesMatch());
pneubeck (no reviews) 2015/01/30 14:38:45 same comment as for the other test
mukesh agrawal 2015/01/30 22:28:14 Same response. :)
+}

Powered by Google App Engine
This is Rietveld 408576698