OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "base/test/test_timeouts.h" | 14 #include "base/test/test_timeouts.h" |
15 #include "base/thread_task_runner_handle.h" | 15 #include "base/threading/thread_task_runner_handle.h" |
16 #include "chrome/test/base/browser_with_test_window_test.h" | 16 #include "chrome/test/base/browser_with_test_window_test.h" |
17 #include "extensions/browser/api/socket/udp_socket.h" | 17 #include "extensions/browser/api/socket/udp_socket.h" |
18 #include "net/base/io_buffer.h" | 18 #include "net/base/io_buffer.h" |
19 #include "net/base/ip_address.h" | 19 #include "net/base/ip_address.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 | 21 |
22 namespace extensions { | 22 namespace extensions { |
23 | 23 |
24 // UDPSocketUnitTest exists solely to make it easier to pass a specific | 24 // UDPSocketUnitTest exists solely to make it easier to pass a specific |
25 // gtest_filter argument during development. | 25 // gtest_filter argument during development. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // If not received within the test action timeout, quit the message loop. | 142 // If not received within the test action timeout, quit the message loop. |
143 io_loop.task_runner()->PostDelayedTask( | 143 io_loop.task_runner()->PostDelayedTask( |
144 FROM_HERE, base::Bind(&QuitMessageLoop), TestTimeouts::action_timeout()); | 144 FROM_HERE, base::Bind(&QuitMessageLoop), TestTimeouts::action_timeout()); |
145 | 145 |
146 io_loop.Run(); | 146 io_loop.Run(); |
147 | 147 |
148 EXPECT_TRUE(packet_received) << "Failed to receive from multicast address"; | 148 EXPECT_TRUE(packet_received) << "Failed to receive from multicast address"; |
149 } | 149 } |
150 | 150 |
151 } // namespace extensions | 151 } // namespace extensions |
OLD | NEW |