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

Side by Side Diff: remoting/host/pairing_registry_delegate_win_unittest.cc

Issue 810133003: replace NULL->nullptr in src/remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "remoting/host/pairing_registry_delegate_win.h" 5 #include "remoting/host/pairing_registry_delegate_win.h"
6 6
7 #include <shlwapi.h> 7 #include <shlwapi.h>
8 8
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 new PairingRegistryDelegateWin()); 105 new PairingRegistryDelegateWin());
106 delegate->SetRootKeys(privileged_.Handle(), unprivileged_.Handle()); 106 delegate->SetRootKeys(privileged_.Handle(), unprivileged_.Handle());
107 107
108 PairingRegistry::Pairing pairing(base::Time::Now(), "xxx", "xxx", "xxx"); 108 PairingRegistry::Pairing pairing(base::Time::Now(), "xxx", "xxx", "xxx");
109 EXPECT_TRUE(delegate->Save(pairing)); 109 EXPECT_TRUE(delegate->Save(pairing));
110 EXPECT_EQ(delegate->Load(pairing.client_id()), pairing); 110 EXPECT_EQ(delegate->Load(pairing.client_id()), pairing);
111 111
112 // Strip the delegate from write access and validate that it still can be used 112 // Strip the delegate from write access and validate that it still can be used
113 // to read the pairings. 113 // to read the pairings.
114 delegate.reset(new PairingRegistryDelegateWin()); 114 delegate.reset(new PairingRegistryDelegateWin());
115 delegate->SetRootKeys(NULL, unprivileged_.Handle()); 115 delegate->SetRootKeys(nullptr, unprivileged_.Handle());
116 116
117 PairingRegistry::Pairing unprivileged_pairing = 117 PairingRegistry::Pairing unprivileged_pairing =
118 delegate->Load(pairing.client_id()); 118 delegate->Load(pairing.client_id());
119 EXPECT_EQ(pairing.client_id(), unprivileged_pairing.client_id()); 119 EXPECT_EQ(pairing.client_id(), unprivileged_pairing.client_id());
120 EXPECT_EQ(pairing.client_name(), unprivileged_pairing.client_name()); 120 EXPECT_EQ(pairing.client_name(), unprivileged_pairing.client_name());
121 EXPECT_EQ(pairing.created_time(), unprivileged_pairing.created_time()); 121 EXPECT_EQ(pairing.created_time(), unprivileged_pairing.created_time());
122 122
123 // Verify that the shared secret if not available. 123 // Verify that the shared secret if not available.
124 EXPECT_TRUE(unprivileged_pairing.shared_secret().empty()); 124 EXPECT_TRUE(unprivileged_pairing.shared_secret().empty());
125 125
126 // Verify that a pairing cannot be saved. 126 // Verify that a pairing cannot be saved.
127 EXPECT_FALSE(delegate->Save(pairing)); 127 EXPECT_FALSE(delegate->Save(pairing));
128 } 128 }
129 129
130 } // namespace remoting 130 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/pairing_registry_delegate_win.h ('k') | remoting/host/pam_authorization_factory_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698