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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 2707243005: Discard compositor frames from unloaded web content (Closed)
Patch Set: Comments updated Created 3 years, 10 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: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 751366c76ef5be61c37f88054d5d91e8753ee023..73b36a3110742b2a9279cd0de1ab5c79d3ad16d6 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -7016,5 +7016,32 @@ class LayerTreeHostTestSubmitFrameResources : public LayerTreeHostTest {
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources);
+// Ensure that content_source_id is propagated to the frame's metadata.
+class LayerTreeHostTestContentSourceId : public LayerTreeHostTest {
+ protected:
+ void BeginTest() override {
+ layer_tree_host()->SetContentSourceId(5);
+ PostSetNeedsCommitToMainThread();
+ }
+
+ DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
+ LayerTreeHostImpl::FrameData* frame_data,
+ DrawResult draw_result) override {
+ EXPECT_EQ(DRAW_SUCCESS, draw_result);
+ EXPECT_EQ(5U, host_impl->active_tree()->content_source_id());
+ return draw_result;
+ }
+
+ void DisplayReceivedCompositorFrameOnThread(
+ const CompositorFrame& frame) override {
+ EXPECT_EQ(5U, frame.metadata.content_source_id);
+ EndTest();
+ }
+
+ void AfterTest() override {}
+};
+
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestContentSourceId);
+
} // namespace
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698