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

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

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@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_unittest_no_message_loop.cc ('k') | cc/trees/layer_tree_settings.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include "base/memory/weak_ptr.h" 7 #include "base/memory/weak_ptr.h"
8 #include "cc/layers/layer.h" 8 #include "cc/layers/layer.h"
9 #include "cc/layers/layer_impl.h" 9 #include "cc/layers/layer_impl.h"
10 #include "cc/layers/picture_layer.h" 10 #include "cc/layers/picture_layer.h"
11 #include "cc/scheduler/begin_frame_source.h"
11 #include "cc/test/fake_content_layer_client.h" 12 #include "cc/test/fake_content_layer_client.h"
12 #include "cc/test/fake_layer_tree_host_client.h" 13 #include "cc/test/fake_layer_tree_host_client.h"
13 #include "cc/test/fake_picture_layer.h" 14 #include "cc/test/fake_picture_layer.h"
14 #include "cc/test/fake_picture_layer_impl.h" 15 #include "cc/test/fake_picture_layer_impl.h"
15 #include "cc/test/geometry_test_utils.h" 16 #include "cc/test/geometry_test_utils.h"
16 #include "cc/test/layer_tree_test.h" 17 #include "cc/test/layer_tree_test.h"
17 #include "cc/test/test_shared_bitmap_manager.h" 18 #include "cc/test/test_shared_bitmap_manager.h"
18 #include "cc/trees/layer_tree_impl.h" 19 #include "cc/trees/layer_tree_impl.h"
19 #include "ui/gfx/geometry/point_conversions.h" 20 #include "ui/gfx/geometry/point_conversions.h"
20 #include "ui/gfx/geometry/size_conversions.h" 21 #include "ui/gfx/geometry/size_conversions.h"
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 if (!task_runner_->BelongsToCurrentThread()) 1085 if (!task_runner_->BelongsToCurrentThread())
1085 ADD_FAILURE() << "Animate called on wrong thread"; 1086 ADD_FAILURE() << "Animate called on wrong thread";
1086 } 1087 }
1087 1088
1088 void MainThreadHasStoppedFlinging() override { 1089 void MainThreadHasStoppedFlinging() override {
1089 if (!task_runner_->BelongsToCurrentThread()) 1090 if (!task_runner_->BelongsToCurrentThread())
1090 ADD_FAILURE() << "MainThreadHasStoppedFlinging called on wrong thread"; 1091 ADD_FAILURE() << "MainThreadHasStoppedFlinging called on wrong thread";
1091 *received_stop_flinging_ = true; 1092 *received_stop_flinging_ = true;
1092 } 1093 }
1093 1094
1094 void DidOverscroll(const gfx::PointF& causal_event_viewport_point,
1095 const gfx::Vector2dF& accumulated_overscroll,
1096 const gfx::Vector2dF& latest_overscroll_delta) override {
1097 if (!task_runner_->BelongsToCurrentThread())
1098 ADD_FAILURE() << "DidOverscroll called on wrong thread";
1099 }
1100
1101 private: 1095 private:
1102 base::SingleThreadTaskRunner* task_runner_; 1096 base::SingleThreadTaskRunner* task_runner_;
1103 bool* received_stop_flinging_; 1097 bool* received_stop_flinging_;
1104 }; 1098 };
1105 1099
1106 void BindInputHandlerOnCompositorThread( 1100 void BindInputHandlerOnCompositorThread(
1107 const base::WeakPtr<InputHandler>& input_handler, 1101 const base::WeakPtr<InputHandler>& input_handler,
1108 ThreadCheckingInputHandlerClient* client) { 1102 ThreadCheckingInputHandlerClient* client) {
1109 input_handler->BindToClient(client); 1103 input_handler->BindToClient(client);
1110 } 1104 }
(...skipping 11 matching lines...) Expand all
1122 1116
1123 ASSERT_TRUE(impl_thread.message_loop_proxy().get()); 1117 ASSERT_TRUE(impl_thread.message_loop_proxy().get());
1124 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( 1118 scoped_ptr<SharedBitmapManager> shared_bitmap_manager(
1125 new TestSharedBitmapManager()); 1119 new TestSharedBitmapManager());
1126 scoped_ptr<LayerTreeHost> layer_tree_host = 1120 scoped_ptr<LayerTreeHost> layer_tree_host =
1127 LayerTreeHost::CreateThreaded(&client, 1121 LayerTreeHost::CreateThreaded(&client,
1128 shared_bitmap_manager.get(), 1122 shared_bitmap_manager.get(),
1129 NULL, 1123 NULL,
1130 settings, 1124 settings,
1131 base::MessageLoopProxy::current(), 1125 base::MessageLoopProxy::current(),
1132 impl_thread.message_loop_proxy()); 1126 impl_thread.message_loop_proxy(),
1127 nullptr);
1133 1128
1134 impl_thread.message_loop_proxy() 1129 impl_thread.message_loop_proxy()
1135 ->PostTask(FROM_HERE, 1130 ->PostTask(FROM_HERE,
1136 base::Bind(&BindInputHandlerOnCompositorThread, 1131 base::Bind(&BindInputHandlerOnCompositorThread,
1137 layer_tree_host->GetInputHandler(), 1132 layer_tree_host->GetInputHandler(),
1138 base::Unretained(&input_handler_client))); 1133 base::Unretained(&input_handler_client)));
1139 1134
1140 layer_tree_host->DidStopFlinging(); 1135 layer_tree_host->DidStopFlinging();
1141 layer_tree_host = nullptr; 1136 layer_tree_host = nullptr;
1142 impl_thread.Stop(); 1137 impl_thread.Stop();
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 RunTest(true, false, true); 1225 RunTest(true, false, true);
1231 } 1226 }
1232 1227
1233 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) { 1228 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) {
1234 scroll_destroy_whole_tree_ = true; 1229 scroll_destroy_whole_tree_ = true;
1235 RunTest(true, false, true); 1230 RunTest(true, false, true);
1236 } 1231 }
1237 1232
1238 } // namespace 1233 } // namespace
1239 } // namespace cc 1234 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_no_message_loop.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698