| 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..f3fb21bea4cd16f11318cb99c2d0c737aac6d18e
|
| --- /dev/null
|
| +++ b/chrome/browser/android/offline_pages/request_coordinator_factory_unittest.cc
|
| @@ -0,0 +1,38 @@
|
| +// 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;
|
| +};
|
| +
|
| +RequestCoordinatorFactoryTest::RequestCoordinatorFactoryTest() {}
|
| +
|
| +RequestCoordinatorFactoryTest::~RequestCoordinatorFactoryTest() {}
|
| +
|
| +TEST_F(RequestCoordinatorFactoryTest, BuildRequestCoordinator) {
|
| + RequestCoordinatorFactory* factory = RequestCoordinatorFactory::GetInstance();
|
| + EXPECT_NE(nullptr, factory);
|
| + RequestCoordinator* coordinator1 =
|
| + factory->GetForBrowserContext(browser_context());
|
| + // 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
|
|
|