Commit 5b5cbc9c authored by Dmitry Titov's avatar Dmitry Titov Committed by Commit Bot

Fix the previously landed patch that missed check for new feature.

This causes some test breakage since feature is still in development.
The previously landed CL is https://chromium.googlesource.com/chromium/src/+/ccee22ccb0ed0ebf4f1ec417bddee0a0219132e2

Bug: 812899
Change-Id: I16657bc47fd69048cb8673ee4eca0aa77686da64
Reviewed-on: https://chromium-review.googlesource.com/923167Reviewed-by: default avatarCarlos Knippschild <carlosk@chromium.org>
Commit-Queue: Dmitry Titov <dimich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537127}
parent 37a0c6bb
......@@ -407,7 +407,8 @@ void OfflinePageModelTaskified::OnCreateArchiveDone(
offline_page.original_url = save_page_params.original_url;
}
if (policy_controller_->IsUserRequestedDownload(
if (IsOfflinePagesSharingEnabled() &&
policy_controller_->IsUserRequestedDownload(
offline_page.client_id.name_space)) {
// If the user intentionally downloaded the page, move it to a public place.
PublishArchive(offline_page, callback, archiver);
......
......@@ -14,6 +14,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/test/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_mock_time_task_runner.h"
#include "build/build_config.h"
#include "components/offline_pages/core/client_namespace_constants.h"
......@@ -21,6 +22,7 @@
#include "components/offline_pages/core/model/offline_page_item_generator.h"
#include "components/offline_pages/core/model/offline_page_model_utils.h"
#include "components/offline_pages/core/model/offline_page_test_utils.h"
#include "components/offline_pages/core/offline_page_feature.h"
#include "components/offline_pages/core/offline_page_item.h"
#include "components/offline_pages/core/offline_page_metadata_store_sql.h"
#include "components/offline_pages/core/offline_page_metadata_store_test_util.h"
......@@ -1178,6 +1180,9 @@ TEST_F(OfflinePageModelTaskifiedTest,
#endif
TEST_F(OfflinePageModelTaskifiedTest,
MAYBE_CheckPagesSavedInSeparateDirsPublic) {
auto feature_list = std::make_unique<base::test::ScopedFeatureList>();
feature_list->InitAndEnableFeature(
offline_pages::kOfflinePagesSharingFeature);
// Save a temporary page.
auto archiver = BuildArchiver(kTestUrl, ArchiverResult::SUCCESSFULLY_CREATED);
int64_t temporary_id = SavePageWithExpectedResult(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment