OLD | NEW |
(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 |
OLD | NEW |