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

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

Issue 681713002: Update from chromium https://crrev.com/301315 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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_host_unittest_context.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 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_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10)); 500 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
501 EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(0, 10), 501 EXPECT_TRUE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(0, 10),
502 InputHandler::Wheel)); 502 InputHandler::Wheel));
503 host_impl_->ScrollEnd(); 503 host_impl_->ScrollEnd();
504 EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(), 504 EXPECT_FALSE(host_impl_->IsCurrentlyScrollingLayerAt(gfx::Point(),
505 InputHandler::Wheel)); 505 InputHandler::Wheel));
506 EXPECT_TRUE(did_request_redraw_); 506 EXPECT_TRUE(did_request_redraw_);
507 EXPECT_TRUE(did_request_commit_); 507 EXPECT_TRUE(did_request_commit_);
508 } 508 }
509 509
510 TEST_F(LayerTreeHostImplTest, ScrollActiveOnlyAfterScrollMovement) {
511 SetupScrollAndContentsLayers(gfx::Size(100, 100));
512 host_impl_->SetViewportSize(gfx::Size(50, 50));
513 DrawFrame();
514
515 EXPECT_EQ(InputHandler::ScrollStarted,
516 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
517 EXPECT_FALSE(host_impl_->IsActivelyScrolling());
518 host_impl_->ScrollBy(gfx::Point(), gfx::Vector2d(0, 10));
519 EXPECT_TRUE(host_impl_->IsActivelyScrolling());
520 host_impl_->ScrollEnd();
521 EXPECT_FALSE(host_impl_->IsActivelyScrolling());
522 }
523
510 TEST_F(LayerTreeHostImplTest, ScrollWithoutRootLayer) { 524 TEST_F(LayerTreeHostImplTest, ScrollWithoutRootLayer) {
511 // We should not crash when trying to scroll an empty layer tree. 525 // We should not crash when trying to scroll an empty layer tree.
512 EXPECT_EQ(InputHandler::ScrollIgnored, 526 EXPECT_EQ(InputHandler::ScrollIgnored,
513 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel)); 527 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel));
514 } 528 }
515 529
516 TEST_F(LayerTreeHostImplTest, ScrollWithoutRenderer) { 530 TEST_F(LayerTreeHostImplTest, ScrollWithoutRenderer) {
517 scoped_ptr<TestWebGraphicsContext3D> context_owned = 531 scoped_ptr<TestWebGraphicsContext3D> context_owned =
518 TestWebGraphicsContext3D::Create(); 532 TestWebGraphicsContext3D::Create();
519 context_owned->set_context_lost(true); 533 context_owned->set_context_lost(true);
(...skipping 6991 matching lines...) Expand 10 before | Expand all | Expand 10 after
7511 // surface. 7525 // surface.
7512 EXPECT_EQ(0, num_lost_surfaces_); 7526 EXPECT_EQ(0, num_lost_surfaces_);
7513 host_impl_->DidLoseOutputSurface(); 7527 host_impl_->DidLoseOutputSurface();
7514 EXPECT_EQ(1, num_lost_surfaces_); 7528 EXPECT_EQ(1, num_lost_surfaces_);
7515 host_impl_->DidLoseOutputSurface(); 7529 host_impl_->DidLoseOutputSurface();
7516 EXPECT_LE(1, num_lost_surfaces_); 7530 EXPECT_LE(1, num_lost_surfaces_);
7517 } 7531 }
7518 7532
7519 } // namespace 7533 } // namespace
7520 } // namespace cc 7534 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_unittest_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698