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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 139053002: cc: Release main thread earlier (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: old chunk mismatch Created 6 years, 11 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 d01fbae1778d0fa4868c59028916ac7c31c1dd4d..29064f351480df934f94a2f8461627c8e08c0c9d 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -3116,7 +3116,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize);
// Test for UI Resource management.
class LayerTreeHostTestUIResource : public LayerTreeHostTest {
public:
- LayerTreeHostTestUIResource() : num_ui_resources_(0), num_commits_(0) {}
+ LayerTreeHostTestUIResource() : num_ui_resources_(0) {}
virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
settings->texture_id_allocation_chunk_size = 1;
@@ -3125,7 +3125,7 @@ class LayerTreeHostTestUIResource : public LayerTreeHostTest {
virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
virtual void DidCommit() OVERRIDE {
- int frame = num_commits_;
+ int frame = layer_tree_host()->source_frame_number();
switch (frame) {
case 1:
CreateResource();
@@ -3160,25 +3160,25 @@ class LayerTreeHostTestUIResource : public LayerTreeHostTest {
TestWebGraphicsContext3D* context = static_cast<TestContextProvider*>(
impl->output_surface()->context_provider().get())->TestContext3d();
- int frame = num_commits_;
+ int frame = impl->active_tree()->source_frame_number();
switch (frame) {
- case 1:
+ case 0:
ASSERT_EQ(0u, context->NumTextures());
break;
- case 2:
+ case 1:
// Created two textures.
ASSERT_EQ(2u, context->NumTextures());
break;
- case 3:
+ case 2:
// One texture left after one deletion.
ASSERT_EQ(1u, context->NumTextures());
break;
- case 4:
+ case 3:
// Resource manager state should not change when delete is called on an
// invalid id.
ASSERT_EQ(1u, context->NumTextures());
break;
- case 5:
+ case 4:
// Creation after deletion: two more creates should total up to
// three textures.
ASSERT_EQ(3u, context->NumTextures());
@@ -3187,7 +3187,6 @@ class LayerTreeHostTestUIResource : public LayerTreeHostTest {
}
virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
- ++num_commits_;
if (!layer_tree_host()->settings().impl_side_painting)
PerformTest(impl);
}
@@ -3213,7 +3212,6 @@ class LayerTreeHostTestUIResource : public LayerTreeHostTest {
scoped_ptr<FakeScopedUIResource> ui_resources_[5];
int num_ui_resources_;
- int num_commits_;
};
MULTI_THREAD_TEST_F(LayerTreeHostTestUIResource);

Powered by Google App Engine
This is Rietveld 408576698