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

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: Remove files added in error. 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..1fbf9a480bab85ff9e8d01a5d25f30888663c4ff
--- /dev/null
+++ b/chrome/browser/android/offline_pages/request_coordinator_factory_unittest.cc
@@ -0,0 +1,43 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
dougarnett 2016/05/10 20:23:34 16
Pete Williamson 2016/05/10 21:07:44 Done.
+// 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 <memory>
fgorski 2016/05/10 21:18:12 Is this used?
Pete Williamson 2016/05/10 22:51:57 Removed (leftover from using smart pointers)
+
+#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 {
+namespace {
+// constants here
fgorski 2016/05/10 21:18:12 This does not seem needed. How about removing it?
Pete Williamson 2016/05/10 22:51:57 Done.
+} // namespace
+
+class RequestCoordinatorFactoryTest : public ChromeRenderViewHostTestHarness {
+ public:
+ RequestCoordinatorFactoryTest();
+ ~RequestCoordinatorFactoryTest() override;
+
+ void SetUp() override;
fgorski 2016/05/10 21:18:12 Is this needed? How about removing it if it is not
Pete Williamson 2016/05/10 22:51:57 Yes, used below for the RenderViewHostTestHarness
+};
+
+RequestCoordinatorFactoryTest::RequestCoordinatorFactoryTest() {}
+
+RequestCoordinatorFactoryTest::~RequestCoordinatorFactoryTest() {}
+
+void RequestCoordinatorFactoryTest::SetUp() {
+ content::RenderViewHostTestHarness::SetUp();
+}
+
+TEST_F(RequestCoordinatorFactoryTest, BuildRequestCoordinator) {
+ RequestCoordinatorFactory* factory(RequestCoordinatorFactory::GetInstance());
fgorski 2016/05/10 21:18:12 please use assignment, it is confusing and I could
Pete Williamson 2016/05/10 22:51:57 Done.
+ EXPECT_NE(nullptr, factory);
+ RequestCoordinator* coordinator(
+ factory->GetForBrowserContext(browser_context()));
+ // We should actually get a coordinator.
+ EXPECT_NE(nullptr, coordinator);
fgorski 2016/05/10 21:18:12 you can also verify that calling multiple times gi
Pete Williamson 2016/05/10 22:51:57 Done.
+}
+
+} // namespace offline_pages

Powered by Google App Engine
This is Rietveld 408576698