Commit 5d8b8607 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Ding, dong, the AuraTestContextFactory is dead.

Bug: none
Change-Id: Id4fa15e507a2f4a8a7dbca2cc609d85036b389ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2117050
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752661}
parent c921ea04
......@@ -176,8 +176,6 @@ jumbo_static_library("test_support") {
sources = [
"test/aura_test_base.cc",
"test/aura_test_base.h",
"test/aura_test_context_factory.cc",
"test/aura_test_context_factory.h",
"test/aura_test_helper.cc",
"test/aura_test_helper.h",
"test/aura_test_utils.cc",
......
......@@ -6,7 +6,6 @@
#include "base/command_line.h"
#include "ui/aura/client/window_parenting_client.h"
#include "ui/aura/test/aura_test_context_factory.h"
#include "ui/aura/test/test_window_delegate.h"
#include "ui/aura/test/test_windows.h"
#include "ui/aura/window.h"
......
......@@ -29,8 +29,6 @@ class FocusClient;
namespace test {
class AuraTestContextFactory;
// A base class for aura unit tests.
// TODO(beng): Instances of this test will create and own a RootWindow.
class AuraTestBase : public testing::Test {
......@@ -71,7 +69,6 @@ class AuraTestBase : public testing::Test {
bool setup_called_ = false;
bool teardown_called_ = false;
std::unique_ptr<AuraTestHelper> helper_;
std::unique_ptr<AuraTestContextFactory> mus_context_factory_;
DISALLOW_COPY_AND_ASSIGN(AuraTestBase);
};
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/aura/test/aura_test_context_factory.h"
#include "cc/test/test_layer_tree_frame_sink.h"
#include "components/viz/test/fake_output_surface.h"
#include "components/viz/test/fake_skia_output_surface.h"
#include "components/viz/test/test_context_provider.h"
namespace aura {
namespace test {
namespace {
class FrameSinkClient : public cc::TestLayerTreeFrameSinkClient {
public:
explicit FrameSinkClient(
scoped_refptr<viz::ContextProvider> display_context_provider)
: display_context_provider_(std::move(display_context_provider)) {}
// cc::TestLayerTreeFrameSinkClient:
std::unique_ptr<viz::SkiaOutputSurface> CreateDisplaySkiaOutputSurface()
override {
return viz::FakeSkiaOutputSurface::Create3d();
}
std::unique_ptr<viz::OutputSurface> CreateDisplayOutputSurface(
scoped_refptr<viz::ContextProvider> compositor_context_provider)
override {
return viz::FakeOutputSurface::Create3d(
std::move(display_context_provider_));
}
void DisplayReceivedLocalSurfaceId(
const viz::LocalSurfaceId& local_surface_id) override {}
void DisplayReceivedCompositorFrame(
const viz::CompositorFrame& frame) override {}
void DisplayWillDrawAndSwap(bool will_draw_and_swap,
viz::RenderPassList* render_passes) override {}
void DisplayDidDrawAndSwap() override {}
private:
scoped_refptr<viz::ContextProvider> display_context_provider_;
DISALLOW_COPY_AND_ASSIGN(FrameSinkClient);
};
} // namespace
AuraTestContextFactory::AuraTestContextFactory() = default;
AuraTestContextFactory::~AuraTestContextFactory() = default;
void AuraTestContextFactory::CreateLayerTreeFrameSink(
base::WeakPtr<ui::Compositor> compositor) {
scoped_refptr<viz::TestContextProvider> context_provider =
viz::TestContextProvider::Create();
std::unique_ptr<FrameSinkClient> frame_sink_client =
std::make_unique<FrameSinkClient>(context_provider);
constexpr bool synchronous_composite = false;
constexpr bool disable_display_vsync = false;
const double refresh_rate = 200.0;
auto frame_sink = std::make_unique<cc::TestLayerTreeFrameSink>(
context_provider, viz::TestContextProvider::CreateWorker(),
GetGpuMemoryBufferManager(), renderer_settings(),
base::ThreadTaskRunnerHandle::Get().get(), synchronous_composite,
disable_display_vsync, refresh_rate);
frame_sink->SetClient(frame_sink_client.get());
compositor->SetLayerTreeFrameSink(std::move(frame_sink), nullptr);
frame_sink_clients_.insert(std::move(frame_sink_client));
}
} // namespace test
} // namespace aura
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_AURA_TEST_AURA_TEST_CONTEXT_FACTORY_H_
#define UI_AURA_TEST_AURA_TEST_CONTEXT_FACTORY_H_
#include <memory>
#include "base/macros.h"
#include "ui/compositor/test/fake_context_factory.h"
namespace cc {
class TestLayerTreeFrameSinkClient;
}
namespace aura {
namespace test {
class AuraTestContextFactory : public ui::FakeContextFactory {
public:
AuraTestContextFactory();
~AuraTestContextFactory() override;
// ui::FakeContextFactory
void CreateLayerTreeFrameSink(
base::WeakPtr<ui::Compositor> compositor) override;
private:
std::set<std::unique_ptr<cc::TestLayerTreeFrameSinkClient>>
frame_sink_clients_;
DISALLOW_COPY_AND_ASSIGN(AuraTestContextFactory);
};
} // namespace test
} // namespace aura
#endif // UI_AURA_TEST_AURA_TEST_CONTEXT_FACTORY_H_<
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