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

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

Issue 2503073002: [OfflinePages] Fix 2 RequestCoordinator tests for low end devices (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | 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 531c4d17280cadb76b2ea5b55a150e45c0549d1f..eee34ccb8705be7e953cc61cc6b744c6cb791874 100644
--- a/components/offline_pages/background/request_coordinator_unittest.cc
+++ b/components/offline_pages/background/request_coordinator_unittest.cc
@@ -1311,7 +1311,14 @@ TEST_F(RequestCoordinatorTest, MAYBE_PauseAndResumeObserver) {
PumpLoop();
EXPECT_TRUE(observer().changed_called());
- EXPECT_EQ(SavePageRequest::RequestState::OFFLINING, observer().state());
+
+ // Now whether request is offlining or just available depends on whether test
+ // is run on svelte device or not.
+ if (base::SysInfo::IsLowEndDevice()) {
+ EXPECT_EQ(SavePageRequest::RequestState::AVAILABLE, observer().state());
+ } else {
+ EXPECT_EQ(SavePageRequest::RequestState::OFFLINING, observer().state());
+ }
}
TEST_F(RequestCoordinatorTest, RemoveRequest) {
@@ -1409,6 +1416,8 @@ TEST_F(RequestCoordinatorTest, SavePageDoesntStartProcessingWhenDisconnected) {
TEST_F(RequestCoordinatorTest,
SavePageDoesStartProcessingWhenPoorlyConnected) {
+ // If low end device, pretend it is not so that immediate start can happen.
+ SetIsLowEndDeviceForTest(false);
// Set specific network type for 2G with poor effective connection.
SetNetworkConditionsForTest(
net::NetworkChangeNotifier::ConnectionType::CONNECTION_2G);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698