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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" | 7 #include "chrome/browser/sync/test/integration/sync_integration_test_util.h" |
8 #include "chrome/browser/sync/test/integration/sync_test.h" | 8 #include "chrome/browser/sync/test/integration/sync_test.h" |
9 #include "chrome/browser/sync/test/integration/wifi_credentials_helper.h" | 9 #include "chrome/browser/sync/test/integration/wifi_credentials_helper.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 IN_PROC_BROWSER_TEST_F(SingleClientWifiCredentialsSyncTest, SingleCredential) { | 52 IN_PROC_BROWSER_TEST_F(SingleClientWifiCredentialsSyncTest, SingleCredential) { |
53 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; | 53 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; |
54 | 54 |
55 const char ssid[] = "fake-ssid"; | 55 const char ssid[] = "fake-ssid"; |
56 scoped_ptr<WifiCredential> credential = | 56 scoped_ptr<WifiCredential> credential = |
57 wifi_credentials_helper::MakeWifiCredential( | 57 wifi_credentials_helper::MakeWifiCredential( |
58 ssid, wifi_sync::SECURITY_CLASS_PSK, "fake_passphrase"); | 58 ssid, wifi_sync::SECURITY_CLASS_PSK, "fake_passphrase"); |
59 ASSERT_TRUE(credential); | 59 ASSERT_TRUE(credential); |
60 | 60 |
61 const size_t profile_index = 0; | 61 const size_t profile_index = 0; |
62 wifi_credentials_helper::AddWifiCredential( | 62 wifi_credentials_helper::AddWifiCredential(profile_index, *credential); |
63 profile_index, "fake_id", *credential); | |
64 | 63 |
65 const WifiCredentialSet verifier_credentials = | 64 const WifiCredentialSet verifier_credentials = |
66 wifi_credentials_helper::GetWifiCredentialsForProfile(verifier()); | 65 wifi_credentials_helper::GetWifiCredentialsForProfile(verifier()); |
67 EXPECT_EQ(1U, verifier_credentials.size()); | 66 EXPECT_EQ(1U, verifier_credentials.size()); |
68 EXPECT_EQ(WifiCredential::MakeSsidBytesForTest(ssid), | 67 EXPECT_EQ(WifiCredential::MakeSsidBytesForTest(ssid), |
69 verifier_credentials.begin()->ssid()); | 68 verifier_credentials.begin()->ssid()); |
70 | 69 |
71 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((profile_index)))); | 70 ASSERT_TRUE(AwaitCommitActivityCompletion(GetSyncService((profile_index)))); |
72 EXPECT_TRUE(wifi_credentials_helper::ProfileMatchesVerifier(profile_index)); | 71 EXPECT_TRUE(wifi_credentials_helper::ProfileMatchesVerifier(profile_index)); |
73 } | 72 } |
OLD | NEW |