OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/renderer/p2p/p2p_transport_impl.h" | |
6 | |
5 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
6 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
7 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
8 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
9 #include "content/renderer/p2p/p2p_transport_impl.h" | |
10 #include "jingle/glue/fake_network_manager.h" | 11 #include "jingle/glue/fake_network_manager.h" |
11 #include "jingle/glue/fake_socket_factory.h" | 12 #include "jingle/glue/fake_socket_factory.h" |
12 #include "jingle/glue/thread_wrapper.h" | 13 #include "jingle/glue/thread_wrapper.h" |
13 #include "net/base/completion_callback.h" | 14 #include "net/base/completion_callback.h" |
14 #include "net/base/io_buffer.h" | 15 #include "net/base/io_buffer.h" |
15 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
16 #include "net/base/net_util.h" | 17 #include "net/base/net_util.h" |
17 #include "net/socket/socket.h" | 18 #include "net/socket/socket.h" |
18 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
20 | 21 |
21 using testing::_; | 22 using testing::_; |
22 using testing::AtMost; | 23 using testing::AtMost; |
23 using testing::Exactly; | 24 using testing::Exactly; |
24 using testing::InvokeWithoutArgs; | 25 using testing::InvokeWithoutArgs; |
25 | 26 |
26 using webkit_glue::P2PTransport; | 27 using webkit_glue::P2PTransport; |
27 | 28 |
29 namespace content { | |
30 | |
28 namespace { | 31 namespace { |
jam
2011/08/24 00:24:27
ditto
Sergey Ulanov
2011/08/24 01:57:48
Done.
| |
29 const char kTestAddress1[] = "192.168.15.12"; | 32 const char kTestAddress1[] = "192.168.15.12"; |
30 const char kTestAddress2[] = "192.168.15.33"; | 33 const char kTestAddress2[] = "192.168.15.33"; |
31 | 34 |
32 const char kTransportName1[] = "tr1"; | 35 const char kTransportName1[] = "tr1"; |
33 const char kTransportName2[] = "tr2"; | 36 const char kTransportName2[] = "tr2"; |
34 | 37 |
35 const char kTestConfig[] = ""; | 38 const char kTestConfig[] = ""; |
36 | 39 |
37 // Send 10 packets 10 bytes each. Packets are sent with 10ms delay | 40 // Send 10 packets 10 bytes each. Packets are sent with 10ms delay |
38 // between packets (about 100 ms for 10 messages). | 41 // between packets (about 100 ms for 10 messages). |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
476 &TcpChannelTester::StartRead)) | 479 &TcpChannelTester::StartRead)) |
477 .RetiresOnSaturation(); | 480 .RetiresOnSaturation(); |
478 | 481 |
479 message_loop_.PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask(), | 482 message_loop_.PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask(), |
480 TestTimeouts::action_max_timeout_ms()); | 483 TestTimeouts::action_max_timeout_ms()); |
481 | 484 |
482 channel_tester->Init(); | 485 channel_tester->Init(); |
483 message_loop_.Run(); | 486 message_loop_.Run(); |
484 channel_tester->CheckResults(); | 487 channel_tester->CheckResults(); |
485 } | 488 } |
489 | |
490 } // namespace content | |
OLD | NEW |