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

Unified Diff: net/http/http_stream_factory_impl_request_unittest.cc

Issue 1952423002: JobController 2: Remove reference between HttpStreamFactoryImpl::Jobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Job_Controller_1
Patch Set: move DoWaitForJob back, resume Job after delay in JobController Created 4 years, 7 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
Index: net/http/http_stream_factory_impl_request_unittest.cc
diff --git a/net/http/http_stream_factory_impl_request_unittest.cc b/net/http/http_stream_factory_impl_request_unittest.cc
index d0b71d7dd4af843ccec211d3ba2e4ffa67f5bafd..a3eab8138a7fbe7f3adeca84e41e34bc5872ba01 100644
--- a/net/http/http_stream_factory_impl_request_unittest.cc
+++ b/net/http/http_stream_factory_impl_request_unittest.cc
@@ -99,6 +99,7 @@ TEST_P(HttpStreamFactoryImplRequestTest, SetPriority) {
nullptr);
job_controller->main_job_.reset(job);
job_controller->AttachJob(job);
+
EXPECT_EQ(DEFAULT_PRIORITY, job->priority());
request.SetPriority(MEDIUM);
@@ -149,6 +150,7 @@ TEST_P(HttpStreamFactoryImplRequestTest, DelayMainJob) {
nullptr);
job_controller->main_job_.reset(job);
job_controller->AttachJob(job);
+
EXPECT_EQ(DEFAULT_PRIORITY, job->priority());
AlternativeService alternative_service(net::NPN_HTTP_2, server);
@@ -159,17 +161,17 @@ TEST_P(HttpStreamFactoryImplRequestTest, DelayMainJob) {
job_controller->alternative_job_.reset(alternative_job);
job_controller->AttachJob(alternative_job);
- job->WaitFor(alternative_job);
+ job_controller->blocking_ = true;
EXPECT_EQ(HttpStreamFactoryImpl::Job::STATE_NONE, job->next_state_);
// Test |alternative_job| resuming the |job| after delay.
int wait_time = 1;
base::TimeDelta delay = base::TimeDelta::FromMilliseconds(wait_time);
- job->Resume(alternative_job, delay);
+ job_controller->MaybeResumeOtherJob(alternative_job, delay);
- // Verify |job| has |wait_time_| and there is no |blocking_job_|
- EXPECT_EQ(delay, job->wait_time_);
- EXPECT_TRUE(!job->blocking_job_);
+ // Verify |job| has |wait_time_| and there is no blocking job.
+ EXPECT_EQ(delay, job_controller->GetWaitTime());
+ EXPECT_TRUE(!job_controller->blocking());
// Start the |job| and verify |job|'s |wait_time_| is cleared.
job->Start(request.stream_type());
@@ -177,8 +179,8 @@ TEST_P(HttpStreamFactoryImplRequestTest, DelayMainJob) {
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(wait_time + 1));
base::MessageLoop::current()->RunUntilIdle();
- EXPECT_NE(delay, job->wait_time_);
- EXPECT_TRUE(job->wait_time_.is_zero());
+ EXPECT_NE(delay, job_controller->GetWaitTime());
+ EXPECT_TRUE(job_controller->GetWaitTime().is_zero());
EXPECT_EQ(HttpStreamFactoryImpl::Job::STATE_INIT_CONNECTION_COMPLETE,
job->next_state_);
}

Powered by Google App Engine
This is Rietveld 408576698