Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1015)

Unified Diff: content/browser/renderer_host/begin_frame_observer_proxy_unittest.cc

Issue 1841083007: Remove SendBeginFramesToChildren plumbing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scheduler_output_surface_client_set_beginframesource
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/begin_frame_observer_proxy_unittest.cc
diff --git a/content/browser/renderer_host/begin_frame_observer_proxy_unittest.cc b/content/browser/renderer_host/begin_frame_observer_proxy_unittest.cc
deleted file mode 100644
index 56e89760104a93f09353457bf5ee2b413b27e890..0000000000000000000000000000000000000000
--- a/content/browser/renderer_host/begin_frame_observer_proxy_unittest.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2015 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 "content/browser/renderer_host/begin_frame_observer_proxy.h"
-
-#include <algorithm>
-#include <list>
-#include <memory>
-
-#include "base/compiler_specific.h"
-#include "base/test/test_simple_task_runner.h"
-#include "cc/output/begin_frame_args.h"
-#include "cc/test/begin_frame_args_test.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/compositor/compositor.h"
-#include "ui/compositor/test/context_factories_for_test.h"
-
-using testing::Mock;
-using testing::_;
-
-namespace content {
-namespace {
-
-class MockBeginFrameObserverProxyClient : public BeginFrameObserverProxyClient {
- public:
- MOCK_METHOD1(SendBeginFrame, void(const cc::BeginFrameArgs&));
-};
-
-class BeginFrameObserverProxyTest : public testing::Test {
- public:
- BeginFrameObserverProxyTest() {}
- ~BeginFrameObserverProxyTest() override {}
-
- void SetUp() override {
- bool enable_pixel_output = false;
- ui::ContextFactory* context_factory =
- ui::InitializeContextFactoryForTests(enable_pixel_output);
- compositor_task_runner_ = new base::TestSimpleTaskRunner();
- compositor_.reset(
- new ui::Compositor(context_factory, compositor_task_runner_));
- compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
- }
-
- void TearDown() override {
- compositor_.reset();
- ui::TerminateContextFactoryForTests();
- }
-
- ui::Compositor* compositor() { return compositor_.get(); }
-
- private:
- scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
- std::unique_ptr<ui::Compositor> compositor_;
-};
-
-} // namespace
-
-TEST_F(BeginFrameObserverProxyTest, BeginFrameScheduling) {
- MockBeginFrameObserverProxyClient client;
- BeginFrameObserverProxy begin_frame_observer(&client);
- begin_frame_observer.SetCompositor(compositor());
- begin_frame_observer.SetNeedsBeginFrames(true);
-
- // SendBeginFrame is called when new |args| is delivered.
- cc::BeginFrameArgs args =
- cc::CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE,
- base::TimeTicks::FromInternalValue(33));
- EXPECT_CALL(client, SendBeginFrame(args));
- compositor()->SendBeginFramesToChildren(args);
- Mock::VerifyAndClearExpectations(&client);
-
- // SendBeginFrame is called when new |args2| is delivered.
- cc::BeginFrameArgs args2 =
- cc::CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE,
- base::TimeTicks::FromInternalValue(66));
- EXPECT_CALL(client, SendBeginFrame(args2));
- compositor()->SendBeginFramesToChildren(args2);
- Mock::VerifyAndClearExpectations(&client);
-
- // SendBeginFrame is not called when used |args2| is delivered.
- EXPECT_CALL(client, SendBeginFrame(_)).Times(0);
- compositor()->SendBeginFramesToChildren(args2);
- Mock::VerifyAndClearExpectations(&client);
-
- // SendBeginFrame is not called when compositor is reset.
- begin_frame_observer.ResetCompositor();
- cc::BeginFrameArgs args3 =
- cc::CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE,
- base::TimeTicks::FromInternalValue(99));
- EXPECT_CALL(client, SendBeginFrame(_)).Times(0);
- compositor()->SendBeginFramesToChildren(args3);
- Mock::VerifyAndClearExpectations(&client);
-}
-
-} // namespace content
« no previous file with comments | « content/browser/renderer_host/begin_frame_observer_proxy.cc ('k') | content/browser/renderer_host/delegated_frame_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698