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

Unified Diff: chrome/browser/sync/test/integration/single_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: rebase 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/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..968e464da1d0ea6a3ffdc26012f0339fb4a43e5e 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 {}
stevenjb 2015/01/28 21:29:43 // SyncTest
mukesh agrawal 2015/01/28 22:55:11 Done.
+ 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,16 @@ 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 profile_index = 0;
+ wifi_credentials_helper::AddWifiCredential(
+ profile_index,
+ "fake_id",
+ wifi_credentials_helper::MakeWifiCredential(
+ "fake-ssid", wifi_sync::SECURITY_CLASS_PSK, "fake_passphrase"));
stevenjb 2015/01/28 21:29:43 I would call MakeWifiCredential separately and ass
mukesh agrawal 2015/01/28 22:55:11 Done.
+ ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((0))));
+ ASSERT_FALSE(wifi_credentials_helper::VerifierIsEmpty());
+ ASSERT_TRUE(wifi_credentials_helper::ProfileMatchesVerifier(0));
stevenjb 2015/01/28 21:29:43 The last two could probably be EXPECT instead of a
mukesh agrawal 2015/01/28 22:55:11 Done.
+}

Powered by Google App Engine
This is Rietveld 408576698