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