blob: d7e45ca92fae8fcf810ae2191671b58a88889167 [file] [log] [blame]
ricea11bdcd02014-11-20 09:57:071// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "net/websockets/websocket_handshake_challenge.h"
6
7#include <string>
8
9#include "testing/gtest/include/gtest/gtest.h"
10
11namespace net {
12
13namespace {
14
15// Test the example challenge from the RFC6455.
16TEST(WebSocketHandshakeChallengeTest, RFC6455) {
17 const std::string key = "dGhlIHNhbXBsZSBub25jZQ==";
18 std::string accept = ComputeSecWebSocketAccept(key);
19 EXPECT_EQ("s3pPLMBiTxaQ9kYGzzhZRbK+xOo=", accept);
20}
21
22} // namespace
23
24} // namespace net