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

Unified Diff: net/spdy/array_output_buffer_test.cc

Issue 2832973003: Split net/spdy into core and chromium subdirectories. (Closed)
Patch Set: Fix some more build rules. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/array_output_buffer.cc ('k') | net/spdy/bidirectional_stream_spdy_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/array_output_buffer_test.cc
diff --git a/net/spdy/array_output_buffer_test.cc b/net/spdy/array_output_buffer_test.cc
deleted file mode 100644
index 4dedce7fca40c40ca7ff4f4db5443b6955e28c7c..0000000000000000000000000000000000000000
--- a/net/spdy/array_output_buffer_test.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/spdy/array_output_buffer.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace net {
-namespace test {
-
-// This test verifies that ArrayOutputBuffer is initialized properly.
-TEST(ArrayOutputBufferTest, InitializedFromArray) {
- char array[100];
- ArrayOutputBuffer buffer(array, sizeof(array));
- EXPECT_EQ(sizeof(array), buffer.BytesFree());
- EXPECT_EQ((uint64_t)0, buffer.Size());
- EXPECT_EQ(array, buffer.Begin());
-}
-
-// This test verifies that Reset() causes an ArrayOutputBuffer's capacity and
-// size to be reset to the initial state.
-TEST(ArrayOutputBufferTest, WriteAndReset) {
- char array[100];
- ArrayOutputBuffer buffer(array, sizeof(array));
-
- // Let's write some bytes.
- char* dst;
- int size;
- buffer.Next(&dst, &size);
- ASSERT_GT(size, 1);
- ASSERT_NE(nullptr, dst);
- const int64_t written = size / 2;
- memset(dst, 'x', written);
- buffer.AdvanceWritePtr(written);
-
- // The buffer should be partially used.
- EXPECT_EQ((uint64_t)size - written, buffer.BytesFree());
- EXPECT_EQ((uint64_t)written, buffer.Size());
-
- buffer.Reset();
-
- // After a reset, the buffer should regain its full capacity.
- EXPECT_EQ(sizeof(array), buffer.BytesFree());
- EXPECT_EQ((uint64_t)0, buffer.Size());
-}
-
-} // namespace test
-} // namespace net
« no previous file with comments | « net/spdy/array_output_buffer.cc ('k') | net/spdy/bidirectional_stream_spdy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698