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

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

Issue 2093623003: [Offline pages] Hooking up SQL store to Offline RequestQueue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding a test for SQL store actually persisting requests across resets Created 4 years, 6 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/request_coordinator_factory_unittest.cc
diff --git a/chrome/browser/android/offline_pages/request_coordinator_factory_unittest.cc b/chrome/browser/android/offline_pages/request_coordinator_factory_unittest.cc
index f3fb21bea4cd16f11318cb99c2d0c737aac6d18e..2121edf56e3f55ea0b267d21386b0f3c7380fcf8 100644
--- a/chrome/browser/android/offline_pages/request_coordinator_factory_unittest.cc
+++ b/chrome/browser/android/offline_pages/request_coordinator_factory_unittest.cc
@@ -6,6 +6,7 @@
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "components/offline_pages/background/request_coordinator.h"
+#include "content/public/browser/browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace offline_pages {
@@ -14,12 +15,18 @@ class RequestCoordinatorFactoryTest : public ChromeRenderViewHostTestHarness {
public:
RequestCoordinatorFactoryTest();
~RequestCoordinatorFactoryTest() override;
+
+ void FlushBlockingPool();
};
RequestCoordinatorFactoryTest::RequestCoordinatorFactoryTest() {}
RequestCoordinatorFactoryTest::~RequestCoordinatorFactoryTest() {}
+void RequestCoordinatorFactoryTest::FlushBlockingPool() {
+ content::BrowserThread::GetBlockingPool()->FlushForTesting();
+}
+
TEST_F(RequestCoordinatorFactoryTest, BuildRequestCoordinator) {
RequestCoordinatorFactory* factory = RequestCoordinatorFactory::GetInstance();
EXPECT_NE(nullptr, factory);
@@ -33,6 +40,7 @@ TEST_F(RequestCoordinatorFactoryTest, BuildRequestCoordinator) {
// Calling twice gives us the same coordinator.
EXPECT_EQ(coordinator1, coordinator2);
+ FlushBlockingPool();
}
} // namespace offline_pages
« no previous file with comments | « chrome/browser/android/offline_pages/request_coordinator_factory.cc ('k') | chrome/common/chrome_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698