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

Side by Side Diff: chromeos/dbus/fake_shill_profile_client.cc

Issue 330833003: Rely on Service.Visible instead of Manager.Services (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix stubs for tests Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chromeos/dbus/fake_shill_manager_client.cc ('k') | chromeos/dbus/fake_shill_service_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chromeos/dbus/fake_shill_profile_client.h" 5 #include "chromeos/dbus/fake_shill_profile_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 138 }
139 139
140 void FakeShillProfileClient::AddEntry(const std::string& profile_path, 140 void FakeShillProfileClient::AddEntry(const std::string& profile_path,
141 const std::string& entry_path, 141 const std::string& entry_path,
142 const base::DictionaryValue& properties) { 142 const base::DictionaryValue& properties) {
143 ProfileProperties* profile = GetProfile(dbus::ObjectPath(profile_path), 143 ProfileProperties* profile = GetProfile(dbus::ObjectPath(profile_path),
144 ErrorCallback()); 144 ErrorCallback());
145 DCHECK(profile); 145 DCHECK(profile);
146 profile->entries.SetWithoutPathExpansion(entry_path, properties.DeepCopy()); 146 profile->entries.SetWithoutPathExpansion(entry_path, properties.DeepCopy());
147 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> 147 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()->
148 AddManagerService(entry_path); 148 AddManagerService(entry_path, true);
149 } 149 }
150 150
151 bool FakeShillProfileClient::AddService(const std::string& profile_path, 151 bool FakeShillProfileClient::AddService(const std::string& profile_path,
152 const std::string& service_path) { 152 const std::string& service_path) {
153 ProfileProperties* profile = GetProfile(dbus::ObjectPath(profile_path), 153 ProfileProperties* profile = GetProfile(dbus::ObjectPath(profile_path),
154 ErrorCallback()); 154 ErrorCallback());
155 if (!profile) { 155 if (!profile) {
156 LOG(ERROR) << "AddService: No matching profile: " << profile_path 156 LOG(ERROR) << "AddService: No matching profile: " << profile_path
157 << " for: " << service_path; 157 << " for: " << service_path;
158 return false; 158 return false;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 if (found == profiles_.end()) { 248 if (found == profiles_.end()) {
249 if (!error_callback.is_null()) 249 if (!error_callback.is_null())
250 error_callback.Run("Error.InvalidProfile", "Invalid profile"); 250 error_callback.Run("Error.InvalidProfile", "Invalid profile");
251 return NULL; 251 return NULL;
252 } 252 }
253 253
254 return found->second; 254 return found->second;
255 } 255 }
256 256
257 } // namespace chromeos 257 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_shill_manager_client.cc ('k') | chromeos/dbus/fake_shill_service_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698