chromium/chrome/browser/ui/webui/top_chrome/per_profile_webui_tracker_unittest.cc

// Copyright 2024 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/ui/webui/top_chrome/per_profile_webui_tracker.h"

#include "base/scoped_observation.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "content/public/test/web_contents_tester.h"
#include "testing/gmock/include/gmock/gmock.h"

namespace {
constexpr char kWebUIUrl1[] =;
constexpr char kWebUIUrl2[] =;
}  // namespace

class PerProfileWebUITrackerTest : public ChromeRenderViewHostTestHarness {};

TEST_F(PerProfileWebUITrackerTest, Basic) {}

// Tests that when a profile opens two WebUIs of the same URL, the tracker
// will indicate that the WebUI is still present after closing one of them.
TEST_F(PerProfileWebUITrackerTest, TwoWebUIsOfSameURL) {}

// Tests that the tracker distinguishes different profiles.
TEST_F(PerProfileWebUITrackerTest, DifferentProfiles) {}

// Tests that the tracker work as expected when a WebContents navigates from
// about:blank to a WebUI.
TEST_F(PerProfileWebUITrackerTest, Navigation) {}

class MockTrackerObserver : public PerProfileWebUITracker::Observer {};

// Tests that the observer of tracker is notified of WebContents destroy.
TEST_F(PerProfileWebUITrackerTest, Observer) {}