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

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: Remove ResumeAfterDelay Created 4 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 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 e6a37d10462f1e408643c32f2fea96a228955f52..96dc2476f8bd63cc16f06f9e0bc6091c689fb76f 100644
--- a/net/http/http_stream_factory_impl_request_unittest.cc
+++ b/net/http/http_stream_factory_impl_request_unittest.cc
@@ -105,6 +105,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);
@@ -115,17 +116,18 @@ TEST_P(HttpStreamFactoryImplRequestTest, DelayMainJob) {
job_controller->alternative_job_.reset(alternative_job);
job_controller->AttachJob(alternative_job);
- job->WaitFor(alternative_job);
+ job_controller->main_job_is_blocked_ = 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->set_wait_time_for_main_job(delay);
+ job_controller->MaybeResumeMainJob(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->wait_time_for_main_job());
+ EXPECT_TRUE(!job_controller->main_job_is_blocked());
// Start the |job| and verify |job|'s |wait_time_| is cleared.
job->Start(request.stream_type());
@@ -133,8 +135,8 @@ TEST_P(HttpStreamFactoryImplRequestTest, DelayMainJob) {
base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(wait_time + 1));
base::RunLoop().RunUntilIdle();
- EXPECT_NE(delay, job->wait_time_);
- EXPECT_TRUE(job->wait_time_.is_zero());
+ EXPECT_NE(delay, job_controller->wait_time_for_main_job());
+ EXPECT_TRUE(job_controller->wait_time_for_main_job().is_zero());
EXPECT_EQ(HttpStreamFactoryImpl::Job::STATE_INIT_CONNECTION_COMPLETE,
job->next_state_);
}

Powered by Google App Engine
This is Rietveld 408576698