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

Side by Side Diff: chrome/browser/sync/test/integration/two_client_wifi_credentials_sync_test.cc

Issue 1882243004: Convert //chrome/browser/sync from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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/profile_sync_service_harness.h" 9 #include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
10 #include "chrome/browser/sync/test/integration/sync_test.h" 10 #include "chrome/browser/sync/test/integration/sync_test.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 IN_PROC_BROWSER_TEST_F(TwoClientWifiCredentialsSyncTest, NoCredentials) { 47 IN_PROC_BROWSER_TEST_F(TwoClientWifiCredentialsSyncTest, NoCredentials) {
48 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 48 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
49 ASSERT_TRUE(wifi_credentials_helper::VerifierIsEmpty()); 49 ASSERT_TRUE(wifi_credentials_helper::VerifierIsEmpty());
50 ASSERT_TRUE(wifi_credentials_helper::AllProfilesMatch()); 50 ASSERT_TRUE(wifi_credentials_helper::AllProfilesMatch());
51 } 51 }
52 52
53 IN_PROC_BROWSER_TEST_F(TwoClientWifiCredentialsSyncTest, SingleCredential) { 53 IN_PROC_BROWSER_TEST_F(TwoClientWifiCredentialsSyncTest, SingleCredential) {
54 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 54 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
55 55
56 const char ssid[] = "fake-ssid"; 56 const char ssid[] = "fake-ssid";
57 scoped_ptr<WifiCredential> credential = 57 std::unique_ptr<WifiCredential> credential =
58 wifi_credentials_helper::MakeWifiCredential( 58 wifi_credentials_helper::MakeWifiCredential(
59 ssid, wifi_sync::SECURITY_CLASS_PSK, "fake_passphrase"); 59 ssid, wifi_sync::SECURITY_CLASS_PSK, "fake_passphrase");
60 ASSERT_TRUE(credential); 60 ASSERT_TRUE(credential);
61 61
62 const size_t profile_a_index = 0; 62 const size_t profile_a_index = 0;
63 wifi_credentials_helper::AddWifiCredential( 63 wifi_credentials_helper::AddWifiCredential(
64 profile_a_index, "fake_id", *credential); 64 profile_a_index, "fake_id", *credential);
65 65
66 const WifiCredentialSet verifier_credentials = 66 const WifiCredentialSet verifier_credentials =
67 wifi_credentials_helper::GetWifiCredentialsForProfile(verifier()); 67 wifi_credentials_helper::GetWifiCredentialsForProfile(verifier());
68 EXPECT_EQ(1U, verifier_credentials.size()); 68 EXPECT_EQ(1U, verifier_credentials.size());
69 EXPECT_EQ(WifiCredential::MakeSsidBytesForTest(ssid), 69 EXPECT_EQ(WifiCredential::MakeSsidBytesForTest(ssid),
70 verifier_credentials.begin()->ssid()); 70 verifier_credentials.begin()->ssid());
71 71
72 const size_t profile_b_index = 1; 72 const size_t profile_b_index = 1;
73 ASSERT_TRUE(GetClient(profile_a_index)->AwaitMutualSyncCycleCompletion( 73 ASSERT_TRUE(GetClient(profile_a_index)->AwaitMutualSyncCycleCompletion(
74 GetClient(profile_b_index))); 74 GetClient(profile_b_index)));
75 EXPECT_FALSE(wifi_credentials_helper::VerifierIsEmpty()); 75 EXPECT_FALSE(wifi_credentials_helper::VerifierIsEmpty());
76 EXPECT_TRUE(wifi_credentials_helper::AllProfilesMatch()); 76 EXPECT_TRUE(wifi_credentials_helper::AllProfilesMatch());
77 } 77 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698