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

Unified Diff: components/offline_pages/background/request_coordinator_unittest.cc

Issue 2395903002: API changes to support suspending requests (Closed)
Patch Set: Keep the JS with a boolean instead of forcing a double. Created 4 years, 2 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
« no previous file with comments | « components/offline_pages/background/request_coordinator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/background/request_coordinator_unittest.cc
diff --git a/components/offline_pages/background/request_coordinator_unittest.cc b/components/offline_pages/background/request_coordinator_unittest.cc
index 11cd76855e29238678c673c8345ecd41d18fc84f..b1b1f929d7918bb61cf407f44f8344b7483da8a6 100644
--- a/components/offline_pages/background/request_coordinator_unittest.cc
+++ b/components/offline_pages/background/request_coordinator_unittest.cc
@@ -401,7 +401,10 @@ TEST_F(RequestCoordinatorTest, StartProcessingWithNoRequests) {
TEST_F(RequestCoordinatorTest, StartProcessingWithRequestInProgress) {
// Put the request on the queue.
- EXPECT_TRUE(coordinator()->SavePageLater(kUrl1, kClientId1, kUserRequested));
+ EXPECT_TRUE(
+ coordinator()->SavePageLater(
+ kUrl1, kClientId1, kUserRequested,
+ RequestCoordinator::RequestAvailability::ENABLED_FOR_OFFLINER) != 0);
// Set up for the call to StartProcessing by building arguments.
DeviceConditions device_conditions(
@@ -424,7 +427,10 @@ TEST_F(RequestCoordinatorTest, StartProcessingWithRequestInProgress) {
}
TEST_F(RequestCoordinatorTest, SavePageLater) {
- EXPECT_TRUE(coordinator()->SavePageLater(kUrl1, kClientId1, kUserRequested));
+ EXPECT_TRUE(
+ coordinator()->SavePageLater(
+ kUrl1, kClientId1, kUserRequested,
+ RequestCoordinator::RequestAvailability::ENABLED_FOR_OFFLINER) != 0);
// Expect that a request got placed on the queue.
coordinator()->queue()->GetRequests(
@@ -1030,7 +1036,10 @@ TEST_F(RequestCoordinatorTest,
SavePageStartsProcessingWhenConnectedAndNotLowEndDevice) {
SetEffectiveConnectionTypeForTest(
net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_3G);
- EXPECT_TRUE(coordinator()->SavePageLater(kUrl1, kClientId1, kUserRequested));
+ EXPECT_TRUE(
+ coordinator()->SavePageLater(
+ kUrl1, kClientId1, kUserRequested,
+ RequestCoordinator::RequestAvailability::ENABLED_FOR_OFFLINER) != 0);
PumpLoop();
// Now whether processing triggered immediately depends on whether test
@@ -1043,7 +1052,10 @@ TEST_F(RequestCoordinatorTest,
}
TEST_F(RequestCoordinatorTest, SavePageDoesntStartProcessingWhenDisconnected) {
- EXPECT_TRUE(coordinator()->SavePageLater(kUrl1, kClientId1, kUserRequested));
+ EXPECT_TRUE(
+ coordinator()->SavePageLater(
+ kUrl1, kClientId1, kUserRequested,
+ RequestCoordinator::RequestAvailability::ENABLED_FOR_OFFLINER) != 0);
PumpLoop();
EXPECT_FALSE(is_busy());
}
@@ -1052,7 +1064,10 @@ TEST_F(RequestCoordinatorTest,
SavePageDoesntStartProcessingWhenPoorlyConnected) {
SetEffectiveConnectionTypeForTest(
net::EffectiveConnectionType::EFFECTIVE_CONNECTION_TYPE_SLOW_2G);
- EXPECT_TRUE(coordinator()->SavePageLater(kUrl1, kClientId1, kUserRequested));
+ EXPECT_TRUE(
+ coordinator()->SavePageLater(
+ kUrl1, kClientId1, kUserRequested,
+ RequestCoordinator::RequestAvailability::ENABLED_FOR_OFFLINER) != 0);
PumpLoop();
EXPECT_FALSE(is_busy());
}
« no previous file with comments | « components/offline_pages/background/request_coordinator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698