chromium/chrome/browser/background_fetch/background_fetch_permission_context_unittest.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/background_fetch/background_fetch_permission_context.h"

#include <string>

#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/permissions/permission_util.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/web_contents_tester.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {

class BackgroundFetchPermissionContextTest
    : public ChromeRenderViewHostTestHarness {};

// Test that Background Fetch permission is "allow" by default, when queried
// from a top level frame.
TEST_F(BackgroundFetchPermissionContextTest, TestOutcomeAllowWithFrame) {}

// Test that Background Fetch permission is "prompt" when queried from a worker
// context, if the Automatic Downloads content setting is set to
// CONTENT_SETTING_ALLOW.
TEST_F(BackgroundFetchPermissionContextTest, TestOutcomeAllowWithoutFrame) {}

// Test that Background Fetch permission is "deny" when queried from a worker
// context, if the Automatic Downloads content settings is set to
// CONTENT_SETTING_BLOCK.
TEST_F(BackgroundFetchPermissionContextTest, TestOutcomeDenyWithoutFrame) {}

// Test that Background Fetch permission is "prompt" when queried from a worker
// context, if the Automatic Downloads content setting is CONTENT_SETTING_ASK.
TEST_F(BackgroundFetchPermissionContextTest, TestOutcomePromptWithoutFrame) {}

}  // namespace