| 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 "extensions/browser/api/socket/udp_socket.h" | |
| 6 | |
| 7 #include <stddef.h> | 5 #include <stddef.h> |
| 8 #include <stdint.h> | 6 #include <stdint.h> |
| 9 | 7 |
| 8 #include <memory> |
| 10 #include <string> | 9 #include <string> |
| 11 | 10 |
| 12 #include "base/location.h" | 11 #include "base/location.h" |
| 13 #include "base/macros.h" | 12 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 16 #include "base/test/test_timeouts.h" | 14 #include "base/test/test_timeouts.h" |
| 17 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
| 18 #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" |
| 19 #include "net/base/io_buffer.h" | 18 #include "net/base/io_buffer.h" |
| 20 #include "net/base/ip_address.h" | 19 #include "net/base/ip_address.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 21 |
| 23 namespace extensions { | 22 namespace extensions { |
| 24 | 23 |
| 25 // UDPSocketUnitTest exists solely to make it easier to pass a specific | 24 // UDPSocketUnitTest exists solely to make it easier to pass a specific |
| 26 // gtest_filter argument during development. | 25 // gtest_filter argument during development. |
| 27 class UDPSocketUnitTest : public BrowserWithTestWindowTest { | 26 class UDPSocketUnitTest : public BrowserWithTestWindowTest { |
| 28 }; | 27 }; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // 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. |
| 144 io_loop.task_runner()->PostDelayedTask( | 143 io_loop.task_runner()->PostDelayedTask( |
| 145 FROM_HERE, base::Bind(&QuitMessageLoop), TestTimeouts::action_timeout()); | 144 FROM_HERE, base::Bind(&QuitMessageLoop), TestTimeouts::action_timeout()); |
| 146 | 145 |
| 147 io_loop.Run(); | 146 io_loop.Run(); |
| 148 | 147 |
| 149 EXPECT_TRUE(packet_received) << "Failed to receive from multicast address"; | 148 EXPECT_TRUE(packet_received) << "Failed to receive from multicast address"; |
| 150 } | 149 } |
| 151 | 150 |
| 152 } // namespace extensions | 151 } // namespace extensions |
| OLD | NEW |