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

// Copyright 2021 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/webui_contents_wrapper.h"

#include <memory>
#include <utility>

#include "base/memory/weak_ptr.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/views/chrome_views_test_base.h"
#include "components/input/native_web_keyboard_event.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/site_instance.h"
#include "content/public/common/content_client.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_renderer_host.h"
#include "content/public/test/web_contents_tester.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/page/draggable_region.mojom.h"

namespace views {

namespace {

class MockHost : public WebUIContentsWrapper::Host {};

class TestWebUIContentsWrapper
    : public WebUIContentsWrapper {};

}  // namespace

namespace test {

class WebUIContentsWrapperTest : public ChromeViewsTestBase {};

TEST_F(WebUIContentsWrapperTest, CallsHostForShowUIAndCloseUIWhenPresent) {}

TEST_F(WebUIContentsWrapperTest, CallsShowContextMenu) {}

TEST_F(WebUIContentsWrapperTest, NotifiesHostWhenResized) {}

TEST_F(WebUIContentsWrapperTest, EscapeKeyClosesHost) {}

TEST_F(WebUIContentsWrapperTest, ClosesHostOnWebContentsCrash) {}

TEST_F(WebUIContentsWrapperTest, NotifiesHostWhenDraggableRegionsUpdated) {}

// Tests that when auto-resize is enabled (this is configured in
// TestWebUIContentsWrapper), the host is resize when SetHost() is called if the
// frame size is available.
TEST_F(WebUIContentsWrapperTest, HostIsResizedOnSetHost) {}

}  // namespace test
}  // namespace views