OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "net/base/completion_callback.h" | 9 #include "net/base/completion_callback.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
11 #include "net/base/mock_host_resolver.h" | 11 #include "net/base/mock_host_resolver.h" |
12 #include "net/base/test_completion_callback.h" | 12 #include "net/base/test_completion_callback.h" |
13 #include "net/socket/socket_test_util.h" | 13 #include "net/socket/socket_test_util.h" |
14 #include "net/url_request/url_request_unittest.h" | 14 #include "net/url_request/url_request_test_util.h" |
15 #include "net/websockets/websocket.h" | 15 #include "net/websockets/websocket.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
18 #include "testing/platform_test.h" | 18 #include "testing/platform_test.h" |
19 | 19 |
20 struct WebSocketEvent { | 20 struct WebSocketEvent { |
21 enum EventType { | 21 enum EventType { |
22 EVENT_OPEN, EVENT_MESSAGE, EVENT_ERROR, EVENT_CLOSE, | 22 EVENT_OPEN, EVENT_MESSAGE, EVENT_ERROR, EVENT_CLOSE, |
23 }; | 23 }; |
24 | 24 |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 EXPECT_EQ(1U, events.size()); | 345 EXPECT_EQ(1U, events.size()); |
346 | 346 |
347 EXPECT_EQ(WebSocketEvent::EVENT_MESSAGE, events[0].event_type); | 347 EXPECT_EQ(WebSocketEvent::EVENT_MESSAGE, events[0].event_type); |
348 EXPECT_EQ(kExpectedMsg, events[0].msg); | 348 EXPECT_EQ(kExpectedMsg, events[0].msg); |
349 } | 349 } |
350 | 350 |
351 websocket->DetachDelegate(); | 351 websocket->DetachDelegate(); |
352 } | 352 } |
353 | 353 |
354 } // namespace net | 354 } // namespace net |
OLD | NEW |