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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 f589c84fc0484d96431c936bb0a93d0ed707888e..51c5d7e0bfd2c78229d34074259d274c2e1111df 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -1112,6 +1112,12 @@ class TestOpacityChangeLayerDelegate : public ContentLayerClient {
if (test_layer_)
test_layer_->SetOpacity(0.f);
}
+ scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
+ const gfx::Rect& clip,
+ GraphicsContextStatus gc_status) override {
+ NOTIMPLEMENTED();
+ return DisplayItemList::Create();
+ }
bool FillsBoundsCompletely() const override { return false; }
private:
@@ -2321,6 +2327,13 @@ class LayerTreeHostTestLCDChange : public LayerTreeHostTest {
++paint_count_;
}
+ scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
+ const gfx::Rect& clip,
+ GraphicsContextStatus gc_status) override {
+ NOTIMPLEMENTED();
+ return DisplayItemList::Create();
+ }
+
bool FillsBoundsCompletely() const override { return false; }
private:
@@ -2591,6 +2604,13 @@ class LayerTreeHostTestChangeLayerPropertiesInPaintContents
layer_->SetBounds(gfx::Size(2, 2));
}
+ scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
+ const gfx::Rect& clip,
+ GraphicsContextStatus gc_status) override {
+ NOTIMPLEMENTED();
+ return DisplayItemList::Create();
+ }
+
bool FillsBoundsCompletely() const override { return false; }
private:
@@ -5653,6 +5673,9 @@ class LayerTreeHostTestCrispUpAfterPinchEndsWithOneCopy
TestWebGraphicsContext3D::Create();
context3d->set_support_image(true);
context3d->set_support_sync_query(true);
+#if defined(OS_MACOSX)
+ context3d->set_support_texture_rectangle(true);
+#endif
if (delegating_renderer())
return FakeOutputSurface::CreateDelegating3d(context3d.Pass());
@@ -5840,4 +5863,59 @@ class LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles
MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousDrawWhenCreatingVisibleTiles);
+class LayerTreeHostTestOneActivatePerManageTiles : public LayerTreeHostTest {
+ public:
+ LayerTreeHostTestOneActivatePerManageTiles()
+ : notify_ready_to_activate_count_(0u), scheduled_manage_tiles_count_(0) {}
+
+ void SetupTree() override {
+ client_.set_fill_with_nonsolid_color(true);
+ scoped_refptr<FakePictureLayer> root_layer =
+ FakePictureLayer::Create(&client_);
+ root_layer->SetBounds(gfx::Size(1500, 1500));
+ root_layer->SetIsDrawable(true);
+
+ layer_tree_host()->SetRootLayer(root_layer);
+ LayerTreeHostTest::SetupTree();
+ }
+
+ void BeginTest() override {
+ layer_tree_host()->SetViewportSize(gfx::Size(16, 16));
+ PostSetNeedsCommitToMainThread();
+ }
+
+ void InitializedRendererOnThread(LayerTreeHostImpl* host_impl,
+ bool success) override {
+ ASSERT_TRUE(success);
+ host_impl->tile_manager()->SetScheduledRasterTaskLimitForTesting(1);
+ }
+
+ void NotifyReadyToActivateOnThread(LayerTreeHostImpl* impl) override {
+ ++notify_ready_to_activate_count_;
+ EndTestAfterDelayMs(100);
+ }
+
+ void ScheduledActionManageTiles() override {
+ ++scheduled_manage_tiles_count_;
+ }
+
+ void AfterTest() override {
+ // Expect at most a notification for each scheduled manage tiles, plus one
+ // for the initial commit (which doesn't go through scheduled actions).
+ // The reason this is not an equality is because depending on timing, we
+ // might get a manage tiles but not yet get a notification that we're
+ // ready to activate. The intent of a test is to ensure that we don't
+ // get more than one notification per manage tiles, so this is OK.
+ EXPECT_LE(notify_ready_to_activate_count_,
+ 1u + scheduled_manage_tiles_count_);
+ }
+
+ protected:
+ FakeContentLayerClient client_;
+ size_t notify_ready_to_activate_count_;
+ size_t scheduled_manage_tiles_count_;
+};
+
+MULTI_THREAD_IMPL_TEST_F(LayerTreeHostTestOneActivatePerManageTiles);
+
} // namespace cc
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc ('k') | cc/trees/layer_tree_host_unittest_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698