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

Side by Side Diff: headless/public/util/deterministic_dispatcher_test.cc

Issue 2494683005: Fix bug where DeterministicDispatcher CHECKed for killed jobs (Closed)
Patch Set: Created 4 years, 1 month 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "headless/public/util/deterministic_dispatcher.h" 5 #include "headless/public/util/deterministic_dispatcher.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 base::RunLoop().RunUntilIdle(); 103 base::RunLoop().RunUntilIdle();
104 EXPECT_THAT(notifications, 104 EXPECT_THAT(notifications,
105 ElementsAre("id: 1 OK", "id: 2 OK", "id: 3 err: -123")); 105 ElementsAre("id: 1 OK", "id: 2 OK", "id: 3 err: -123"));
106 106
107 job3.reset(); 107 job3.reset();
108 base::RunLoop().RunUntilIdle(); 108 base::RunLoop().RunUntilIdle();
109 EXPECT_THAT(notifications, ElementsAre("id: 1 OK", "id: 2 OK", 109 EXPECT_THAT(notifications, ElementsAre("id: 1 OK", "id: 2 OK",
110 "id: 3 err: -123", "id: 4 OK")); 110 "id: 3 err: -123", "id: 4 OK"));
111 } 111 }
112 112
113 TEST_F(DeterministicDispatcherTest, JobKilled) {
114 std::vector<std::string> notifications;
115 {
116 std::unique_ptr<FakeManagedDispatchURLRequestJob> job(
117 new FakeManagedDispatchURLRequestJob(deterministic_dispatcher_.get(), 1,
118 &notifications));
119
120 job->Kill();
121 }
122
123 EXPECT_TRUE(notifications.empty());
124
125 base::RunLoop().RunUntilIdle();
126 EXPECT_TRUE(notifications.empty());
127 }
128
113 } // namespace headless 129 } // namespace headless
OLDNEW
« no previous file with comments | « headless/public/util/deterministic_dispatcher.cc ('k') | headless/public/util/testing/fake_managed_dispatch_url_request_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698