OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "modules/websockets/WebSocketExtensionDispatcher.h" | 27 #include "modules/websockets/WebSocketExtensionDispatcher.h" |
28 | 28 |
29 #include "modules/websockets/WebSocketExtensionParser.h" | 29 #include "modules/websockets/WebSocketExtensionParser.h" |
30 #include "modules/websockets/WebSocketExtensionProcessor.h" | 30 #include "modules/websockets/WebSocketExtensionProcessor.h" |
31 #include "wtf/text/CString.h" | 31 #include "wtf/text/CString.h" |
32 #include "wtf/text/StringHash.h" | 32 #include "wtf/text/StringHash.h" |
33 #include <gtest/gtest.h> | 33 #include <gtest/gtest.h> |
34 | 34 |
35 using namespace blink; | 35 namespace blink { |
36 | |
37 namespace { | 36 namespace { |
38 | 37 |
39 class WebSocketExtensionDispatcherTest; | 38 class WebSocketExtensionDispatcherTest; |
40 | 39 |
41 class MockWebSocketExtensionProcessor FINAL : public WebSocketExtensionProcessor
{ | 40 class MockWebSocketExtensionProcessor FINAL : public WebSocketExtensionProcessor
{ |
42 public: | 41 public: |
43 MockWebSocketExtensionProcessor(const String& name, WebSocketExtensionDispat
cherTest* test) | 42 MockWebSocketExtensionProcessor(const String& name, WebSocketExtensionDispat
cherTest* test) |
44 : WebSocketExtensionProcessor(name) | 43 : WebSocketExtensionProcessor(name) |
45 , m_test(test) | 44 , m_test(test) |
46 { | 45 { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 }; | 173 }; |
175 for (size_t i = 0; i < sizeof(inputs) / sizeof(inputs[0]); ++i) { | 174 for (size_t i = 0; i < sizeof(inputs) / sizeof(inputs[0]); ++i) { |
176 m_extensions.reset(); | 175 m_extensions.reset(); |
177 addMockProcessor("x-foo"); | 176 addMockProcessor("x-foo"); |
178 addMockProcessor("x-bar"); | 177 addMockProcessor("x-bar"); |
179 EXPECT_FALSE(m_extensions.processHeaderValue(inputs[i])); | 178 EXPECT_FALSE(m_extensions.processHeaderValue(inputs[i])); |
180 EXPECT_TRUE(m_extensions.acceptedExtensions().isNull()); | 179 EXPECT_TRUE(m_extensions.acceptedExtensions().isNull()); |
181 } | 180 } |
182 } | 181 } |
183 | 182 |
184 } | 183 } // namespace |
| 184 } // namespace blink |
OLD | NEW |