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

Unified Diff: net/spdy/write_blocked_list_test.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/write_blocked_list.h ('k') | net/ssl/channel_id_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/write_blocked_list_test.cc
diff --git a/net/spdy/write_blocked_list_test.cc b/net/spdy/write_blocked_list_test.cc
deleted file mode 100644
index edb309e818b1b82d385bebcd046049821436bb43..0000000000000000000000000000000000000000
--- a/net/spdy/write_blocked_list_test.cc
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright 2013 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/write_blocked_list.h"
-
-#include <deque>
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace {
-
-class WriteBlockedListPeer {
- public:
- static std::deque<int>* GetWriteBlockedList(
- int i,
- net::WriteBlockedList<int>* list) {
- return &list->write_blocked_lists_[i];
- }
-};
-
-} // namespace
-
-namespace net {
-namespace test {
-namespace {
-typedef WriteBlockedList<int> IntWriteBlockedList;
-
-TEST(WriteBlockedListTest, GetHighestPriority) {
- IntWriteBlockedList list;
- EXPECT_FALSE(list.HasWriteBlockedStreams());
- list.PushBack(1, 1);
- EXPECT_TRUE(list.HasWriteBlockedStreams());
- EXPECT_EQ(1, list.GetHighestPriorityWriteBlockedList());
- list.PushBack(1, 0);
- EXPECT_TRUE(list.HasWriteBlockedStreams());
- EXPECT_EQ(0, list.GetHighestPriorityWriteBlockedList());
-}
-
-TEST(WriteBlockedListTest, HasWriteBlockedStreamsOfGreaterThanPriority) {
- IntWriteBlockedList list;
- list.PushBack(1, 4);
- EXPECT_TRUE(list.HasWriteBlockedStreamsGreaterThanPriority(5));
- EXPECT_FALSE(list.HasWriteBlockedStreamsGreaterThanPriority(4));
- list.PushBack(1, 2);
- EXPECT_TRUE(list.HasWriteBlockedStreamsGreaterThanPriority(3));
- EXPECT_FALSE(list.HasWriteBlockedStreamsGreaterThanPriority(2));
-}
-
-TEST(WriteBlockedListTest, RemoveStreamFromWriteBlockedList) {
- IntWriteBlockedList list;
-
- list.PushBack(1, 4);
- EXPECT_TRUE(list.HasWriteBlockedStreams());
-
- list.RemoveStreamFromWriteBlockedList(1, 5);
- EXPECT_TRUE(list.HasWriteBlockedStreams());
-
- list.PushBack(2, 4);
- list.PushBack(1, 4);
- list.RemoveStreamFromWriteBlockedList(1, 4);
- list.RemoveStreamFromWriteBlockedList(2, 4);
- EXPECT_FALSE(list.HasWriteBlockedStreams());
-
- list.PushBack(1, 7);
- EXPECT_TRUE(list.HasWriteBlockedStreams());
-}
-
-TEST(WriteBlockedListTest, PopFront) {
- IntWriteBlockedList list;
-
- list.PushBack(1, 4);
- EXPECT_EQ(1u, list.NumBlockedStreams());
- list.PushBack(2, 4);
- list.PushBack(1, 4);
- list.PushBack(3, 4);
- EXPECT_EQ(4u, list.NumBlockedStreams());
-
- EXPECT_EQ(1, list.PopFront(4));
- EXPECT_EQ(2, list.PopFront(4));
- EXPECT_EQ(1, list.PopFront(4));
- EXPECT_EQ(1u, list.NumBlockedStreams());
- EXPECT_EQ(3, list.PopFront(4));
-}
-
-TEST(WriteBlockedListTest, UpdateStreamPriorityInWriteBlockedList) {
- IntWriteBlockedList list;
-
- list.PushBack(1, 1);
- list.PushBack(2, 2);
- list.PushBack(3, 3);
- list.PushBack(1, 3);
- list.PushBack(1, 3);
- EXPECT_EQ(5u, list.NumBlockedStreams());
- EXPECT_EQ(1u, WriteBlockedListPeer::GetWriteBlockedList(1, &list)->size());
- EXPECT_EQ(1u, WriteBlockedListPeer::GetWriteBlockedList(2, &list)->size());
- EXPECT_EQ(3u, WriteBlockedListPeer::GetWriteBlockedList(3, &list)->size());
-
- list.UpdateStreamPriorityInWriteBlockedList(1, 1, 2);
- EXPECT_EQ(0u, WriteBlockedListPeer::GetWriteBlockedList(1, &list)->size());
- EXPECT_EQ(2u, WriteBlockedListPeer::GetWriteBlockedList(2, &list)->size());
- list.UpdateStreamPriorityInWriteBlockedList(3, 3, 1);
- EXPECT_EQ(1u, WriteBlockedListPeer::GetWriteBlockedList(1, &list)->size());
- EXPECT_EQ(2u, WriteBlockedListPeer::GetWriteBlockedList(3, &list)->size());
-
- // Redundant update.
- list.UpdateStreamPriorityInWriteBlockedList(1, 3, 3);
- EXPECT_EQ(2u, WriteBlockedListPeer::GetWriteBlockedList(3, &list)->size());
-
- // No entries for given stream_id / old_priority pair.
- list.UpdateStreamPriorityInWriteBlockedList(4, 4, 1);
- EXPECT_EQ(1u, WriteBlockedListPeer::GetWriteBlockedList(1, &list)->size());
- EXPECT_EQ(2u, WriteBlockedListPeer::GetWriteBlockedList(2, &list)->size());
- EXPECT_EQ(0u, WriteBlockedListPeer::GetWriteBlockedList(4, &list)->size());
-
- // Update multiple entries.
- list.UpdateStreamPriorityInWriteBlockedList(1, 3, 4);
- EXPECT_EQ(0u, WriteBlockedListPeer::GetWriteBlockedList(3, &list)->size());
- EXPECT_EQ(1u, WriteBlockedListPeer::GetWriteBlockedList(4, &list)->size());
-
- EXPECT_EQ(3, list.PopFront(1));
- EXPECT_EQ(2, list.PopFront(2));
- EXPECT_EQ(1, list.PopFront(2));
- EXPECT_EQ(1, list.PopFront(4));
- EXPECT_EQ(0u, list.NumBlockedStreams());
-}
-
-} // namespace
-} // namespace test
-} // namespace net
« no previous file with comments | « net/spdy/write_blocked_list.h ('k') | net/ssl/channel_id_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698