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

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

Issue 1969463002: Add a save page request to the request queue (and test it). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR feedback per FGorski Created 4 years, 7 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
new file mode 100644
index 0000000000000000000000000000000000000000..b5b88033ea4febc7871c2e2201157ce8326c0d7f
--- /dev/null
+++ b/chrome/browser/android/offline_pages/request_coordinator_factory_unittest.cc
@@ -0,0 +1,44 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/android/offline_pages/request_coordinator_factory.h"
+
+#include "chrome/test/base/chrome_render_view_host_test_harness.h"
+#include "components/offline_pages/background/request_coordinator.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace offline_pages {
+
+class RequestCoordinatorFactoryTest : public ChromeRenderViewHostTestHarness {
+ public:
+ RequestCoordinatorFactoryTest();
+ ~RequestCoordinatorFactoryTest() override;
+
+ void SetUp() override;
+};
+
+RequestCoordinatorFactoryTest::RequestCoordinatorFactoryTest() {}
+
+RequestCoordinatorFactoryTest::~RequestCoordinatorFactoryTest() {}
+
+void RequestCoordinatorFactoryTest::SetUp() {
+ content::RenderViewHostTestHarness::SetUp();
fgorski 2016/05/11 19:45:15 About removal of setup. This is exactly what I imp
Pete Williamson 2016/05/11 22:13:03 Done.
+}
+
+TEST_F(RequestCoordinatorFactoryTest, BuildRequestCoordinator) {
+ RequestCoordinatorFactory* factory = RequestCoordinatorFactory::GetInstance();
+ EXPECT_NE(nullptr, factory);
+ RequestCoordinator* coordinator1 =
+ factory->GetForBrowserContext(browser_context());
fgorski 2016/05/11 19:45:15 Nice. I missed that.
Pete Williamson 2016/05/11 22:13:03 Acknowledged.
+ // We should actually get a coordinator.
+ EXPECT_NE(nullptr, coordinator1);
+
+ RequestCoordinator* coordinator2 =
+ factory->GetForBrowserContext(browser_context());
+ // Calling twice gives us the same coordinator.
+ EXPECT_EQ(coordinator1, coordinator2);
+
+}
+
+} // namespace offline_pages

Powered by Google App Engine
This is Rietveld 408576698