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

Side by Side Diff: chrome/utility/wifi/wifi_service_test.cc

Issue 22295002: Base infrastructure for Networking Private API on Windows and Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed compilation error. Created 7 years, 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/bind.h"
6 #include "base/bind_helpers.h"
7 #include "base/logging.h"
8 #include "chrome/utility/wifi/wifi_service.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace wifi {
12
13 namespace {
14
15 WiFiService* CreateTestService() { return WiFiService::CreateServiceMock(); }
16 // WiFiService* CreateTestService() { return WiFiService::CreateService(); }
17
18 class WiFiServiceTestResult {
19 public:
20 void OnError(const std::string& error_name,
21 scoped_ptr<base::DictionaryValue> error_data) {}
22
23 void OnDictionaryResult(const std::string& network_guid,
24 const base::DictionaryValue& dictionary) {}
25
26 void OnNetworkProperties(const std::string& network_guid,
27 const WiFiService::NetworkProperties& properties) {
28 LOG(INFO) << "OnNetworkProperties" << *properties.ToValue(false).release();
29 }
30 };
31
32 TEST(WiFiServiceTest, GetProperties) {
33 scoped_ptr<WiFiService> wifi_service(CreateTestService());
34 WiFiServiceTestResult result;
35 wifi_service->GetProperties(
36 "aaa",
37 base::Bind(&WiFiServiceTestResult::OnNetworkProperties,
38 base::Unretained(&result)),
39 base::Bind(&WiFiServiceTestResult::OnError, base::Unretained(&result)));
40 }
41
42 } // namespace
43
44 } // namespace wifi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698