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 "chromeos/network/firewall_hole.h" | 5 #include "chromeos/network/firewall_hole.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "chromeos/dbus/dbus_thread_manager.h" | 10 #include "chromeos/dbus/dbus_thread_manager.h" |
11 #include "chromeos/dbus/mock_permission_broker_client.h" | 11 #include "chromeos/dbus/mock_permission_broker_client.h" |
12 #include "dbus/file_descriptor.h" | |
13 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
15 | 14 |
16 using chromeos::DBusThreadManager; | 15 using chromeos::DBusThreadManager; |
17 using chromeos::FirewallHole; | 16 using chromeos::FirewallHole; |
18 using chromeos::MockPermissionBrokerClient; | 17 using chromeos::MockPermissionBrokerClient; |
19 using testing::_; | 18 using testing::_; |
20 | 19 |
21 namespace { | 20 namespace { |
22 | 21 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 TEST_F(FirewallHoleTest, DenyUdpPortAccess) { | 98 TEST_F(FirewallHoleTest, DenyUdpPortAccess) { |
100 EXPECT_CALL(*mock_permission_broker_client_, | 99 EXPECT_CALL(*mock_permission_broker_client_, |
101 RequestUdpPortAccess(1234, "foo0", _, _)) | 100 RequestUdpPortAccess(1234, "foo0", _, _)) |
102 .WillOnce(InvokeCallback<3>(false)); | 101 .WillOnce(InvokeCallback<3>(false)); |
103 | 102 |
104 FirewallHole::Open( | 103 FirewallHole::Open( |
105 FirewallHole::PortType::UDP, 1234, "foo0", | 104 FirewallHole::PortType::UDP, 1234, "foo0", |
106 base::Bind(&FirewallHoleTest::AssertOpenFailure, base::Unretained(this))); | 105 base::Bind(&FirewallHoleTest::AssertOpenFailure, base::Unretained(this))); |
107 run_loop_.Run(); | 106 run_loop_.Run(); |
108 } | 107 } |
OLD | NEW |