chromium/chrome/browser/subresource_filter/subresource_filter_special_subframe_navigations_browsertest.cc

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

#include <vector>

#include "base/functional/bind.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/subresource_filter/subresource_filter_browser_test_harness.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_navigation_observer.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
#include "url/origin.h"

namespace subresource_filter {

class SubresourceFilterSpecialSubframeNavigationsBrowserTest
    : public SubresourceFilterBrowserTest {};

// Tests that navigations to special URLs (e.g. about:blank, data URLs, etc)
// which do not trigger ReadyToCommitNavigation (and therefore our activation
// IPC), properly inherit the activation of their parent frame.
// Also tests that a child frame of a special url frame inherits the activation
// state of its parent.
IN_PROC_BROWSER_TEST_F(SubresourceFilterSpecialSubframeNavigationsBrowserTest,
                       NavigationsWithNoIPC_HaveActivation) {}

// Navigate to a site with site hierarchy a(b(c)). Let a navigate c to a data
// URL, and expect that the resulting frame has activation.
// See crbug.com/739777.
IN_PROC_BROWSER_TEST_F(SubresourceFilterSpecialSubframeNavigationsBrowserTest,
                       NavigateCrossProcessDataUrl_MaintainsActivation) {}

}  // namespace subresource_filter