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

Unified Diff: cc/trees/layer_tree_host_unittest_context.cc

Issue 2349143003: cc: Avoid ResourceProvider nullptr deref (Closed)
Patch Set: not for review: fix crash Created 4 years, 3 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
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_context.cc
diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree_host_unittest_context.cc
index d50a37ddef78e1d5f186ddd4284e44df3d793742..17b9f1dd173770a2833eda5090982634fd6d8336 100644
--- a/cc/trees/layer_tree_host_unittest_context.cc
+++ b/cc/trees/layer_tree_host_unittest_context.cc
@@ -1445,12 +1445,19 @@ class UIResourceLostBeforeActivateTree : public UIResourceLostTest {
LayerTreeHostContextTest::DidActivateTreeOnThread(impl);
switch (time_step_) {
case 1:
- // The pending requests on the impl-side should have been processed.
- EXPECT_NE(0u, impl->ResourceIdForUIResource(ui_resource_->id()));
+ // The pending requests on the impl-side should not have been processed
+ // since the context was lost. But we should have marked the resource as
+ // evicted instead.
+ EXPECT_EQ(0u, impl->ResourceIdForUIResource(ui_resource_->id()));
+ EXPECT_TRUE(impl->EvictedUIResourcesExist());
break;
case 2:
- // The "lost resource" callback should have been called once.
+ // The "lost resource" callback should have been called once and it
+ // should have gotten recreated now and shouldn't be marked as evicted
+ // anymore.
EXPECT_EQ(1, ui_resource_->lost_resource_count);
+ EXPECT_NE(0u, impl->ResourceIdForUIResource(ui_resource_->id()));
+ EXPECT_FALSE(impl->EvictedUIResourcesExist());
break;
case 4:
// The resource is deleted and should not be in the manager. Use
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698