OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/websockets/websocket_frame.h" | 5 #include "net/websockets/websocket_frame.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/memory/aligned_memory.h" | 14 #include "base/memory/aligned_memory.h" |
15 #include "base/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
17 #include "base/time.h" | 17 #include "base/time.h" |
18 #include "net/base/net_errors.h" | 18 #include "net/base/net_errors.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 | 20 |
21 // Run | 21 // Run |
22 // out/Release/net_unittests --websocket-mask-iterations=100000 | 22 // out/Release/net_unittests --websocket-mask-iterations=100000 |
23 // --gtest_filter='WebSocketFrameTestMaskBenchmark.*' | 23 // --gtest_filter='WebSocketFrameTestMaskBenchmark.*' |
24 // to benchmark the MaskWebSocketFramePayload() function. | 24 // to benchmark the MaskWebSocketFramePayload() function. |
25 static const char kBenchmarkIterations[] = "websocket-mask-iterations"; | 25 static const char kBenchmarkIterations[] = "websocket-mask-iterations"; |
26 static const int kDefaultIterations = 10; | 26 static const int kDefaultIterations = 10; |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 // Check that opcodes with the 4 bit set return false | 453 // Check that opcodes with the 4 bit set return false |
454 EXPECT_FALSE(Frame::IsKnownControlOpCode(0x6)); | 454 EXPECT_FALSE(Frame::IsKnownControlOpCode(0x6)); |
455 EXPECT_FALSE(Frame::IsKnownControlOpCode(0xF)); | 455 EXPECT_FALSE(Frame::IsKnownControlOpCode(0xF)); |
456 | 456 |
457 // Check that out-of-range opcodes return false | 457 // Check that out-of-range opcodes return false |
458 EXPECT_FALSE(Frame::IsKnownControlOpCode(-1)); | 458 EXPECT_FALSE(Frame::IsKnownControlOpCode(-1)); |
459 EXPECT_FALSE(Frame::IsKnownControlOpCode(0xFF)); | 459 EXPECT_FALSE(Frame::IsKnownControlOpCode(0xFF)); |
460 } | 460 } |
461 | 461 |
462 } // namespace net | 462 } // namespace net |
OLD | NEW |