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

Unified Diff: chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc

Issue 2822023002: [Offline pages]: Move logic for whether to consider the DocumentAvailableInMainFrame signal to the … (Closed)
Patch Set: test fix: replace snapshot controller at the right place Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc
diff --git a/chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc b/chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc
index 947d97a171c3b01b9e794b8d0c9784ce08c168b7..52a61bc560e3de4f61078b2c073f1a7d7a605c2a 100644
--- a/chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc
+++ b/chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc
@@ -172,6 +172,15 @@ class BackgroundLoaderOfflinerTest : public testing::Test {
void PumpLoop() { base::RunLoop().RunUntilIdle(); }
void CompleteLoading() {
+ // Reset snapshot controller.
+ std::unique_ptr<SnapshotController> snapshot_controller(
+ new SnapshotController(base::ThreadTaskRunnerHandle::Get(),
+ offliner_.get(),
+ 0L /* DelayAfterDocumentAvailable */,
+ 0L /* DelayAfterDocumentOnLoad */,
+ false /* DocumentAvailableTriggersSnapshot */));
+ offliner_->SetSnapshotControllerForTest(std::move(snapshot_controller));
+ // Call complete loading.
offliner()->DocumentOnLoadCompletedInMainFrame();
PumpLoop();
}
@@ -209,7 +218,6 @@ void BackgroundLoaderOfflinerTest::SetUp() {
policy_.reset(new OfflinerPolicy());
offliner_.reset(
new TestBackgroundLoaderOffliner(profile(), policy_.get(), model_));
- offliner_->SetPageDelayForTest(0L);
}
void BackgroundLoaderOfflinerTest::OnCompletion(

Powered by Google App Engine
This is Rietveld 408576698