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 19 matching lines...) Expand all Loading... |
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 namespace blink { | 35 namespace blink { |
36 namespace { | 36 namespace { |
37 | 37 |
38 class WebSocketExtensionDispatcherTest; | 38 class WebSocketExtensionDispatcherTest; |
39 | 39 |
40 class MockWebSocketExtensionProcessor FINAL : public WebSocketExtensionProcessor
{ | 40 class MockWebSocketExtensionProcessor final : public WebSocketExtensionProcessor
{ |
41 public: | 41 public: |
42 MockWebSocketExtensionProcessor(const String& name, WebSocketExtensionDispat
cherTest* test) | 42 MockWebSocketExtensionProcessor(const String& name, WebSocketExtensionDispat
cherTest* test) |
43 : WebSocketExtensionProcessor(name) | 43 : WebSocketExtensionProcessor(name) |
44 , m_test(test) | 44 , m_test(test) |
45 { | 45 { |
46 } | 46 } |
47 virtual String handshakeString() OVERRIDE { return extensionToken(); } | 47 virtual String handshakeString() override { return extensionToken(); } |
48 virtual bool processResponse(const HashMap<String, String>&) OVERRIDE; | 48 virtual bool processResponse(const HashMap<String, String>&) override; |
49 | 49 |
50 private: | 50 private: |
51 WebSocketExtensionDispatcherTest* m_test; | 51 WebSocketExtensionDispatcherTest* m_test; |
52 }; | 52 }; |
53 | 53 |
54 class WebSocketExtensionDispatcherTest : public testing::Test { | 54 class WebSocketExtensionDispatcherTest : public testing::Test { |
55 public: | 55 public: |
56 WebSocketExtensionDispatcherTest() { } | 56 WebSocketExtensionDispatcherTest() { } |
57 | 57 |
58 void SetUp() { } | 58 void SetUp() { } |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 m_extensions.reset(); | 175 m_extensions.reset(); |
176 addMockProcessor("x-foo"); | 176 addMockProcessor("x-foo"); |
177 addMockProcessor("x-bar"); | 177 addMockProcessor("x-bar"); |
178 EXPECT_FALSE(m_extensions.processHeaderValue(inputs[i])); | 178 EXPECT_FALSE(m_extensions.processHeaderValue(inputs[i])); |
179 EXPECT_TRUE(m_extensions.acceptedExtensions().isNull()); | 179 EXPECT_TRUE(m_extensions.acceptedExtensions().isNull()); |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 } // namespace | 183 } // namespace |
184 } // namespace blink | 184 } // namespace blink |
OLD | NEW |