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

Side by Side Diff: net/url_request/url_request_http_job_unittest.cc

Issue 1701063002: CookieStore: Remove reference counting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@threadsafe
Patch Set: Small fix Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cstddef> 9 #include <cstddef>
10 10
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 537
538 request2->Start(); 538 request2->Start();
539 ASSERT_TRUE(request2->is_pending()); 539 ASSERT_TRUE(request2->is_pending());
540 base::RunLoop().Run(); 540 base::RunLoop().Run();
541 EXPECT_TRUE(request2->was_cached()); 541 EXPECT_TRUE(request2->was_cached());
542 EXPECT_TRUE(request2->status().is_success()); 542 EXPECT_TRUE(request2->status().is_success());
543 EXPECT_EQ(0, delegate2.received_before_network_start_count()); 543 EXPECT_EQ(0, delegate2.received_before_network_start_count());
544 } 544 }
545 545
546 TEST_F(URLRequestHttpJobTest, TestCancelWhileReadingCookies) { 546 TEST_F(URLRequestHttpJobTest, TestCancelWhileReadingCookies) {
547 context_.set_cookie_store(new DelayedCookieMonster()); 547 DelayedCookieMonster cookie_monster;
548 context_.set_cookie_store(&cookie_monster);
Randy Smith (Not in Mondays) 2016/03/01 20:48:43 Same issue mentioned elsewhere about a context raw
mmenke 2016/03/01 22:44:45 What I think is uglier than the lifetime issue her
548 549
549 TestDelegate delegate; 550 TestDelegate delegate;
550 scoped_ptr<URLRequest> request = context_.CreateRequest( 551 scoped_ptr<URLRequest> request = context_.CreateRequest(
551 GURL("http://www.example.com"), DEFAULT_PRIORITY, &delegate); 552 GURL("http://www.example.com"), DEFAULT_PRIORITY, &delegate);
552 553
553 request->Start(); 554 request->Start();
554 request->Cancel(); 555 request->Cancel();
555 base::RunLoop().Run(); 556 base::RunLoop().Run();
556 557
557 DCHECK_EQ(0, delegate.received_before_network_start_count()); 558 DCHECK_EQ(0, delegate.received_before_network_start_count());
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 base::RunLoop().RunUntilIdle(); 936 base::RunLoop().RunUntilIdle();
936 EXPECT_EQ(URLRequestStatus::IO_PENDING, req_->status().status()); 937 EXPECT_EQ(URLRequestStatus::IO_PENDING, req_->status().status());
937 EXPECT_TRUE(fake_handshake_stream->initialize_stream_was_called()); 938 EXPECT_TRUE(fake_handshake_stream->initialize_stream_was_called());
938 } 939 }
939 940
940 #endif // !defined(OS_IOS) 941 #endif // !defined(OS_IOS)
941 942
942 } // namespace 943 } // namespace
943 944
944 } // namespace net 945 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698