| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" |
| 9 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| 10 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 11 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 11 #include "chrome/browser/extensions/extension_apitest.h" | 12 #include "chrome/browser/extensions/extension_apitest.h" |
| 12 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
| 13 #include "chromeos/dbus/dbus_thread_manager.h" | 14 #include "chromeos/dbus/dbus_thread_manager.h" |
| 14 #include "chromeos/dbus/fake_shill_profile_client.h" | 15 #include "chromeos/dbus/fake_shill_profile_client.h" |
| 15 #include "chromeos/dbus/fake_shill_service_client.h" | 16 #include "chromeos/dbus/fake_shill_service_client.h" |
| 16 #include "chromeos/dbus/fake_shill_third_party_vpn_driver_client.h" | 17 #include "chromeos/dbus/fake_shill_third_party_vpn_driver_client.h" |
| 17 #include "chromeos/network/network_configuration_handler.h" | 18 #include "chromeos/network/network_configuration_handler.h" |
| 18 #include "chromeos/network/network_configuration_observer.h" | 19 #include "chromeos/network/network_configuration_observer.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 49 "foo:bar"}; | 50 "foo:bar"}; |
| 50 const char* kParameterKeys[] = {shill::kAddressParameterThirdPartyVpn, | 51 const char* kParameterKeys[] = {shill::kAddressParameterThirdPartyVpn, |
| 51 shill::kSubnetPrefixParameterThirdPartyVpn, | 52 shill::kSubnetPrefixParameterThirdPartyVpn, |
| 52 shill::kExclusionListParameterThirdPartyVpn, | 53 shill::kExclusionListParameterThirdPartyVpn, |
| 53 shill::kInclusionListParameterThirdPartyVpn, | 54 shill::kInclusionListParameterThirdPartyVpn, |
| 54 shill::kDnsServersParameterThirdPartyVpn, | 55 shill::kDnsServersParameterThirdPartyVpn, |
| 55 shill::kMtuParameterThirdPartyVpn, | 56 shill::kMtuParameterThirdPartyVpn, |
| 56 shill::kBroadcastAddressParameterThirdPartyVpn, | 57 shill::kBroadcastAddressParameterThirdPartyVpn, |
| 57 shill::kDomainSearchParameterThirdPartyVpn}; | 58 shill::kDomainSearchParameterThirdPartyVpn}; |
| 58 | 59 |
| 59 void DoNothingFailureCallback(const std::string& error_name, | 60 void DoNothingFailureCallback( |
| 60 scoped_ptr<base::DictionaryValue> error_data) { | 61 const std::string& error_name, |
| 62 std::unique_ptr<base::DictionaryValue> error_data) { |
| 61 EXPECT_EQ(true, false); | 63 EXPECT_EQ(true, false); |
| 62 } | 64 } |
| 63 | 65 |
| 64 void DoNothingSuccessCallback(const std::string& service_path, | 66 void DoNothingSuccessCallback(const std::string& service_path, |
| 65 const std::string& guid) {} | 67 const std::string& guid) {} |
| 66 | 68 |
| 67 } // namespace | 69 } // namespace |
| 68 | 70 |
| 69 // Records the number of calls and their parameters. Always replies successfully | 71 // Records the number of calls and their parameters. Always replies successfully |
| 70 // to calls. | 72 // to calls. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 void TearDownOnMainThread() override { | 128 void TearDownOnMainThread() override { |
| 127 ExtensionApiTest::TearDownOnMainThread(); | 129 ExtensionApiTest::TearDownOnMainThread(); |
| 128 NetworkHandler::Get()->network_configuration_handler()->RemoveObserver( | 130 NetworkHandler::Get()->network_configuration_handler()->RemoveObserver( |
| 129 this); | 131 this); |
| 130 } | 132 } |
| 131 | 133 |
| 132 void SetUpInProcessBrowserTestFixture() override { | 134 void SetUpInProcessBrowserTestFixture() override { |
| 133 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 135 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 134 test_client_ = new TestShillThirdPartyVpnDriverClient(); | 136 test_client_ = new TestShillThirdPartyVpnDriverClient(); |
| 135 DBusThreadManager::GetSetterForTesting()->SetShillThirdPartyVpnDriverClient( | 137 DBusThreadManager::GetSetterForTesting()->SetShillThirdPartyVpnDriverClient( |
| 136 make_scoped_ptr(test_client_)); | 138 base::WrapUnique(test_client_)); |
| 137 } | 139 } |
| 138 | 140 |
| 139 void AddNetworkProfileForUser() { | 141 void AddNetworkProfileForUser() { |
| 140 static_cast<FakeShillProfileClient*>( | 142 static_cast<FakeShillProfileClient*>( |
| 141 DBusThreadManager::Get()->GetShillProfileClient()) | 143 DBusThreadManager::Get()->GetShillProfileClient()) |
| 142 ->AddProfile( | 144 ->AddProfile( |
| 143 kNetworkProfilePath, | 145 kNetworkProfilePath, |
| 144 chromeos::ProfileHelper::GetUserIdHashFromProfile(profile())); | 146 chromeos::ProfileHelper::GetUserIdHashFromProfile(profile())); |
| 145 content::RunAllPendingInMessageLoop(); | 147 content::RunAllPendingInMessageLoop(); |
| 146 } | 148 } |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 extension_service->BlacklistExtensionForTest(extension_id_); | 479 extension_service->BlacklistExtensionForTest(extension_id_); |
| 478 content::RunAllPendingInMessageLoop(); | 480 content::RunAllPendingInMessageLoop(); |
| 479 EXPECT_FALSE(DoesConfigExist(kTestConfig)); | 481 EXPECT_FALSE(DoesConfigExist(kTestConfig)); |
| 480 EXPECT_FALSE(DBusThreadManager::Get() | 482 EXPECT_FALSE(DBusThreadManager::Get() |
| 481 ->GetShillProfileClient() | 483 ->GetShillProfileClient() |
| 482 ->GetTestInterface() | 484 ->GetTestInterface() |
| 483 ->GetService(service_path, &profile_path, &properties)); | 485 ->GetService(service_path, &profile_path, &properties)); |
| 484 } | 486 } |
| 485 | 487 |
| 486 } // namespace chromeos | 488 } // namespace chromeos |
| OLD | NEW |