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

Side by Side Diff: content/browser/loader/resource_buffer_unittest.cc

Issue 11414299: Add content/browser/loader/ for resource loading related classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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 // 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 "content/browser/renderer_host/resource_buffer.h" 5 #include "content/browser/loader/resource_buffer.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 namespace content { 8 namespace content {
9 9
10 TEST(ResourceBufferTest, BasicAllocations) { 10 TEST(ResourceBufferTest, BasicAllocations) {
11 scoped_refptr<ResourceBuffer> buf = new ResourceBuffer(); 11 scoped_refptr<ResourceBuffer> buf = new ResourceBuffer();
12 EXPECT_TRUE(buf->Initialize(100, 5, 10)); 12 EXPECT_TRUE(buf->Initialize(100, 5, 10));
13 EXPECT_TRUE(buf->CanAllocate()); 13 EXPECT_TRUE(buf->CanAllocate());
14 14
15 // First allocation 15 // First allocation
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 // Full. 129 // Full.
130 EXPECT_FALSE(buf->CanAllocate()); 130 EXPECT_FALSE(buf->CanAllocate());
131 131
132 // Still full, even if there is a small hole at the end. 132 // Still full, even if there is a small hole at the end.
133 buf->ShrinkLastAllocation(5); 133 buf->ShrinkLastAllocation(5);
134 EXPECT_FALSE(buf->CanAllocate()); 134 EXPECT_FALSE(buf->CanAllocate());
135 } 135 }
136 136
137 } // namespace content 137 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/resource_buffer.cc ('k') | content/browser/loader/resource_dispatcher_host_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698