| Index: chrome/utility/wifi/wifi_service_test.cc
|
| diff --git a/chrome/utility/wifi/wifi_service_test.cc b/chrome/utility/wifi/wifi_service_test.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..e5905403cf574711ebdcd0228dd0784595d26031
|
| --- /dev/null
|
| +++ b/chrome/utility/wifi/wifi_service_test.cc
|
| @@ -0,0 +1,44 @@
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "base/bind.h"
|
| +#include "base/bind_helpers.h"
|
| +#include "base/logging.h"
|
| +#include "chrome/utility/wifi/wifi_service.h"
|
| +#include "testing/gtest/include/gtest/gtest.h"
|
| +
|
| +namespace wifi {
|
| +
|
| +namespace {
|
| +
|
| +WiFiService* CreateTestService() { return WiFiService::CreateServiceMock(); }
|
| +// WiFiService* CreateTestService() { return WiFiService::CreateService(); }
|
| +
|
| +class WiFiServiceTestResult {
|
| + public:
|
| + void OnError(const std::string& error_name,
|
| + scoped_ptr<base::DictionaryValue> error_data) {}
|
| +
|
| + void OnDictionaryResult(const std::string& network_guid,
|
| + const base::DictionaryValue& dictionary) {}
|
| +
|
| + void OnNetworkProperties(const std::string& network_guid,
|
| + const WiFiService::NetworkProperties& properties) {
|
| + LOG(INFO) << "OnNetworkProperties" << *properties.ToValue(false).release();
|
| + }
|
| +};
|
| +
|
| +TEST(WiFiServiceTest, GetProperties) {
|
| + scoped_ptr<WiFiService> wifi_service(CreateTestService());
|
| + WiFiServiceTestResult result;
|
| + wifi_service->GetProperties(
|
| + "aaa",
|
| + base::Bind(&WiFiServiceTestResult::OnNetworkProperties,
|
| + base::Unretained(&result)),
|
| + base::Bind(&WiFiServiceTestResult::OnError, base::Unretained(&result)));
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| +} // namespace wifi
|
|
|