OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_deflate_predictor_impl.h" | 5 #include "net/websockets/websocket_deflate_predictor_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "net/websockets/websocket_frame.h" | 10 #include "net/websockets/websocket_frame.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 typedef WebSocketDeflatePredictor::Result Result; | 17 typedef WebSocketDeflatePredictor::Result Result; |
18 | 18 |
19 TEST(WebSocketDeflatePredictorImpl, Predict) { | 19 TEST(WebSocketDeflatePredictorImpl, Predict) { |
20 WebSocketDeflatePredictorImpl predictor; | 20 WebSocketDeflatePredictorImpl predictor; |
21 std::vector<std::unique_ptr<WebSocketFrame>> frames; | 21 std::vector<std::unique_ptr<WebSocketFrame>> frames; |
22 frames.push_back( | 22 frames.push_back( |
23 base::WrapUnique(new WebSocketFrame(WebSocketFrameHeader::kOpCodeText))); | 23 base::MakeUnique<WebSocketFrame>(WebSocketFrameHeader::kOpCodeText)); |
24 Result result = predictor.Predict(frames, 0); | 24 Result result = predictor.Predict(frames, 0); |
25 | 25 |
26 EXPECT_EQ(WebSocketDeflatePredictor::DEFLATE, result); | 26 EXPECT_EQ(WebSocketDeflatePredictor::DEFLATE, result); |
27 } | 27 } |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 } // namespace net | 31 } // namespace net |
OLD | NEW |