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

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 2707243005: Discard compositor frames from unloaded web content (Closed)
Patch Set: Add default value for source ID in frame metadata Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 6992 matching lines...) Expand 10 before | Expand all | Expand 10 after
7003 EXPECT_EQ(21u, frame.resource_list.size()); 7003 EXPECT_EQ(21u, frame.resource_list.size());
7004 7004
7005 EndTest(); 7005 EndTest();
7006 } 7006 }
7007 7007
7008 void AfterTest() override {} 7008 void AfterTest() override {}
7009 }; 7009 };
7010 7010
7011 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources); 7011 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources);
7012 7012
7013 // Ensure that content_source_id is propagated to the frame's metadata.
7014 class LayerTreeHostTestContentSourceId : public LayerTreeHostTest {
7015 protected:
7016 void BeginTest() override {
7017 layer_tree_host()->SetContentSourceId(5);
7018 PostSetNeedsCommitToMainThread();
7019 }
7020
7021 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
7022 LayerTreeHostImpl::FrameData* frame_data,
7023 DrawResult draw_result) override {
7024 EXPECT_EQ(DRAW_SUCCESS, draw_result);
7025 EXPECT_EQ(5U, host_impl->active_tree()->content_source_id());
7026 return draw_result;
7027 }
7028
7029 void DisplayReceivedCompositorFrameOnThread(
7030 const CompositorFrame& frame) override {
7031 EXPECT_EQ(5U, frame.metadata.content_source_id);
7032 EndTest();
7033 }
7034
7035 void AfterTest() override {}
7036 };
7037
7038 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestContentSourceId);
7039
7013 } // namespace 7040 } // namespace
7014 } // namespace cc 7041 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698