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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1239843002: cc: Call PrepareTiles when becoming visible in browser only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 5 years, 5 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6d9c9c67199fbe1de37c8e323c741e004d8b6798..f6e5838836df9a8e830052359c7482494afe602f 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -231,13 +231,13 @@ class LayerTreeHostTestReadyToDrawEmpty : public LayerTreeHostTest {
void AfterTest() override {
EXPECT_TRUE(did_notify_ready_to_draw_);
EXPECT_TRUE(all_tiles_required_for_draw_are_ready_to_draw_);
- EXPECT_EQ(size_t(0), required_for_draw_count_);
+ EXPECT_EQ(0, required_for_draw_count_);
}
protected:
bool did_notify_ready_to_draw_;
bool all_tiles_required_for_draw_are_ready_to_draw_;
- size_t required_for_draw_count_;
+ int required_for_draw_count_;
};
SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestReadyToDrawEmpty);
@@ -261,7 +261,7 @@ class LayerTreeHostTestReadyToDrawNonEmpty
void AfterTest() override {
EXPECT_TRUE(did_notify_ready_to_draw_);
EXPECT_TRUE(all_tiles_required_for_draw_are_ready_to_draw_);
- EXPECT_LE(size_t(1), required_for_draw_count_);
+ EXPECT_LE(1, required_for_draw_count_);
}
private:
@@ -272,6 +272,32 @@ class LayerTreeHostTestReadyToDrawNonEmpty
// single threaded mode.
SINGLE_THREAD_TEST_F(LayerTreeHostTestReadyToDrawNonEmpty);
+class LayerTreeHostTestReadyToDrawVisibility
brianderson 2015/07/16 22:36:14 Can you add a comment explaining what this test do
sunnyps 2015/07/16 22:51:44 Done.
+ : public LayerTreeHostTestReadyToDrawNonEmpty {
+ public:
+ LayerTreeHostTestReadyToDrawVisibility()
+ : LayerTreeHostTestReadyToDrawNonEmpty(), did_commit_(false) {}
+
+ void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
+ EXPECT_FALSE(did_commit_);
+ did_commit_ = true;
+ PostSetVisibleToMainThread(false);
+ }
+
+ void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl,
+ bool visible) override {
+ if (!visible) {
+ EXPECT_TRUE(did_commit_);
+ PostSetVisibleToMainThread(true);
brianderson 2015/07/16 22:36:14 To test the test, could you: DCHECK(!all_tiles_req
sunnyps 2015/07/16 22:51:44 Done.
+ }
+ }
+
+ protected:
+ bool did_commit_;
+};
+
+SINGLE_THREAD_TEST_F(LayerTreeHostTestReadyToDrawVisibility);
+
class LayerTreeHostFreeWorkerContextResourcesTest : public LayerTreeHostTest {
public:
scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface() override {
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698