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

Side by Side Diff: net/http/http_cache_unittest.cc

Issue 16226028: Fix even more remaining uses of WeakPtr<T>'s operator T* conversion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
« no previous file with comments | « gpu/command_buffer/service/context_group.cc ('k') | net/spdy/spdy_write_queue.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "net/http/http_cache.h" 5 #include "net/http/http_cache.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 5907 matching lines...) Expand 10 before | Expand all | Expand 10 after
5918 MockHttpCache cache; 5918 MockHttpCache cache;
5919 5919
5920 scoped_ptr<net::HttpTransaction> trans; 5920 scoped_ptr<net::HttpTransaction> trans;
5921 EXPECT_EQ(net::OK, cache.http_cache()->CreateTransaction( 5921 EXPECT_EQ(net::OK, cache.http_cache()->CreateTransaction(
5922 net::IDLE, &trans, NULL)); 5922 net::IDLE, &trans, NULL));
5923 ASSERT_TRUE(trans.get()); 5923 ASSERT_TRUE(trans.get());
5924 5924
5925 // Shouldn't crash, but doesn't do anything either. 5925 // Shouldn't crash, but doesn't do anything either.
5926 trans->SetPriority(net::LOW); 5926 trans->SetPriority(net::LOW);
5927 5927
5928 EXPECT_FALSE(cache.network_layer()->last_transaction()); 5928 EXPECT_FALSE(cache.network_layer()->last_transaction().get());
5929 EXPECT_EQ(net::DEFAULT_PRIORITY, 5929 EXPECT_EQ(net::DEFAULT_PRIORITY,
5930 cache.network_layer()->last_create_transaction_priority()); 5930 cache.network_layer()->last_create_transaction_priority());
5931 5931
5932 net::HttpRequestInfo info; 5932 net::HttpRequestInfo info;
5933 info.url = GURL(kSimpleGET_Transaction.url); 5933 info.url = GURL(kSimpleGET_Transaction.url);
5934 net::TestCompletionCallback callback; 5934 net::TestCompletionCallback callback;
5935 EXPECT_EQ(net::ERR_IO_PENDING, 5935 EXPECT_EQ(net::ERR_IO_PENDING,
5936 trans->Start(&info, callback.callback(), net::BoundNetLog())); 5936 trans->Start(&info, callback.callback(), net::BoundNetLog()));
5937 5937
5938 ASSERT_TRUE(cache.network_layer()->last_transaction()); 5938 ASSERT_TRUE(cache.network_layer()->last_transaction().get());
5939 EXPECT_EQ(net::LOW, 5939 EXPECT_EQ(net::LOW,
5940 cache.network_layer()->last_create_transaction_priority()); 5940 cache.network_layer()->last_create_transaction_priority());
5941 EXPECT_EQ(net::LOW, 5941 EXPECT_EQ(net::LOW,
5942 cache.network_layer()->last_transaction()->priority()); 5942 cache.network_layer()->last_transaction()->priority());
5943 5943
5944 trans->SetPriority(net::HIGHEST); 5944 trans->SetPriority(net::HIGHEST);
5945 EXPECT_EQ(net::LOW, 5945 EXPECT_EQ(net::LOW,
5946 cache.network_layer()->last_create_transaction_priority()); 5946 cache.network_layer()->last_create_transaction_priority());
5947 EXPECT_EQ(net::HIGHEST, 5947 EXPECT_EQ(net::HIGHEST,
5948 cache.network_layer()->last_transaction()->priority()); 5948 cache.network_layer()->last_transaction()->priority());
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
5989 trans->SetPriority(net::HIGHEST); 5989 trans->SetPriority(net::HIGHEST);
5990 // Should trigger a new network transaction and pick up the new 5990 // Should trigger a new network transaction and pick up the new
5991 // priority. 5991 // priority.
5992 ReadAndVerifyTransaction(trans.get(), transaction); 5992 ReadAndVerifyTransaction(trans.get(), transaction);
5993 5993
5994 EXPECT_EQ(net::HIGHEST, 5994 EXPECT_EQ(net::HIGHEST,
5995 cache.network_layer()->last_create_transaction_priority()); 5995 cache.network_layer()->last_create_transaction_priority());
5996 5996
5997 RemoveMockTransaction(&kRangeGET_TransactionOK); 5997 RemoveMockTransaction(&kRangeGET_TransactionOK);
5998 } 5998 }
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/context_group.cc ('k') | net/spdy/spdy_write_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698