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

Side by Side Diff: cc/resources/texture_mailbox_deleter_unittest.cc

Issue 609663003: cc: Remove use of PassAs() and constructor-casting with scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cc-passas: PassAs-presubmit-warning Created 6 years, 2 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/resources/task_graph_runner_perftest.cc ('k') | cc/resources/tile_manager_perftest.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/resources/texture_mailbox_deleter.h" 5 #include "cc/resources/texture_mailbox_deleter.h"
6 6
7 #include "base/message_loop/message_loop_proxy.h" 7 #include "base/message_loop/message_loop_proxy.h"
8 #include "cc/resources/single_release_callback.h" 8 #include "cc/resources/single_release_callback.h"
9 #include "cc/test/test_context_provider.h" 9 #include "cc/test/test_context_provider.h"
10 #include "cc/test/test_web_graphics_context_3d.h" 10 #include "cc/test/test_web_graphics_context_3d.h"
(...skipping 16 matching lines...) Expand all
27 EXPECT_TRUE(context_provider->HasOneRef()); 27 EXPECT_TRUE(context_provider->HasOneRef());
28 EXPECT_EQ(1u, context_provider->TestContext3d()->NumTextures()); 28 EXPECT_EQ(1u, context_provider->TestContext3d()->NumTextures());
29 29
30 scoped_ptr<SingleReleaseCallback> cb = 30 scoped_ptr<SingleReleaseCallback> cb =
31 deleter->GetReleaseCallback(context_provider, texture_id).Pass(); 31 deleter->GetReleaseCallback(context_provider, texture_id).Pass();
32 EXPECT_FALSE(context_provider->HasOneRef()); 32 EXPECT_FALSE(context_provider->HasOneRef());
33 EXPECT_EQ(1u, context_provider->TestContext3d()->NumTextures()); 33 EXPECT_EQ(1u, context_provider->TestContext3d()->NumTextures());
34 34
35 // When the deleter is destroyed, it immediately drops its ref on the 35 // When the deleter is destroyed, it immediately drops its ref on the
36 // ContextProvider, and deletes the texture. 36 // ContextProvider, and deletes the texture.
37 deleter.reset(); 37 deleter = nullptr;
38 EXPECT_TRUE(context_provider->HasOneRef()); 38 EXPECT_TRUE(context_provider->HasOneRef());
39 EXPECT_EQ(0u, context_provider->TestContext3d()->NumTextures()); 39 EXPECT_EQ(0u, context_provider->TestContext3d()->NumTextures());
40 40
41 // Run the scoped release callback before destroying it, but it won't do 41 // Run the scoped release callback before destroying it, but it won't do
42 // anything. 42 // anything.
43 cb->Run(0, false); 43 cb->Run(0, false);
44 } 44 }
45 45
46 } // namespace 46 } // namespace
47 } // namespace cc 47 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/task_graph_runner_perftest.cc ('k') | cc/resources/tile_manager_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698