| 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 20 matching lines...) Expand all Loading... |
| 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 WebCore; | 35 using namespace WebCore; |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 | 38 |
| 39 class WebSocketExtensionDispatcherTest; | 39 class WebSocketExtensionDispatcherTest; |
| 40 | 40 |
| 41 class MockWebSocketExtensionProcessor : public WebSocketExtensionProcessor { | 41 class MockWebSocketExtensionProcessor FINAL : public WebSocketExtensionProcessor
{ |
| 42 public: | 42 public: |
| 43 MockWebSocketExtensionProcessor(const String& name, WebSocketExtensionDispat
cherTest* test) | 43 MockWebSocketExtensionProcessor(const String& name, WebSocketExtensionDispat
cherTest* test) |
| 44 : WebSocketExtensionProcessor(name) | 44 : WebSocketExtensionProcessor(name) |
| 45 , m_test(test) | 45 , m_test(test) |
| 46 { | 46 { |
| 47 } | 47 } |
| 48 virtual String handshakeString() OVERRIDE { return extensionToken(); } | 48 virtual String handshakeString() OVERRIDE { return extensionToken(); } |
| 49 virtual bool processResponse(const HashMap<String, String>&) OVERRIDE; | 49 virtual bool processResponse(const HashMap<String, String>&) OVERRIDE; |
| 50 | 50 |
| 51 private: | 51 private: |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 for (size_t i = 0; i < sizeof(inputs) / sizeof(inputs[0]); ++i) { | 175 for (size_t i = 0; i < sizeof(inputs) / sizeof(inputs[0]); ++i) { |
| 176 m_extensions.reset(); | 176 m_extensions.reset(); |
| 177 addMockProcessor("x-foo"); | 177 addMockProcessor("x-foo"); |
| 178 addMockProcessor("x-bar"); | 178 addMockProcessor("x-bar"); |
| 179 EXPECT_FALSE(m_extensions.processHeaderValue(inputs[i])); | 179 EXPECT_FALSE(m_extensions.processHeaderValue(inputs[i])); |
| 180 EXPECT_TRUE(m_extensions.acceptedExtensions().isNull()); | 180 EXPECT_TRUE(m_extensions.acceptedExtensions().isNull()); |
| 181 } | 181 } |
| 182 } | 182 } |
| 183 | 183 |
| 184 } | 184 } |
| OLD | NEW |