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

Unified Diff: components/offline_pages/downloads/download_ui_adapter_unittest.cc

Issue 2342443006: [Offline pages] Use the new policy bits (Closed)
Patch Set: i think i got it! Made sure it compiles Created 4 years, 2 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: components/offline_pages/downloads/download_ui_adapter_unittest.cc
diff --git a/components/offline_pages/downloads/download_ui_adapter_unittest.cc b/components/offline_pages/downloads/download_ui_adapter_unittest.cc
index 1484ca9fd37aac9fabbe1f5b718d90fa602837e3..ef21b922942b9436bf2440e9e012cc73dac31a6c 100644
--- a/components/offline_pages/downloads/download_ui_adapter_unittest.cc
+++ b/components/offline_pages/downloads/download_ui_adapter_unittest.cc
@@ -21,6 +21,7 @@
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "components/offline_pages/client_namespace_constants.h"
+#include "components/offline_pages/client_policy_controller.h"
#include "components/offline_pages/stub_offline_page_model.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -51,7 +52,8 @@ class MockOfflinePageModel : public StubOfflinePageModel {
public:
MockOfflinePageModel(base::TestMockTimeTaskRunner* task_runner)
: observer_(nullptr),
- task_runner_(task_runner) {
+ task_runner_(task_runner),
+ policy_controller_(new ClientPolicyController()) {
adapter.reset(new DownloadUIAdapter(this));
// Add one page.
OfflinePageItem page(GURL(kTestUrl),
@@ -109,6 +111,10 @@ class MockOfflinePageModel : public StubOfflinePageModel {
observer_->OfflinePageModelChanged(this);
}
+ ClientPolicyController* GetPolicyController() override {
+ return policy_controller_.get();
+ }
+
// Normally, OfflinePageModel owns this adapter, so lets test it this way.
std::unique_ptr<DownloadUIAdapter> adapter;
@@ -117,6 +123,8 @@ class MockOfflinePageModel : public StubOfflinePageModel {
private:
OfflinePageModel::Observer* observer_;
base::TestMockTimeTaskRunner* task_runner_;
+ // Normally owned by OfflinePageModel.
+ std::unique_ptr<ClientPolicyController> policy_controller_;
DISALLOW_COPY_AND_ASSIGN(MockOfflinePageModel);
};
« no previous file with comments | « components/offline_pages/downloads/download_ui_adapter.cc ('k') | components/offline_pages/offline_page_model_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698