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

Side by Side Diff: content/renderer/scheduler/resource_dispatch_throttler_unittest.cc

Issue 1875463002: Remove unused fields from //content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scythe-root
Patch Set: Fixed Ozone build. Created 4 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/renderer/scheduler/resource_dispatch_throttler.h" 5 #include "content/renderer/scheduler/resource_dispatch_throttler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 } 184 }
185 185
186 int last_request_id() const { return last_request_id_; } 186 int last_request_id() const { return last_request_id_; }
187 187
188 ScopedMessages sent_messages_; 188 ScopedMessages sent_messages_;
189 189
190 private: 190 private:
191 std::unique_ptr<ResourceDispatchThrottlerForTest> throttler_; 191 std::unique_ptr<ResourceDispatchThrottlerForTest> throttler_;
192 RendererSchedulerForTest scheduler_; 192 RendererSchedulerForTest scheduler_;
193 int last_request_id_; 193 int last_request_id_;
194 bool flush_scheduled_;
195 194
196 DISALLOW_COPY_AND_ASSIGN(ResourceDispatchThrottlerTest); 195 DISALLOW_COPY_AND_ASSIGN(ResourceDispatchThrottlerTest);
197 }; 196 };
198 197
199 TEST_F(ResourceDispatchThrottlerTest, NotThrottledByDefault) { 198 TEST_F(ResourceDispatchThrottlerTest, NotThrottledByDefault) {
200 SetHighPriorityWorkAnticipated(false); 199 SetHighPriorityWorkAnticipated(false);
201 for (size_t i = 0; i < kRequestsPerFlush * 2; ++i) { 200 for (size_t i = 0; i < kRequestsPerFlush * 2; ++i) {
202 RequestResource(); 201 RequestResource();
203 EXPECT_EQ(i + 1, sent_messages_.size()); 202 EXPECT_EQ(i + 1, sent_messages_.size());
204 } 203 }
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 EXPECT_EQ(priority_msg.type(), ResourceHostMsg_DidChangePriority::ID); 404 EXPECT_EQ(priority_msg.type(), ResourceHostMsg_DidChangePriority::ID);
406 EXPECT_EQ(cancel_msg.type(), ResourceHostMsg_CancelRequest::ID); 405 EXPECT_EQ(cancel_msg.type(), ResourceHostMsg_CancelRequest::ID);
407 406
408 EXPECT_EQ(GetRequestId(request_msg), GetRequestId(priority_msg)); 407 EXPECT_EQ(GetRequestId(request_msg), GetRequestId(priority_msg));
409 EXPECT_EQ(GetRequestId(request_msg) - 1, GetRequestId(cancel_msg)); 408 EXPECT_EQ(GetRequestId(request_msg) - 1, GetRequestId(cancel_msg));
410 } 409 }
411 EXPECT_FALSE(FlushScheduled()); 410 EXPECT_FALSE(FlushScheduled());
412 } 411 }
413 412
414 } // namespace content 413 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698