Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Side by Side Diff: Source/modules/websockets/WebSocketDeflaterTest.cpp

Issue 454353002: Cleanup namespace usage in modules/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 11 matching lines...) Expand all
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "config.h" 26 #include "config.h"
27 #include "modules/websockets/WebSocketDeflater.h" 27 #include "modules/websockets/WebSocketDeflater.h"
28 28
29 #include "wtf/Vector.h" 29 #include "wtf/Vector.h"
30 #include <gtest/gtest.h> 30 #include <gtest/gtest.h>
31 31
32 using namespace blink; 32 namespace blink {
33
34 namespace { 33 namespace {
35 34
36 TEST(WebSocketDeflaterTest, TestCompressHello) 35 TEST(WebSocketDeflaterTest, TestCompressHello)
37 { 36 {
38 // Test the first example on section 4.3 of the specification. 37 // Test the first example on section 4.3 of the specification.
39 OwnPtr<WebSocketDeflater> deflater = WebSocketDeflater::create(15); 38 OwnPtr<WebSocketDeflater> deflater = WebSocketDeflater::create(15);
40 ASSERT_TRUE(deflater->initialize()); 39 ASSERT_TRUE(deflater->initialize());
41 OwnPtr<WebSocketInflater> inflater = WebSocketInflater::create(); 40 OwnPtr<WebSocketInflater> inflater = WebSocketInflater::create();
42 ASSERT_TRUE(inflater->initialize()); 41 ASSERT_TRUE(inflater->initialize());
43 const char* inputData = "Hello"; 42 const char* inputData = "Hello";
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 inputData.fill('a'); 145 inputData.fill('a');
147 146
148 ASSERT_TRUE(deflater->addBytes(inputData.data(), inputData.size())); 147 ASSERT_TRUE(deflater->addBytes(inputData.data(), inputData.size()));
149 ASSERT_TRUE(deflater->finish()); 148 ASSERT_TRUE(deflater->finish());
150 ASSERT_TRUE(inflater->addBytes(deflater->data(), deflater->size())); 149 ASSERT_TRUE(inflater->addBytes(deflater->data(), deflater->size()));
151 ASSERT_TRUE(inflater->finish()); 150 ASSERT_TRUE(inflater->finish());
152 EXPECT_EQ(inputData.size(), inflater->size()); 151 EXPECT_EQ(inputData.size(), inflater->size());
153 EXPECT_EQ(0, memcmp(inputData.data(), inflater->data(), inflater->size())); 152 EXPECT_EQ(0, memcmp(inputData.data(), inflater->data(), inflater->size()));
154 } 153 }
155 154
156 } 155 } // namespace
156 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698