Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / cc / trees / layer_tree_host_unittest.cc
index cef92d5..aedd0d9 100644 (file)
@@ -55,9 +55,9 @@
 #include "third_party/khronos/GLES2/gl2ext.h"
 #include "third_party/skia/include/core/SkPicture.h"
 #include "ui/gfx/frame_time.h"
-#include "ui/gfx/point_conversions.h"
-#include "ui/gfx/size_conversions.h"
-#include "ui/gfx/vector2d_conversions.h"
+#include "ui/gfx/geometry/point_conversions.h"
+#include "ui/gfx/geometry/size_conversions.h"
+#include "ui/gfx/geometry/vector2d_conversions.h"
 
 using testing::_;
 using testing::AnyNumber;
@@ -75,22 +75,22 @@ class LayerTreeHostTestSetNeedsCommit1 : public LayerTreeHostTest {
  public:
   LayerTreeHostTestSetNeedsCommit1() : num_commits_(0), num_draws_(0) {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     PostSetNeedsCommitToMainThread();
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
     num_draws_++;
     if (!impl->active_tree()->source_frame_number())
       EndTest();
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
     num_commits_++;
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     EXPECT_LE(1, num_commits_);
     EXPECT_LE(1, num_draws_);
   }
@@ -108,13 +108,11 @@ class LayerTreeHostTestSetNeedsCommit2 : public LayerTreeHostTest {
  public:
   LayerTreeHostTestSetNeedsCommit2() : num_commits_(0), num_draws_(0) {}
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
-    ++num_draws_;
-  }
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override { ++num_draws_; }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
     ++num_commits_;
     switch (num_commits_) {
       case 1:
@@ -128,7 +126,7 @@ class LayerTreeHostTestSetNeedsCommit2 : public LayerTreeHostTest {
     }
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     EXPECT_EQ(2, num_commits_);
     EXPECT_LE(1, num_draws_);
   }
@@ -143,7 +141,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsCommit2);
 // Verify that we pass property values in PushPropertiesTo.
 class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest {
  protected:
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     scoped_refptr<Layer> root = Layer::Create();
     root->SetBounds(gfx::Size(10, 10));
     layer_tree_host()->SetRootLayer(root);
@@ -158,16 +156,16 @@ class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest {
     DONE,
   };
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     index_ = STARTUP;
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
     VerifyAfterValues(impl->active_tree()->root_layer());
   }
 
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     SetBeforeValues(layer_tree_host()->root_layer());
     VerifyBeforeValues(layer_tree_host()->root_layer());
 
@@ -180,7 +178,7 @@ class LayerTreeHostTestPushPropertiesTo : public LayerTreeHostTest {
     SetAfterValues(layer_tree_host()->root_layer());
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   void VerifyBeforeValues(Layer* layer) {
     EXPECT_EQ(gfx::Size(10, 10).ToString(), layer->bounds().ToString());
@@ -239,9 +237,9 @@ class LayerTreeHostTestSetNeedsRedraw : public LayerTreeHostTest {
  public:
   LayerTreeHostTestSetNeedsRedraw() : num_commits_(0), num_draws_(0) {}
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
     EXPECT_EQ(0, impl->active_tree()->source_frame_number());
     if (!num_draws_) {
       // Redraw again to verify that the second redraw doesn't commit.
@@ -252,12 +250,12 @@ class LayerTreeHostTestSetNeedsRedraw : public LayerTreeHostTest {
     num_draws_++;
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
     EXPECT_EQ(0, num_draws_);
     num_commits_++;
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     EXPECT_GE(2, num_draws_);
     EXPECT_EQ(1, num_commits_);
   }
@@ -279,7 +277,7 @@ class LayerTreeHostTestSetNeedsRedrawRect : public LayerTreeHostTest {
         invalid_rect_(10, 10, 20, 20),
         root_layer_(ContentLayer::Create(&client_)) {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     root_layer_->SetIsDrawable(true);
     root_layer_->SetBounds(bounds_);
     layer_tree_host()->SetRootLayer(root_layer_);
@@ -287,10 +285,9 @@ class LayerTreeHostTestSetNeedsRedrawRect : public LayerTreeHostTest {
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual DrawResult PrepareToDrawOnThread(
-      LayerTreeHostImpl* host_impl,
-      LayerTreeHostImpl::FrameData* frame_data,
-      DrawResult draw_result) OVERRIDE {
+  DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
+                                   LayerTreeHostImpl::FrameData* frame_data,
+                                   DrawResult draw_result) override {
     EXPECT_EQ(DRAW_SUCCESS, draw_result);
 
     gfx::RectF root_damage_rect;
@@ -308,7 +305,7 @@ class LayerTreeHostTestSetNeedsRedrawRect : public LayerTreeHostTest {
     return draw_result;
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
     if (!num_draws_) {
       PostSetNeedsRedrawRectToMainThread(invalid_rect_);
     } else {
@@ -317,7 +314,7 @@ class LayerTreeHostTestSetNeedsRedrawRect : public LayerTreeHostTest {
     num_draws_++;
   }
 
-  virtual void AfterTest() OVERRIDE { EXPECT_EQ(2, num_draws_); }
+  void AfterTest() override { EXPECT_EQ(2, num_draws_); }
 
  private:
   int num_draws_;
@@ -331,11 +328,11 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNeedsRedrawRect);
 
 class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest {
  public:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->layer_transforms_should_scale_layer_contents = true;
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     root_layer_ = Layer::Create();
     root_layer_->SetBounds(gfx::Size(10, 20));
 
@@ -347,14 +344,14 @@ class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest {
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
     if (host_impl->active_tree()->source_frame_number() == 1)
       EndTest();
   }
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     switch (layer_tree_host()->source_frame_number()) {
       case 1:
         // Changing the device scale factor causes a commit. It also changes
@@ -368,7 +365,7 @@ class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest {
     }
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     EXPECT_EQ(gfx::Size(4, 4).ToString(),
               scaled_layer_->content_bounds().ToString());
   }
@@ -384,11 +381,11 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoExtraCommitFromInvalidate);
 class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate
     : public LayerTreeHostTest {
  public:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->layer_transforms_should_scale_layer_contents = true;
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     root_layer_ = Layer::Create();
     root_layer_->SetBounds(gfx::Size(10, 20));
 
@@ -405,14 +402,14 @@ class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
     if (host_impl->active_tree()->source_frame_number() == 1)
       EndTest();
   }
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     switch (layer_tree_host()->source_frame_number()) {
       case 1:
         // Changing the device scale factor causes a commit. It also changes
@@ -426,7 +423,7 @@ class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate
     }
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     EXPECT_EQ(gfx::Size(40, 40).ToString(),
               scrollbar_->content_bounds().ToString());
   }
@@ -448,7 +445,7 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest {
         invalid_rect_(10, 10, 20, 20),
         root_layer_(ContentLayer::Create(&client_)) {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     root_layer_->SetIsDrawable(true);
     root_layer_->SetBounds(bounds_);
     layer_tree_host()->SetRootLayer(root_layer_);
@@ -456,15 +453,14 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest {
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
     if (num_draws_ == 3 && host_impl->settings().impl_side_painting)
       host_impl->SetNeedsRedrawRect(invalid_rect_);
   }
 
-  virtual DrawResult PrepareToDrawOnThread(
-      LayerTreeHostImpl* host_impl,
-      LayerTreeHostImpl::FrameData* frame_data,
-      DrawResult draw_result) OVERRIDE {
+  DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
+                                   LayerTreeHostImpl::FrameData* frame_data,
+                                   DrawResult draw_result) override {
     EXPECT_EQ(DRAW_SUCCESS, draw_result);
 
     gfx::RectF root_damage_rect;
@@ -492,7 +488,7 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest {
     return draw_result;
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
     switch (num_draws_) {
       case 0:
       case 1:
@@ -519,7 +515,7 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest {
     num_draws_++;
   }
 
-  virtual void AfterTest() OVERRIDE { EXPECT_EQ(5, num_draws_); }
+  void AfterTest() override { EXPECT_EQ(5, num_draws_); }
 
  private:
   int num_draws_;
@@ -529,7 +525,8 @@ class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest {
   scoped_refptr<ContentLayer> root_layer_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetNextCommitForcesRedraw);
+SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(
+    LayerTreeHostTestSetNextCommitForcesRedraw);
 
 // Tests that if a layer is not drawn because of some reason in the parent then
 // its damage is preserved until the next time it is drawn.
@@ -538,7 +535,7 @@ class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest {
   LayerTreeHostTestUndrawnLayersDamageLater()
       : root_layer_(ContentLayer::Create(&client_)) {}
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     root_layer_->SetIsDrawable(true);
     root_layer_->SetBounds(gfx::Size(50, 50));
     layer_tree_host()->SetRootLayer(root_layer_);
@@ -557,12 +554,11 @@ class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest {
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual DrawResult PrepareToDrawOnThread(
-      LayerTreeHostImpl* host_impl,
-      LayerTreeHostImpl::FrameData* frame_data,
-      DrawResult draw_result) OVERRIDE {
+  DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
+                                   LayerTreeHostImpl::FrameData* frame_data,
+                                   DrawResult draw_result) override {
     EXPECT_EQ(DRAW_SUCCESS, draw_result);
 
     gfx::RectF root_damage_rect;
@@ -590,7 +586,7 @@ class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest {
     return draw_result;
   }
 
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     switch (layer_tree_host()->source_frame_number()) {
       case 1:
         // Test not owning the surface.
@@ -612,7 +608,7 @@ class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest {
     }
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  private:
   FakeContentLayerClient client_;
@@ -632,7 +628,7 @@ class LayerTreeHostTestUndrawnLayersPushContentBoundsLater
   LayerTreeHostTestUndrawnLayersPushContentBoundsLater()
       : root_layer_(Layer::Create()) {}
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     root_layer_->SetIsDrawable(true);
     root_layer_->SetBounds(gfx::Size(20, 20));
     layer_tree_host()->SetRootLayer(root_layer_);
@@ -649,9 +645,9 @@ class LayerTreeHostTestUndrawnLayersPushContentBoundsLater
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
     LayerImpl* root = host_impl->active_tree()->root_layer();
     LayerImpl* parent = root->children()[0];
     LayerImpl* child = parent->children()[0];
@@ -671,7 +667,7 @@ class LayerTreeHostTestUndrawnLayersPushContentBoundsLater
     }
   }
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     switch (layer_tree_host()->source_frame_number()) {
       case 1:
         parent_layer_->SetOpacity(1.0f);
@@ -683,7 +679,7 @@ class LayerTreeHostTestUndrawnLayersPushContentBoundsLater
     }
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  private:
   scoped_refptr<Layer> root_layer_;
@@ -700,21 +696,21 @@ class LayerTreeHostTestCommit : public LayerTreeHostTest {
  public:
   LayerTreeHostTestCommit() {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     layer_tree_host()->SetViewportSize(gfx::Size(20, 20));
     layer_tree_host()->set_background_color(SK_ColorGRAY);
 
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
     EXPECT_EQ(gfx::Size(20, 20), impl->DrawViewportSize());
     EXPECT_EQ(SK_ColorGRAY, impl->active_tree()->background_color());
 
     EndTest();
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 };
 
 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit);
@@ -728,32 +724,34 @@ class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails
   LayerTreeHostTestFrameTimeUpdatesAfterActivationFails()
       : frame_count_with_pending_tree_(0) {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     layer_tree_host()->SetViewportSize(gfx::Size(20, 20));
     layer_tree_host()->set_background_color(SK_ColorGRAY);
 
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void BeginCommitOnThread(LayerTreeHostImpl* impl) override {
     EXPECT_EQ(frame_count_with_pending_tree_, 0);
-    impl->BlockNotifyReadyToActivateForTesting(true);
+    if (impl->settings().impl_side_painting)
+      impl->BlockNotifyReadyToActivateForTesting(true);
   }
 
-  virtual void WillBeginImplFrameOnThread(LayerTreeHostImpl* impl,
-                                          const BeginFrameArgs& args) OVERRIDE {
+  void WillBeginImplFrameOnThread(LayerTreeHostImpl* impl,
+                                  const BeginFrameArgs& args) override {
     if (impl->pending_tree())
       frame_count_with_pending_tree_++;
 
     if (frame_count_with_pending_tree_ == 1) {
       EXPECT_EQ(first_frame_time_.ToInternalValue(), 0);
       first_frame_time_ = impl->CurrentBeginFrameArgs().frame_time;
-    } else if (frame_count_with_pending_tree_ == 2) {
+    } else if (frame_count_with_pending_tree_ == 2 &&
+               impl->settings().impl_side_painting) {
       impl->BlockNotifyReadyToActivateForTesting(false);
     }
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
     if (frame_count_with_pending_tree_ > 1) {
       EXPECT_NE(first_frame_time_.ToInternalValue(), 0);
       EXPECT_NE(first_frame_time_.ToInternalValue(),
@@ -765,19 +763,19 @@ class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails
     EXPECT_FALSE(impl->settings().impl_side_painting);
     EndTest();
   }
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
     if (impl->settings().impl_side_painting)
       EXPECT_NE(frame_count_with_pending_tree_, 1);
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  private:
   int frame_count_with_pending_tree_;
   base::TimeTicks first_frame_time_;
 };
 
-SINGLE_AND_MULTI_THREAD_TEST_F(
+SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(
     LayerTreeHostTestFrameTimeUpdatesAfterActivationFails);
 
 // This test verifies that LayerTreeHostImpl's current frame time gets
@@ -786,14 +784,14 @@ class LayerTreeHostTestFrameTimeUpdatesAfterDraw : public LayerTreeHostTest {
  public:
   LayerTreeHostTestFrameTimeUpdatesAfterDraw() : frame_(0) {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     layer_tree_host()->SetViewportSize(gfx::Size(20, 20));
     layer_tree_host()->set_background_color(SK_ColorGRAY);
 
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
     frame_++;
     if (frame_ == 1) {
       first_frame_time_ = impl->CurrentBeginFrameArgs().frame_time;
@@ -811,7 +809,7 @@ class LayerTreeHostTestFrameTimeUpdatesAfterDraw : public LayerTreeHostTest {
     EndTest();
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
     // Ensure there isn't a commit between the two draws, to ensure that a
     // commit isn't required for updating the current frame time. We can
     // only check for this in the multi-threaded case, since in the single-
@@ -820,7 +818,7 @@ class LayerTreeHostTestFrameTimeUpdatesAfterDraw : public LayerTreeHostTest {
       EXPECT_EQ(0, frame_);
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  private:
   int frame_;
@@ -835,7 +833,7 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest {
  public:
   LayerTreeHostTestStartPageScaleAnimation() {}
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     LayerTreeHostTest::SetupTree();
 
     if (layer_tree_host()->settings().impl_side_painting) {
@@ -852,7 +850,7 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest {
     scroll_layer_->SetIsContainerForFixedPositionLayers(true);
     scroll_layer_->SetBounds(gfx::Size(2 * root_layer->bounds().width(),
                                        2 * root_layer->bounds().height()));
-    scroll_layer_->SetScrollOffset(gfx::Vector2d());
+    scroll_layer_->SetScrollOffset(gfx::ScrollOffset());
     layer_tree_host()->root_layer()->AddChild(scroll_layer_);
     // This test requires the page_scale and inner viewport layers to be
     // identified.
@@ -861,17 +859,18 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest {
     layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f);
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
-                                   float scale,
-                                   float) OVERRIDE {
-    gfx::Vector2d offset = scroll_layer_->scroll_offset();
-    scroll_layer_->SetScrollOffset(offset + scroll_delta);
+  void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta,
+                           float scale,
+                           float) override {
+    gfx::ScrollOffset offset = scroll_layer_->scroll_offset();
+    scroll_layer_->SetScrollOffset(ScrollOffsetWithDelta(offset,
+                                                         scroll_delta));
     layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f);
   }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
     // We get one commit before the first draw, and the animation doesn't happen
     // until the second draw.
     switch (impl->active_tree()->source_frame_number()) {
@@ -891,7 +890,7 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest {
     }
   }
 
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     switch (layer_tree_host()->source_frame_number()) {
       case 1:
         layer_tree_host()->StartPageScaleAnimation(
@@ -900,7 +899,7 @@ class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest {
     }
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   FakeContentLayerClient client_;
   scoped_refptr<Layer> scroll_layer_;
@@ -912,7 +911,7 @@ class LayerTreeHostTestSetVisible : public LayerTreeHostTest {
  public:
   LayerTreeHostTestSetVisible() : num_draws_(0) {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     PostSetNeedsCommitToMainThread();
     PostSetVisibleToMainThread(false);
     // This is suppressed while we're invisible.
@@ -921,13 +920,13 @@ class LayerTreeHostTestSetVisible : public LayerTreeHostTest {
     PostSetVisibleToMainThread(true);
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
     EXPECT_TRUE(impl->visible());
     ++num_draws_;
     EndTest();
   }
 
-  virtual void AfterTest() OVERRIDE { EXPECT_EQ(1, num_draws_); }
+  void AfterTest() override { EXPECT_EQ(1, num_draws_); }
 
  private:
   int num_draws_;
@@ -941,16 +940,16 @@ class TestOpacityChangeLayerDelegate : public ContentLayerClient {
 
   void SetTestLayer(Layer* test_layer) { test_layer_ = test_layer; }
 
-  virtual void PaintContents(
+  void PaintContents(
       SkCanvas* canvas,
       const gfx::Rect& clip,
-      ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE {
+      ContentLayerClient::GraphicsContextStatus gc_status) override {
     // Set layer opacity to 0.
     if (test_layer_)
       test_layer_->SetOpacity(0.f);
   }
-  virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
-  virtual bool FillsBoundsCompletely() const OVERRIDE { return false; }
+  void DidChangeLayerCanUseLCDText() override {}
+  bool FillsBoundsCompletely() const override { return false; }
 
  private:
   Layer* test_layer_;
@@ -966,8 +965,8 @@ class ContentLayerWithUpdateTracking : public ContentLayer {
   int PaintContentsCount() { return paint_contents_count_; }
   void ResetPaintContentsCount() { paint_contents_count_ = 0; }
 
-  virtual bool Update(ResourceUpdateQueue* queue,
-                      const OcclusionTracker<Layer>* occlusion) OVERRIDE {
+  bool Update(ResourceUpdateQueue* queue,
+              const OcclusionTracker<Layer>* occlusion) override {
     bool updated = ContentLayer::Update(queue, occlusion);
     paint_contents_count_++;
     return updated;
@@ -979,7 +978,7 @@ class ContentLayerWithUpdateTracking : public ContentLayer {
     SetBounds(gfx::Size(10, 10));
     SetIsDrawable(true);
   }
-  virtual ~ContentLayerWithUpdateTracking() {}
+  ~ContentLayerWithUpdateTracking() override {}
 
   int paint_contents_count_;
 };
@@ -995,18 +994,16 @@ class LayerTreeHostTestOpacityChange : public LayerTreeHostTest {
     test_opacity_change_delegate_.SetTestLayer(update_check_layer_.get());
   }
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     layer_tree_host()->SetViewportSize(gfx::Size(10, 10));
     layer_tree_host()->root_layer()->AddChild(update_check_layer_);
 
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
-    EndTest();
-  }
+  void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { EndTest(); }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     // Update() should have been called once.
     EXPECT_EQ(1, update_check_layer_->PaintContentsCount());
   }
@@ -1024,10 +1021,10 @@ class NoScaleContentLayer : public ContentLayer {
     return make_scoped_refptr(new NoScaleContentLayer(client));
   }
 
-  virtual void CalculateContentsScale(float ideal_contents_scale,
-                                      float* contents_scale_x,
-                                      float* contents_scale_y,
-                                      gfx::Size* contentBounds) OVERRIDE {
+  void CalculateContentsScale(float ideal_contents_scale,
+                              float* contents_scale_x,
+                              float* contents_scale_y,
+                              gfx::Size* contentBounds) override {
     // Skip over the ContentLayer's method to the base Layer class.
     Layer::CalculateContentsScale(ideal_contents_scale,
                                   contents_scale_x,
@@ -1038,7 +1035,7 @@ class NoScaleContentLayer : public ContentLayer {
  private:
   explicit NoScaleContentLayer(ContentLayerClient* client)
       : ContentLayer(client) {}
-  virtual ~NoScaleContentLayer() {}
+  ~NoScaleContentLayer() override {}
 };
 
 class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers
@@ -1048,7 +1045,7 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers
       : root_layer_(NoScaleContentLayer::Create(&client_)),
         child_layer_(ContentLayer::Create(&client_)) {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     layer_tree_host()->SetViewportSize(gfx::Size(60, 60));
     layer_tree_host()->SetDeviceScaleFactor(1.5);
     EXPECT_EQ(gfx::Size(60, 60), layer_tree_host()->device_viewport_size());
@@ -1067,7 +1064,7 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
     // Should only do one commit.
     EXPECT_EQ(0, impl->active_tree()->source_frame_number());
     // Device scale factor should come over to impl.
@@ -1133,7 +1130,7 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers
     EndTest();
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  private:
   FakeContentLayerClient client_;
@@ -1146,7 +1143,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers);
 // Verify atomicity of commits and reuse of textures.
 class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest {
  public:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->texture_id_allocation_chunk_size = 1;
     // Make sure partial texture updates are turned off.
     settings->max_partial_texture_updates = 0;
@@ -1154,7 +1151,7 @@ class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest {
     settings->scrollbar_animator = LayerTreeSettings::NoAnimator;
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     layer_ = FakeContentLayer::Create(&client_);
     layer_->SetBounds(gfx::Size(10, 20));
 
@@ -1171,12 +1168,12 @@ class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest {
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     drew_frame_ = -1;
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
     ASSERT_EQ(0u, layer_tree_host()->settings().max_partial_texture_updates);
 
     TestWebGraphicsContext3D* context = TestContext();
@@ -1217,7 +1214,7 @@ class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest {
     }
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
     TestWebGraphicsContext3D* context = TestContext();
 
     if (drew_frame_ == impl->active_tree()->source_frame_number()) {
@@ -1234,12 +1231,12 @@ class LayerTreeHostTestDirectRendererAtomicCommit : public LayerTreeHostTest {
       PostSetNeedsCommitToMainThread();
   }
 
-  virtual void Layout() OVERRIDE {
+  void Layout() override {
     layer_->SetNeedsDisplay();
     scrollbar_->SetNeedsDisplay();
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  protected:
   FakeContentLayerClient client_;
@@ -1254,7 +1251,7 @@ MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(
 class LayerTreeHostTestDelegatingRendererAtomicCommit
     : public LayerTreeHostTestDirectRendererAtomicCommit {
  public:
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
     ASSERT_EQ(0u, layer_tree_host()->settings().max_partial_texture_updates);
 
     TestWebGraphicsContext3D* context = TestContext();
@@ -1321,7 +1318,7 @@ static void SetLayerPropertiesForTesting(Layer* layer,
 class LayerTreeHostTestAtomicCommitWithPartialUpdate
     : public LayerTreeHostTest {
  public:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->texture_id_allocation_chunk_size = 1;
     // Allow one partial texture update.
     settings->max_partial_texture_updates = 1;
@@ -1329,7 +1326,7 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate
     settings->impl_side_painting = false;
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     parent_ = FakeContentLayer::Create(&client_);
     parent_->SetBounds(gfx::Size(10, 20));
 
@@ -1343,9 +1340,9 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     switch (layer_tree_host()->source_frame_number()) {
       case 1:
         parent_->SetNeedsDisplay();
@@ -1353,8 +1350,8 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate
         break;
       case 2:
         // Damage part of layers.
-        parent_->SetNeedsDisplayRect(gfx::RectF(0.f, 0.f, 5.f, 5.f));
-        child_->SetNeedsDisplayRect(gfx::RectF(0.f, 0.f, 5.f, 5.f));
+        parent_->SetNeedsDisplayRect(gfx::Rect(5, 5));
+        child_->SetNeedsDisplayRect(gfx::Rect(5, 5));
         break;
       case 3:
         child_->SetNeedsDisplay();
@@ -1372,7 +1369,7 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate
     }
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
     ASSERT_EQ(1u, layer_tree_host()->settings().max_partial_texture_updates);
 
     TestWebGraphicsContext3D* context = TestContext();
@@ -1462,7 +1459,7 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate
     }
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
     EXPECT_LT(impl->active_tree()->source_frame_number(), 5);
 
     TestWebGraphicsContext3D* context = TestContext();
@@ -1479,7 +1476,7 @@ class LayerTreeHostTestAtomicCommitWithPartialUpdate
     context->ResetUsedTextures();
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  private:
   FakeContentLayerClient client_;
@@ -1494,7 +1491,7 @@ SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
 class LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit
     : public LayerTreeHostTest {
  protected:
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     root_layer_ = FakeContentLayer::Create(&client_);
     root_layer_->SetBounds(gfx::Size(100, 100));
 
@@ -1520,9 +1517,9 @@ class LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
     Renderer* renderer = host_impl->renderer();
     RenderPassId surface1_render_pass_id = host_impl->active_tree()
                                                ->root_layer()
@@ -1559,12 +1556,12 @@ class LayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit
     }
   }
 
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     if (layer_tree_host()->source_frame_number() < 2)
       root_layer_->SetNeedsDisplay();
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     EXPECT_LE(2u, root_layer_->update_count());
     EXPECT_LE(2u, surface_layer1_->update_count());
     EXPECT_LE(2u, surface_layer2_->update_count());
@@ -1588,14 +1585,12 @@ class EvictionTestLayer : public Layer {
     return make_scoped_refptr(new EvictionTestLayer());
   }
 
-  virtual bool Update(ResourceUpdateQueue*,
-                      const OcclusionTracker<Layer>*) OVERRIDE;
-  virtual bool DrawsContent() const OVERRIDE { return true; }
+  bool Update(ResourceUpdateQueue*, const OcclusionTracker<Layer>*) override;
+  bool DrawsContent() const override { return true; }
 
-  virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
-      OVERRIDE;
-  virtual void PushPropertiesTo(LayerImpl* impl) OVERRIDE;
-  virtual void SetTexturePriorities(const PriorityCalculator&) OVERRIDE;
+  scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
+  void PushPropertiesTo(LayerImpl* impl) override;
+  void SetTexturePriorities(const PriorityCalculator&) override;
 
   bool HaveBackingTexture() const {
     return texture_.get() ? texture_->have_backing_texture() : false;
@@ -1603,7 +1598,7 @@ class EvictionTestLayer : public Layer {
 
  private:
   EvictionTestLayer() : Layer() {}
-  virtual ~EvictionTestLayer() {}
+  ~EvictionTestLayer() override {}
 
   void CreateTextureIfNeeded() {
     if (texture_)
@@ -1624,11 +1619,11 @@ class EvictionTestLayerImpl : public LayerImpl {
                                                   int id) {
     return make_scoped_ptr(new EvictionTestLayerImpl(tree_impl, id));
   }
-  virtual ~EvictionTestLayerImpl() {}
+  ~EvictionTestLayerImpl() override {}
 
-  virtual void AppendQuads(RenderPass* render_pass,
-                           const OcclusionTracker<LayerImpl>& occlusion_tracker,
-                           AppendQuadsData* append_quads_data) OVERRIDE {
+  void AppendQuads(RenderPass* render_pass,
+                   const Occlusion& occlusion_in_content_space,
+                   AppendQuadsData* append_quads_data) override {
     ASSERT_TRUE(has_texture_);
     ASSERT_NE(0u, layer_tree_impl()->resource_provider()->num_resources());
   }
@@ -1664,8 +1659,7 @@ bool EvictionTestLayer::Update(ResourceUpdateQueue* queue,
 
 scoped_ptr<LayerImpl> EvictionTestLayer::CreateLayerImpl(
     LayerTreeImpl* tree_impl) {
-  return EvictionTestLayerImpl::Create(tree_impl, layer_id_)
-      .PassAs<LayerImpl>();
+  return EvictionTestLayerImpl::Create(tree_impl, layer_id_);
 }
 
 void EvictionTestLayer::PushPropertiesTo(LayerImpl* layer_impl) {
@@ -1683,7 +1677,7 @@ class LayerTreeHostTestEvictTextures : public LayerTreeHostTest {
         impl_for_evict_textures_(0),
         num_commits_(0) {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     layer_tree_host()->SetRootLayer(layer_);
     layer_tree_host()->SetViewportSize(gfx::Size(10, 20));
 
@@ -1733,7 +1727,7 @@ class LayerTreeHostTestEvictTextures : public LayerTreeHostTest {
   // the beginFrame/commit pair.
   // Commits 5+6 test the path where an eviction happens during the eviction
   // recovery path.
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     switch (num_commits_) {
       case 1:
         EXPECT_TRUE(layer_->HaveBackingTexture());
@@ -1761,11 +1755,11 @@ class LayerTreeHostTestEvictTextures : public LayerTreeHostTest {
     }
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
     impl_for_evict_textures_ = impl;
   }
 
-  virtual void Layout() OVERRIDE {
+  void Layout() override {
     ++num_commits_;
     switch (num_commits_) {
       case 1:
@@ -1794,7 +1788,7 @@ class LayerTreeHostTestEvictTextures : public LayerTreeHostTest {
     }
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  private:
   FakeContentLayerClient client_;
@@ -1810,7 +1804,7 @@ class LayerTreeHostTestContinuousInvalidate : public LayerTreeHostTest {
   LayerTreeHostTestContinuousInvalidate()
       : num_commit_complete_(0), num_draw_layers_(0) {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     layer_tree_host()->SetViewportSize(gfx::Size(10, 10));
     layer_tree_host()->root_layer()->SetBounds(gfx::Size(10, 10));
 
@@ -1823,24 +1817,24 @@ class LayerTreeHostTestContinuousInvalidate : public LayerTreeHostTest {
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     if (num_draw_layers_ == 2)
       return;
     content_layer_->SetNeedsDisplay();
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
     if (num_draw_layers_ == 1)
       num_commit_complete_++;
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
     num_draw_layers_++;
     if (num_draw_layers_ == 2)
       EndTest();
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     // Check that we didn't commit twice between first and second draw.
     EXPECT_EQ(1, num_commit_complete_);
   }
@@ -1859,14 +1853,14 @@ class LayerTreeHostTestDeferCommits : public LayerTreeHostTest {
   LayerTreeHostTestDeferCommits()
       : num_commits_deferred_(0), num_complete_commits_(0) {}
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidDeferCommit() OVERRIDE {
+  void DidDeferCommit() override {
     num_commits_deferred_++;
     layer_tree_host()->SetDeferCommits(false);
   }
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     num_complete_commits_++;
     switch (num_complete_commits_) {
       case 1:
@@ -1883,7 +1877,7 @@ class LayerTreeHostTestDeferCommits : public LayerTreeHostTest {
     }
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     EXPECT_EQ(1, num_commits_deferred_);
     EXPECT_EQ(2, num_complete_commits_);
   }
@@ -1900,10 +1894,10 @@ class LayerTreeHostWithProxy : public LayerTreeHost {
   LayerTreeHostWithProxy(FakeLayerTreeHostClient* client,
                          const LayerTreeSettings& settings,
                          scoped_ptr<FakeProxy> proxy)
-      : LayerTreeHost(client, NULL, settings) {
+      : LayerTreeHost(client, NULL, NULL, settings) {
     proxy->SetLayerTreeHost(this);
     client->SetLayerTreeHost(this);
-    InitializeForTesting(proxy.PassAs<Proxy>());
+    InitializeForTesting(proxy.Pass());
   }
 };
 
@@ -1975,6 +1969,7 @@ TEST(LayerTreeHostTest, PartialUpdatesWithGLRenderer) {
       LayerTreeHost::CreateSingleThreaded(&client,
                                           &client,
                                           shared_bitmap_manager.get(),
+                                          NULL,
                                           settings,
                                           base::MessageLoopProxy::current());
   client.SetLayerTreeHost(host.get());
@@ -1996,6 +1991,7 @@ TEST(LayerTreeHostTest, PartialUpdatesWithSoftwareRenderer) {
       LayerTreeHost::CreateSingleThreaded(&client,
                                           &client,
                                           shared_bitmap_manager.get(),
+                                          NULL,
                                           settings,
                                           base::MessageLoopProxy::current());
   client.SetLayerTreeHost(host.get());
@@ -2017,6 +2013,7 @@ TEST(LayerTreeHostTest, PartialUpdatesWithDelegatingRendererAndGLContent) {
       LayerTreeHost::CreateSingleThreaded(&client,
                                           &client,
                                           shared_bitmap_manager.get(),
+                                          NULL,
                                           settings,
                                           base::MessageLoopProxy::current());
   client.SetLayerTreeHost(host.get());
@@ -2039,6 +2036,7 @@ TEST(LayerTreeHostTest,
       LayerTreeHost::CreateSingleThreaded(&client,
                                           &client,
                                           shared_bitmap_manager.get(),
+                                          NULL,
                                           settings,
                                           base::MessageLoopProxy::current());
   client.SetLayerTreeHost(host.get());
@@ -2056,7 +2054,7 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted
         child_layer2_(FakeContentLayer::Create(&client_)),
         num_commits_(0) {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     layer_tree_host()->SetViewportSize(gfx::Size(100, 100));
     root_layer_->SetBounds(gfx::Size(100, 100));
     child_layer1_->SetBounds(gfx::Size(100, 100));
@@ -2067,8 +2065,8 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl,
-                                       bool visible) OVERRIDE {
+  void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl,
+                               bool visible) override {
     if (visible) {
       // One backing should remain unevicted.
       EXPECT_EQ(
@@ -2086,7 +2084,7 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted
     EndTest();
   }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
     ++num_commits_;
     switch (num_commits_) {
       case 1:
@@ -2118,7 +2116,7 @@ class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted
     }
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  private:
   FakeContentLayerClient client_;
@@ -2142,17 +2140,17 @@ class LayerTreeHostTestLCDNotification : public LayerTreeHostTest {
     int paint_count() const { return paint_count_; }
     int lcd_notification_count() const { return lcd_notification_count_; }
 
-    virtual void PaintContents(
+    void PaintContents(
         SkCanvas* canvas,
         const gfx::Rect& clip,
-        ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE {
+        ContentLayerClient::GraphicsContextStatus gc_status) override {
       ++paint_count_;
     }
-    virtual void DidChangeLayerCanUseLCDText() OVERRIDE {
+    void DidChangeLayerCanUseLCDText() override {
       ++lcd_notification_count_;
       layer_->SetNeedsDisplay();
     }
-    virtual bool FillsBoundsCompletely() const OVERRIDE { return false; }
+    bool FillsBoundsCompletely() const override { return false; }
 
    private:
     Layer* layer_;
@@ -2160,7 +2158,7 @@ class LayerTreeHostTestLCDNotification : public LayerTreeHostTest {
     int lcd_notification_count_;
   };
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     scoped_refptr<Layer> root_layer;
     if (layer_tree_host()->settings().impl_side_painting)
       root_layer = PictureLayer::Create(&client_);
@@ -2180,10 +2178,10 @@ class LayerTreeHostTestLCDNotification : public LayerTreeHostTest {
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
-  virtual void AfterTest() OVERRIDE {}
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
+  void AfterTest() override {}
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     switch (layer_tree_host()->source_frame_number()) {
       case 1:
         // The first update consists of one LCD notification and one paint.
@@ -2228,25 +2226,24 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestLCDNotification);
 // Verify that the BeginFrame notification is used to initiate rendering.
 class LayerTreeHostTestBeginFrameNotification : public LayerTreeHostTest {
  public:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->begin_frame_scheduling_enabled = true;
   }
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     // This will trigger a SetNeedsBeginFrame which will trigger a
     // BeginFrame.
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual DrawResult PrepareToDrawOnThread(
-      LayerTreeHostImpl* host_impl,
-      LayerTreeHostImpl::FrameData* frame,
-      DrawResult draw_result) OVERRIDE {
+  DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
+                                   LayerTreeHostImpl::FrameData* frame,
+                                   DrawResult draw_result) override {
     EndTest();
     return DRAW_SUCCESS;
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  private:
   base::TimeTicks frame_time_;
@@ -2257,14 +2254,14 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestBeginFrameNotification);
 class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled
     : public LayerTreeHostTest {
  public:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->begin_frame_scheduling_enabled = true;
     settings->using_synchronous_renderer_compositor = true;
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
     // The BeginFrame notification is turned off now but will get enabled
     // once we return. End test while it's enabled.
     ImplThreadTaskRunner()->PostTask(
@@ -2273,7 +2270,7 @@ class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled
                    base::Unretained(this)));
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 };
 
 MULTI_THREAD_TEST_F(
@@ -2284,13 +2281,13 @@ class LayerTreeHostTestAbortedCommitDoesntStall : public LayerTreeHostTest {
   LayerTreeHostTestAbortedCommitDoesntStall()
       : commit_count_(0), commit_abort_count_(0), commit_complete_count_(0) {}
 
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->begin_frame_scheduling_enabled = true;
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     commit_count_++;
     if (commit_count_ == 4) {
       // After two aborted commits, request a real commit now to make sure a
@@ -2300,14 +2297,14 @@ class LayerTreeHostTestAbortedCommitDoesntStall : public LayerTreeHostTest {
     }
   }
 
-  virtual void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl,
-                                             bool did_handle) OVERRIDE {
+  void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl,
+                                     bool did_handle) override {
     commit_abort_count_++;
     // Initiate another abortable commit.
     host_impl->SetNeedsCommit();
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
     commit_complete_count_++;
     if (commit_complete_count_ == 1) {
       // Initiate an abortable commit after the first commit.
@@ -2317,7 +2314,7 @@ class LayerTreeHostTestAbortedCommitDoesntStall : public LayerTreeHostTest {
     }
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     EXPECT_EQ(commit_count_, 5);
     EXPECT_EQ(commit_abort_count_, 3);
     EXPECT_EQ(commit_complete_count_, 2);
@@ -2330,7 +2327,7 @@ class LayerTreeHostTestAbortedCommitDoesntStall : public LayerTreeHostTest {
 
 class LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor
     : public LayerTreeHostTestAbortedCommitDoesntStall {
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings);
     settings->using_synchronous_renderer_compositor = true;
   }
@@ -2341,7 +2338,7 @@ MULTI_THREAD_TEST_F(
 
 class LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync
     : public LayerTreeHostTestAbortedCommitDoesntStall {
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     LayerTreeHostTestAbortedCommitDoesntStall::InitializeSettings(settings);
     settings->throttle_frame_production = false;
   }
@@ -2352,11 +2349,11 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestAbortedCommitDoesntStallDisabledVsync);
 class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation
     : public LayerTreeHostTest {
  protected:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->impl_side_painting = true;
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     LayerTreeHostTest::SetupTree();
 
     scoped_refptr<Layer> layer = PictureLayer::Create(&client_);
@@ -2365,13 +2362,13 @@ class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation
     layer_tree_host()->root_layer()->AddChild(layer);
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
     EndTest();
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   FakeContentLayerClient client_;
 };
@@ -2388,16 +2385,16 @@ class LayerTreeHostTestChangeLayerPropertiesInPaintContents
 
     void set_layer(Layer* layer) { layer_ = layer; }
 
-    virtual void PaintContents(
+    void PaintContents(
         SkCanvas* canvas,
         const gfx::Rect& clip,
-        ContentLayerClient::GraphicsContextStatus gc_status) OVERRIDE {
+        ContentLayerClient::GraphicsContextStatus gc_status) override {
       layer_->SetBounds(gfx::Size(2, 2));
     }
 
-    virtual void DidChangeLayerCanUseLCDText() OVERRIDE {}
+    void DidChangeLayerCanUseLCDText() override {}
 
-    virtual bool FillsBoundsCompletely() const OVERRIDE { return false; }
+    bool FillsBoundsCompletely() const override { return false; }
 
    private:
     Layer* layer_;
@@ -2405,21 +2402,27 @@ class LayerTreeHostTestChangeLayerPropertiesInPaintContents
 
   LayerTreeHostTestChangeLayerPropertiesInPaintContents() : num_commits_(0) {}
 
-  virtual void SetupTree() OVERRIDE {
-    scoped_refptr<ContentLayer> root_layer = ContentLayer::Create(&client_);
+  void SetupTree() override {
+    if (layer_tree_host()->settings().impl_side_painting) {
+      scoped_refptr<PictureLayer> root_layer = PictureLayer::Create(&client_);
+      layer_tree_host()->SetRootLayer(root_layer);
+    } else {
+      scoped_refptr<ContentLayer> root_layer = ContentLayer::Create(&client_);
+      layer_tree_host()->SetRootLayer(root_layer);
+    }
+    Layer* root_layer = layer_tree_host()->root_layer();
     root_layer->SetIsDrawable(true);
     root_layer->SetBounds(gfx::Size(1, 1));
 
-    layer_tree_host()->SetRootLayer(root_layer);
-    client_.set_layer(root_layer.get());
+    client_.set_layer(root_layer);
 
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
-  virtual void AfterTest() OVERRIDE {}
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
+  void AfterTest() override {}
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
     num_commits_++;
     if (num_commits_ == 1) {
       LayerImpl* root_layer = host_impl->active_tree()->root_layer();
@@ -2436,7 +2439,8 @@ class LayerTreeHostTestChangeLayerPropertiesInPaintContents
   int num_commits_;
 };
 
-SINGLE_THREAD_TEST_F(LayerTreeHostTestChangeLayerPropertiesInPaintContents);
+SINGLE_AND_MULTI_THREAD_TEST_F(
+    LayerTreeHostTestChangeLayerPropertiesInPaintContents);
 
 class MockIOSurfaceWebGraphicsContext3D : public TestWebGraphicsContext3D {
  public:
@@ -2445,7 +2449,7 @@ class MockIOSurfaceWebGraphicsContext3D : public TestWebGraphicsContext3D {
     test_capabilities_.gpu.texture_rectangle = true;
   }
 
-  virtual GLuint createTexture() OVERRIDE {
+  virtual GLuint createTexture() override {
     return 1;
   }
   MOCK_METHOD1(activeTexture, void(GLenum texture));
@@ -2470,22 +2474,19 @@ class MockIOSurfaceWebGraphicsContext3D : public TestWebGraphicsContext3D {
 
 class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest {
  protected:
-  virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
-      OVERRIDE {
+  scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(
+      bool fallback) override {
     scoped_ptr<MockIOSurfaceWebGraphicsContext3D> mock_context_owned(
         new MockIOSurfaceWebGraphicsContext3D);
     mock_context_ = mock_context_owned.get();
 
-    if (delegating_renderer()) {
-      return FakeOutputSurface::CreateDelegating3d(
-          mock_context_owned.PassAs<TestWebGraphicsContext3D>());
-    } else {
-      return FakeOutputSurface::Create3d(
-          mock_context_owned.PassAs<TestWebGraphicsContext3D>());
-    }
+    if (delegating_renderer())
+      return FakeOutputSurface::CreateDelegating3d(mock_context_owned.Pass());
+    else
+      return FakeOutputSurface::Create3d(mock_context_owned.Pass());
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     LayerTreeHostTest::SetupTree();
 
     layer_tree_host()->root_layer()->SetIsDrawable(false);
@@ -2501,9 +2502,9 @@ class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest {
     layer_tree_host()->root_layer()->AddChild(io_surface_layer);
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
     EXPECT_EQ(0u, host_impl->resource_provider()->num_resources());
     // In WillDraw, the IOSurfaceLayer sets up the io surface texture.
 
@@ -2541,10 +2542,9 @@ class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest {
     EXPECT_CALL(*mock_context_, bindTexture(_, 0)).Times(AnyNumber());
   }
 
-  virtual DrawResult PrepareToDrawOnThread(
-      LayerTreeHostImpl* host_impl,
-      LayerTreeHostImpl::FrameData* frame,
-      DrawResult draw_result) OVERRIDE {
+  DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
+                                   LayerTreeHostImpl::FrameData* frame,
+                                   DrawResult draw_result) override {
     Mock::VerifyAndClearExpectations(&mock_context_);
     ResourceProvider* resource_provider = host_impl->resource_provider();
     EXPECT_EQ(1u, resource_provider->num_resources());
@@ -2576,14 +2576,14 @@ class LayerTreeHostTestIOSurfaceDrawing : public LayerTreeHostTest {
     return draw_result;
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
     Mock::VerifyAndClearExpectations(&mock_context_);
 
     EXPECT_CALL(*mock_context_, deleteTexture(1)).Times(AtLeast(1));
     EndTest();
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   int io_surface_id_;
   MockIOSurfaceWebGraphicsContext3D* mock_context_;
@@ -2594,7 +2594,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestIOSurfaceDrawing);
 
 class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest {
  public:
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     frame_ = 0;
     PostSetNeedsCommitToMainThread();
   }
@@ -2603,7 +2603,7 @@ class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest {
   // Round 2: commit only (no draw/swap)
   // Round 3: draw only (no commit)
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     int commit = layer_tree_host()->source_frame_number();
     switch (commit) {
       case 2:
@@ -2614,7 +2614,7 @@ class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest {
     }
   }
 
-  virtual void DidCompleteSwapBuffers() OVERRIDE {
+  void DidCompleteSwapBuffers() override {
     int commit = layer_tree_host()->source_frame_number();
     ++frame_;
     switch (frame_) {
@@ -2631,7 +2631,7 @@ class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest {
     }
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  protected:
   int frame_;
@@ -2648,12 +2648,12 @@ TEST_F(LayerTreeHostTestNumFramesPending, DISABLED_GLRenderer) {
 
 class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
  public:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     // PictureLayer can only be used with impl side painting enabled.
     settings->impl_side_painting = true;
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     layer_ = FakePictureLayer::Create(&client_);
     // Force commits to not be aborted so new frames get drawn, otherwise
     // the renderer gets deferred initialized but nothing new needs drawing.
@@ -2662,15 +2662,15 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     did_initialize_gl_ = false;
     did_release_gl_ = false;
     last_source_frame_number_drawn_ = -1;  // Never drawn.
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
-      OVERRIDE {
+  scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(
+      bool fallback) override {
     scoped_ptr<TestWebGraphicsContext3D> context3d(
         TestWebGraphicsContext3D::Create());
 
@@ -2679,7 +2679,7 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
         delegating_renderer());
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override {
     ASSERT_TRUE(host_impl->RootLayer());
     FakePictureLayerImpl* layer_impl =
         static_cast<FakePictureLayerImpl*>(host_impl->RootLayer());
@@ -2735,8 +2735,7 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
     did_release_gl_ = true;
   }
 
-  virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl,
-                                   bool result) OVERRIDE {
+  void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override {
     ASSERT_TRUE(result);
     DelegatedFrameData* delegated_frame_data =
         output_surface()->last_sent_frame().delegated_frame_data.get();
@@ -2753,7 +2752,7 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest {
     host_impl->ReclaimResources(&ack);
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     EXPECT_TRUE(did_initialize_gl_);
     EXPECT_TRUE(did_release_gl_);
   }
@@ -2770,7 +2769,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize);
 
 class LayerTreeHostTestDeferredInitializeWithGpuRasterization
     : public LayerTreeHostTestDeferredInitialize {
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     // PictureLayer can only be used with impl side painting enabled.
     settings->impl_side_painting = true;
     settings->gpu_rasterization_enabled = true;
@@ -2785,13 +2784,13 @@ class LayerTreeHostTestUIResource : public LayerTreeHostTest {
  public:
   LayerTreeHostTestUIResource() : num_ui_resources_(0) {}
 
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->texture_id_allocation_chunk_size = 1;
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     int frame = layer_tree_host()->source_frame_number();
     switch (frame) {
       case 1:
@@ -2852,23 +2851,23 @@ class LayerTreeHostTestUIResource : public LayerTreeHostTest {
     }
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
     if (!layer_tree_host()->settings().impl_side_painting)
       PerformTest(impl);
   }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
     if (layer_tree_host()->settings().impl_side_painting)
       PerformTest(impl);
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  private:
   // Must clear all resources before exiting.
   void ClearResources() {
     for (int i = 0; i < num_ui_resources_; i++)
-      ui_resources_[i].reset();
+      ui_resources_[i] = nullptr;
   }
 
   void CreateResource() {
@@ -2889,9 +2888,9 @@ class PushPropertiesCountingLayerImpl : public LayerImpl {
     return make_scoped_ptr(new PushPropertiesCountingLayerImpl(tree_impl, id));
   }
 
-  virtual ~PushPropertiesCountingLayerImpl() {}
+  ~PushPropertiesCountingLayerImpl() override {}
 
-  virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE {
+  void PushPropertiesTo(LayerImpl* layer) override {
     LayerImpl::PushPropertiesTo(layer);
     push_properties_count_++;
     // Push state to the active tree because we can only access it from there.
@@ -2899,10 +2898,8 @@ class PushPropertiesCountingLayerImpl : public LayerImpl {
         layer)->push_properties_count_ = push_properties_count_;
   }
 
-  virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
-      OVERRIDE {
-    return PushPropertiesCountingLayerImpl::Create(tree_impl, id()).
-        PassAs<LayerImpl>();
+  scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override {
+    return PushPropertiesCountingLayerImpl::Create(tree_impl, id());
   }
 
   size_t push_properties_count() const { return push_properties_count_; }
@@ -2924,17 +2921,15 @@ class PushPropertiesCountingLayer : public Layer {
     return new PushPropertiesCountingLayer();
   }
 
-  virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE {
+  void PushPropertiesTo(LayerImpl* layer) override {
     Layer::PushPropertiesTo(layer);
     push_properties_count_++;
     if (persist_needs_push_properties_)
       needs_push_properties_ = true;
   }
 
-  virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
-      OVERRIDE {
-    return PushPropertiesCountingLayerImpl::Create(tree_impl, id()).
-        PassAs<LayerImpl>();
+  scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override {
+    return PushPropertiesCountingLayerImpl::Create(tree_impl, id());
   }
 
   void SetDrawsContent(bool draws_content) { SetIsDrawable(draws_content); }
@@ -2951,7 +2946,7 @@ class PushPropertiesCountingLayer : public Layer {
       : push_properties_count_(0), persist_needs_push_properties_(false) {
     SetBounds(gfx::Size(1, 1));
   }
-  virtual ~PushPropertiesCountingLayer() {}
+  ~PushPropertiesCountingLayer() override {}
 
   size_t push_properties_count_;
   bool persist_needs_push_properties_;
@@ -2959,7 +2954,7 @@ class PushPropertiesCountingLayer : public Layer {
 
 class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest {
  protected:
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     num_commits_ = 0;
     expected_push_properties_root_ = 0;
     expected_push_properties_child_ = 0;
@@ -2970,7 +2965,7 @@ class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest {
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     root_ = PushPropertiesCountingLayer::Create();
     child_ = PushPropertiesCountingLayer::Create();
     child2_ = PushPropertiesCountingLayer::Create();
@@ -2989,7 +2984,7 @@ class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest {
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     ++num_commits_;
 
     EXPECT_EQ(expected_push_properties_root_, root_->push_properties_count());
@@ -3129,7 +3124,7 @@ class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest {
       ++expected_push_properties_leaf_layer_;
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   int num_commits_;
   FakeContentLayerClient client_;
@@ -3152,7 +3147,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestLayersPushProperties);
 class LayerTreeHostTestImplLayersPushProperties
     : public LayerTreeHostTestLayersPushProperties {
  protected:
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     expected_push_properties_root_impl_ = 0;
     expected_push_properties_child_impl_ = 0;
     expected_push_properties_grandchild_impl_ = 0;
@@ -3161,7 +3156,7 @@ class LayerTreeHostTestImplLayersPushProperties
     LayerTreeHostTestLayersPushProperties::BeginTest();
   }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
     // These commits are in response to the changes made in
     // LayerTreeHostTestLayersPushProperties::DidCommitAndDrawFrame()
     switch (num_commits_) {
@@ -3352,9 +3347,9 @@ TEST_F(LayerTreeHostTestImplLayersPushProperties, DelegatingRenderer) {
 class LayerTreeHostTestPropertyChangesDuringUpdateArePushed
     : public LayerTreeHostTest {
  protected:
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     root_ = Layer::Create();
     root_->SetBounds(gfx::Size(1, 1));
 
@@ -3369,7 +3364,7 @@ class LayerTreeHostTestPropertyChangesDuringUpdateArePushed
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     switch (layer_tree_host()->source_frame_number()) {
       case 0:
         break;
@@ -3378,7 +3373,7 @@ class LayerTreeHostTestPropertyChangesDuringUpdateArePushed
         // avoid causing a second commit to be scheduled. If a property change
         // is made during this, however, it needs to be pushed in the upcoming
         // commit.
-        scoped_ptr<base::AutoReset<bool> > ignore =
+        scoped_ptr<base::AutoReset<bool>> ignore =
             scrollbar_layer_->IgnoreSetNeedsCommit();
 
         scrollbar_layer_->SetBounds(gfx::Size(30, 30));
@@ -3398,7 +3393,7 @@ class LayerTreeHostTestPropertyChangesDuringUpdateArePushed
     }
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   scoped_refptr<Layer> root_;
   scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer_;
@@ -3408,9 +3403,9 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestPropertyChangesDuringUpdateArePushed);
 
 class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest {
  protected:
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     root_ = PushPropertiesCountingLayer::Create();
     child_ = PushPropertiesCountingLayer::Create();
     root_->AddChild(child_);
@@ -3419,7 +3414,7 @@ class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest {
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     switch (layer_tree_host()->source_frame_number()) {
       case 0:
         break;
@@ -3451,7 +3446,7 @@ class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest {
     }
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   scoped_refptr<PushPropertiesCountingLayer> root_;
   scoped_refptr<PushPropertiesCountingLayer> child_;
@@ -3462,7 +3457,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestSetDrawableCausesCommit);
 class LayerTreeHostTestCasePushPropertiesThreeGrandChildren
     : public LayerTreeHostTest {
  protected:
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     expected_push_properties_root_ = 0;
     expected_push_properties_child_ = 0;
     expected_push_properties_grandchild1_ = 0;
@@ -3471,7 +3466,7 @@ class LayerTreeHostTestCasePushPropertiesThreeGrandChildren
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     root_ = PushPropertiesCountingLayer::Create();
     child_ = PushPropertiesCountingLayer::Create();
     grandchild1_ = PushPropertiesCountingLayer::Create();
@@ -3487,7 +3482,7 @@ class LayerTreeHostTestCasePushPropertiesThreeGrandChildren
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   FakeContentLayerClient client_;
   scoped_refptr<PushPropertiesCountingLayer> root_;
@@ -3505,7 +3500,7 @@ class LayerTreeHostTestCasePushPropertiesThreeGrandChildren
 class LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush
     : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
  protected:
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
     switch (last_source_frame_number) {
       case 0:
@@ -3545,7 +3540,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush);
 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion
     : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
  protected:
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
     switch (last_source_frame_number) {
       case 0:
@@ -3628,7 +3623,7 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion);
 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence
     : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
  protected:
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
     switch (last_source_frame_number) {
       case 0:
@@ -3676,7 +3671,7 @@ MULTI_THREAD_TEST_F(
 class LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree
     : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
  protected:
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
     switch (last_source_frame_number) {
       case 0:
@@ -3744,7 +3739,7 @@ MULTI_THREAD_TEST_F(
 class LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild
     : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
  protected:
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
     switch (last_source_frame_number) {
       case 0:
@@ -3808,7 +3803,7 @@ MULTI_THREAD_TEST_F(
 class LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent
     : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
  protected:
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     int last_source_frame_number = layer_tree_host()->source_frame_number() - 1;
     switch (last_source_frame_number) {
       case 0:
@@ -3875,15 +3870,14 @@ class LayerTreeHostTestTreeActivationCallback : public LayerTreeHostTest {
   LayerTreeHostTestTreeActivationCallback()
       : num_commits_(0), callback_count_(0) {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     EXPECT_TRUE(HasImplThread());
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual DrawResult PrepareToDrawOnThread(
-      LayerTreeHostImpl* host_impl,
-      LayerTreeHostImpl::FrameData* frame_data,
-      DrawResult draw_result) OVERRIDE {
+  DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
+                                   LayerTreeHostImpl::FrameData* frame_data,
+                                   DrawResult draw_result) override {
     ++num_commits_;
     switch (num_commits_) {
       case 1:
@@ -3912,7 +3906,7 @@ class LayerTreeHostTestTreeActivationCallback : public LayerTreeHostTest {
         host_impl, frame_data, draw_result);
   }
 
-  virtual void AfterTest() OVERRIDE { EXPECT_EQ(3, num_commits_); }
+  void AfterTest() override { EXPECT_EQ(3, num_commits_); }
 
   void SetCallback(bool enable) {
     output_surface()->SetTreeActivationCallback(
@@ -3941,7 +3935,7 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTest {
  public:
   LayerInvalidateCausesDraw() : num_commits_(0), num_draws_(0) {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     ASSERT_TRUE(!!invalidate_layer_.get())
         << "Derived tests must set this in SetupTree";
 
@@ -3949,23 +3943,23 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTest {
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     // After commit, invalidate the layer.  This should cause a commit.
     if (layer_tree_host()->source_frame_number() == 1)
       invalidate_layer_->SetNeedsDisplay();
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
     num_draws_++;
     if (impl->active_tree()->source_frame_number() == 1)
       EndTest();
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
     num_commits_++;
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     EXPECT_GE(2, num_commits_);
     EXPECT_GE(2, num_draws_);
   }
@@ -3983,7 +3977,7 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTest {
 // response to that invalidation.
 class LayerTreeHostTestVideoLayerInvalidate : public LayerInvalidateCausesDraw {
  public:
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     LayerTreeHostTest::SetupTree();
     scoped_refptr<VideoLayer> video_layer =
         VideoLayer::Create(&provider_, media::VIDEO_ROTATION_0);
@@ -4006,7 +4000,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestVideoLayerInvalidate);
 class LayerTreeHostTestIOSurfaceLayerInvalidate
     : public LayerInvalidateCausesDraw {
  public:
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     LayerTreeHostTest::SetupTree();
     scoped_refptr<IOSurfaceLayer> layer = IOSurfaceLayer::Create();
     layer->SetBounds(gfx::Size(10, 10));
@@ -4025,7 +4019,7 @@ SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
 
 class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest {
  protected:
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     root_layer_ = Layer::Create();
     root_layer_->SetPosition(gfx::Point());
     root_layer_->SetBounds(gfx::Size(10, 10));
@@ -4046,9 +4040,9 @@ class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest {
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     switch (layer_tree_host()->source_frame_number()) {
       case 1:
         // The layer type used does not need to push properties every frame.
@@ -4068,7 +4062,7 @@ class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest {
     }
   }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
     LayerImpl* root = impl->active_tree()->root_layer();
     LayerImpl* parent = root->children()[0];
     LayerImpl* child = parent->children()[0];
@@ -4080,7 +4074,7 @@ class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest {
     }
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   scoped_refptr<Layer> root_layer_;
   scoped_refptr<SolidColorLayer> parent_layer_;
@@ -4091,11 +4085,11 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPushHiddenLayer);
 
 class LayerTreeHostTestUpdateLayerInEmptyViewport : public LayerTreeHostTest {
  protected:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->impl_side_painting = true;
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     root_layer_ = FakePictureLayer::Create(&client_);
     root_layer_->SetBounds(gfx::Size(10, 10));
 
@@ -4103,21 +4097,21 @@ class LayerTreeHostTestUpdateLayerInEmptyViewport : public LayerTreeHostTest {
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     // The viewport is empty, but we still need to update layers on the main
     // thread.
     layer_tree_host()->SetViewportSize(gfx::Size(0, 0));
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     // The layer should be updated even though the viewport is empty, so we
     // are capable of drawing it on the impl tree.
     EXPECT_GT(root_layer_->update_count(), 0u);
     EndTest();
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   FakeContentLayerClient client_;
   scoped_refptr<FakePictureLayer> root_layer_;
@@ -4131,7 +4125,7 @@ class LayerTreeHostTestAbortEvictedTextures : public LayerTreeHostTest {
       : num_will_begin_main_frames_(0), num_impl_commits_(0) {}
 
  protected:
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     scoped_refptr<SolidColorLayer> root_layer = SolidColorLayer::Create();
     root_layer->SetBounds(gfx::Size(200, 200));
     root_layer->SetIsDrawable(true);
@@ -4140,9 +4134,9 @@ class LayerTreeHostTestAbortEvictedTextures : public LayerTreeHostTest {
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void WillBeginMainFrame() OVERRIDE {
+  void WillBeginMainFrame() override {
     num_will_begin_main_frames_++;
     switch (num_will_begin_main_frames_) {
       case 2:
@@ -4153,11 +4147,11 @@ class LayerTreeHostTestAbortEvictedTextures : public LayerTreeHostTest {
     }
   }
 
-  virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void BeginCommitOnThread(LayerTreeHostImpl* impl) override {
     num_impl_commits_++;
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
     switch (impl->SourceAnimationFrameNumber()) {
       case 1:
         // Prevent draws until commit.
@@ -4172,7 +4166,7 @@ class LayerTreeHostTestAbortEvictedTextures : public LayerTreeHostTest {
     }
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     // Ensure that the commit was truly aborted.
     EXPECT_EQ(2, num_will_begin_main_frames_);
     EXPECT_EQ(1, num_impl_commits_);
@@ -4188,44 +4182,46 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestAbortEvictedTextures);
 
 class LayerTreeHostTestMaxTransferBufferUsageBytes : public LayerTreeHostTest {
  protected:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->impl_side_painting = true;
+    settings->use_zero_copy = false;
+    settings->use_one_copy = false;
   }
 
-  virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
-      OVERRIDE {
+  scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(
+      bool fallback) override {
     scoped_refptr<TestContextProvider> context_provider =
         TestContextProvider::Create();
-    context_provider->SetMaxTransferBufferUsageBytes(1024 * 1024);
+    context_provider->SetMaxTransferBufferUsageBytes(512 * 512);
     if (delegating_renderer())
       return FakeOutputSurface::CreateDelegating3d(context_provider);
     else
       return FakeOutputSurface::Create3d(context_provider);
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     client_.set_fill_with_nonsolid_color(true);
     scoped_refptr<FakePictureLayer> root_layer =
         FakePictureLayer::Create(&client_);
-    root_layer->SetBounds(gfx::Size(6000, 6000));
+    root_layer->SetBounds(gfx::Size(1024, 1024));
     root_layer->SetIsDrawable(true);
 
     layer_tree_host()->SetRootLayer(root_layer);
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
     TestWebGraphicsContext3D* context = TestContext();
 
     // Expect that the transfer buffer memory used is equal to the
     // MaxTransferBufferUsageBytes value set in CreateOutputSurface.
-    EXPECT_EQ(1024 * 1024u, context->max_used_transfer_buffer_usage_bytes());
+    EXPECT_EQ(512 * 512u, context->max_used_transfer_buffer_usage_bytes());
     EndTest();
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  private:
   FakeContentLayerClient client_;
@@ -4240,14 +4236,14 @@ class LayerTreeHostTestMemoryLimits : public LayerTreeHostTest {
  public:
   LayerTreeHostTestMemoryLimits() : num_commits_(0) {}
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void WillCommit() OVERRIDE {
+  void WillCommit() override {
     // Some commits are aborted, so increment number of attempted commits here.
     num_commits_++;
   }
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     switch (num_commits_) {
       case 1:
         // Verify default values.
@@ -4292,7 +4288,7 @@ class LayerTreeHostTestMemoryLimits : public LayerTreeHostTest {
     }
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
     switch (num_commits_) {
       case 1:
         break;
@@ -4317,7 +4313,7 @@ class LayerTreeHostTestMemoryLimits : public LayerTreeHostTest {
     }
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
  private:
   int num_commits_;
@@ -4334,8 +4330,8 @@ class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface
       : first_output_surface_memory_limit_(4321234),
         second_output_surface_memory_limit_(1234321) {}
 
-  virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback)
-      OVERRIDE {
+  scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(
+      bool fallback) override {
     if (!first_context_provider_.get()) {
       first_context_provider_ = TestContextProvider::Create();
     } else {
@@ -4360,16 +4356,16 @@ class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface
     return output_surface.Pass();
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     root_ = FakeContentLayer::Create(&client_);
     root_->SetBounds(gfx::Size(20, 20));
     layer_tree_host()->SetRootLayer(root_);
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidCommitAndDrawFrame() OVERRIDE {
+  void DidCommitAndDrawFrame() override {
     // Lost context sometimes takes two frames to recreate. The third frame
     // is sometimes aborted, so wait until the fourth frame to verify that
     // the memory has been set, and the fifth frame to end the test.
@@ -4380,8 +4376,7 @@ class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface
     }
   }
 
-  virtual void SwapBuffersOnThread(LayerTreeHostImpl* impl,
-                                   bool result) OVERRIDE {
+  void SwapBuffersOnThread(LayerTreeHostImpl* impl, bool result) override {
     switch (impl->active_tree()->source_frame_number()) {
       case 1:
         EXPECT_EQ(first_output_surface_memory_limit_,
@@ -4397,7 +4392,7 @@ class LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface
     }
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   scoped_refptr<TestContextProvider> first_context_provider_;
   scoped_refptr<TestContextProvider> second_context_provider_;
@@ -4429,19 +4424,19 @@ class TestSwapPromise : public SwapPromise {
  public:
   explicit TestSwapPromise(TestSwapPromiseResult* result) : result_(result) {}
 
-  virtual ~TestSwapPromise() {
+  ~TestSwapPromise() override {
     base::AutoLock lock(result_->lock);
     result_->dtor_called = true;
   }
 
-  virtual void DidSwap(CompositorFrameMetadata* metadata) OVERRIDE {
+  void DidSwap(CompositorFrameMetadata* metadata) override {
     base::AutoLock lock(result_->lock);
     EXPECT_FALSE(result_->did_swap_called);
     EXPECT_FALSE(result_->did_not_swap_called);
     result_->did_swap_called = true;
   }
 
-  virtual void DidNotSwap(DidNotSwapReason reason) OVERRIDE {
+  void DidNotSwap(DidNotSwapReason reason) override {
     base::AutoLock lock(result_->lock);
     EXPECT_FALSE(result_->did_swap_called);
     EXPECT_FALSE(result_->did_not_swap_called);
@@ -4449,7 +4444,7 @@ class TestSwapPromise : public SwapPromise {
     result_->reason = reason;
   }
 
-  virtual int64 TraceId() const OVERRIDE { return 0; }
+  int64 TraceId() const override { return 0; }
 
  private:
   // Not owned.
@@ -4461,16 +4456,16 @@ class LayerTreeHostTestBreakSwapPromise : public LayerTreeHostTest {
   LayerTreeHostTestBreakSwapPromise()
       : commit_count_(0), commit_complete_count_(0) {}
 
-  virtual void WillBeginMainFrame() OVERRIDE {
+  void WillBeginMainFrame() override {
     ASSERT_LE(commit_count_, 2);
     scoped_ptr<SwapPromise> swap_promise(
         new TestSwapPromise(&swap_promise_result_[commit_count_]));
     layer_tree_host()->QueueSwapPromise(swap_promise.Pass());
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     commit_count_++;
     if (commit_count_ == 2) {
       // This commit will finish.
@@ -4478,7 +4473,7 @@ class LayerTreeHostTestBreakSwapPromise : public LayerTreeHostTest {
     }
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
     commit_complete_count_++;
     if (commit_complete_count_ == 1) {
       // This commit will be aborted because no actual update.
@@ -4488,7 +4483,7 @@ class LayerTreeHostTestBreakSwapPromise : public LayerTreeHostTest {
     }
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     // 3 commits are scheduled. 2 completes. 1 is aborted.
     EXPECT_EQ(commit_count_, 3);
     EXPECT_EQ(commit_complete_count_, 2);
@@ -4532,14 +4527,14 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromise);
 class LayerTreeHostTestBreakSwapPromiseForVisibilityAbortedCommit
     : public LayerTreeHostTest {
  protected:
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     layer_tree_host()->SetDeferCommits(true);
     layer_tree_host()->SetNeedsCommit();
   }
 
-  virtual void DidDeferCommit() OVERRIDE {
+  void DidDeferCommit() override {
     layer_tree_host()->SetVisible(false);
     scoped_ptr<SwapPromise> swap_promise(
         new TestSwapPromise(&swap_promise_result_));
@@ -4547,12 +4542,12 @@ class LayerTreeHostTestBreakSwapPromiseForVisibilityAbortedCommit
     layer_tree_host()->SetDeferCommits(false);
   }
 
-  virtual void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl,
-                                             bool did_handle) OVERRIDE {
+  void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl,
+                                     bool did_handle) override {
     EndTest();
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     {
       base::AutoLock lock(swap_promise_result_.lock);
       EXPECT_FALSE(swap_promise_result_.did_swap_called);
@@ -4571,16 +4566,16 @@ SINGLE_AND_MULTI_THREAD_TEST_F(
 class LayerTreeHostTestBreakSwapPromiseForContextAbortedCommit
     : public LayerTreeHostTest {
  protected:
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     if (TestEnded())
       return;
     layer_tree_host()->SetDeferCommits(true);
     layer_tree_host()->SetNeedsCommit();
   }
 
-  virtual void DidDeferCommit() OVERRIDE {
+  void DidDeferCommit() override {
     layer_tree_host()->DidLoseOutputSurface();
     scoped_ptr<SwapPromise> swap_promise(
         new TestSwapPromise(&swap_promise_result_));
@@ -4588,8 +4583,8 @@ class LayerTreeHostTestBreakSwapPromiseForContextAbortedCommit
     layer_tree_host()->SetDeferCommits(false);
   }
 
-  virtual void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl,
-                                             bool did_handle) OVERRIDE {
+  void BeginMainFrameAbortedOnThread(LayerTreeHostImpl* host_impl,
+                                     bool did_handle) override {
     EndTest();
     // This lets the test finally commit and exit.
     MainThreadTaskRunner()->PostTask(
@@ -4603,7 +4598,7 @@ class LayerTreeHostTestBreakSwapPromiseForContextAbortedCommit
     layer_tree_host()->OnCreateAndInitializeOutputSurfaceAttempted(true);
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     {
       base::AutoLock lock(swap_promise_result_.lock);
       EXPECT_FALSE(swap_promise_result_.did_swap_called);
@@ -4628,17 +4623,15 @@ class SimpleSwapPromiseMonitor : public SwapPromiseMonitor {
       : SwapPromiseMonitor(layer_tree_host, layer_tree_host_impl),
         set_needs_commit_count_(set_needs_commit_count) {}
 
-  virtual ~SimpleSwapPromiseMonitor() {}
+  ~SimpleSwapPromiseMonitor() override {}
 
-  virtual void OnSetNeedsCommitOnMain() OVERRIDE {
-    (*set_needs_commit_count_)++;
-  }
+  void OnSetNeedsCommitOnMain() override { (*set_needs_commit_count_)++; }
 
-  virtual void OnSetNeedsRedrawOnImpl() OVERRIDE {
+  void OnSetNeedsRedrawOnImpl() override {
     ADD_FAILURE() << "Should not get called on main thread.";
   }
 
-  virtual void OnForwardScrollUpdateToMainThreadOnImpl() OVERRIDE {
+  void OnForwardScrollUpdateToMainThreadOnImpl() override {
     ADD_FAILURE() << "Should not get called on main thread.";
   }
 
@@ -4648,9 +4641,9 @@ class SimpleSwapPromiseMonitor : public SwapPromiseMonitor {
 
 class LayerTreeHostTestSimpleSwapPromiseMonitor : public LayerTreeHostTest {
  public:
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void WillBeginMainFrame() OVERRIDE {
+  void WillBeginMainFrame() override {
     if (TestEnded())
       return;
 
@@ -4699,7 +4692,7 @@ class LayerTreeHostTestSimpleSwapPromiseMonitor : public LayerTreeHostTest {
     EndTest();
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 };
 
 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor);
@@ -4707,40 +4700,40 @@ SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor);
 class LayerTreeHostTestHighResRequiredAfterEvictingUIResources
     : public LayerTreeHostTest {
  protected:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->impl_side_painting = true;
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     LayerTreeHostTest::SetupTree();
     ui_resource_ = FakeScopedUIResource::Create(layer_tree_host());
   }
 
-  virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); }
+  void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
     host_impl->EvictAllUIResources();
     // Existence of evicted UI resources will trigger NEW_CONTENT_TAKES_PRIORITY
     // mode. Active tree should require high-res to draw after entering this
     // mode to ensure that high-res tiles are also required for a pending tree
     // to be activated.
-    EXPECT_TRUE(host_impl->active_tree()->RequiresHighResToDraw());
+    EXPECT_TRUE(host_impl->RequiresHighResToDraw());
   }
 
-  virtual void DidCommit() OVERRIDE {
+  void DidCommit() override {
     int frame = layer_tree_host()->source_frame_number();
     switch (frame) {
       case 1:
         PostSetNeedsCommitToMainThread();
         break;
       case 2:
-        ui_resource_.reset();
+        ui_resource_ = nullptr;
         EndTest();
         break;
     }
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   FakeContentLayerClient client_;
   scoped_ptr<FakeScopedUIResource> ui_resource_;
@@ -4751,14 +4744,14 @@ class LayerTreeHostTestHighResRequiredAfterEvictingUIResources
 
 class LayerTreeHostTestGpuRasterizationDefault : public LayerTreeHostTest {
  protected:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->impl_side_painting = true;
 
     EXPECT_FALSE(settings->gpu_rasterization_enabled);
     EXPECT_FALSE(settings->gpu_rasterization_forced);
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     LayerTreeHostTest::SetupTree();
 
     scoped_refptr<PictureLayer> layer = PictureLayer::Create(&layer_client_);
@@ -4767,7 +4760,7 @@ class LayerTreeHostTestGpuRasterizationDefault : public LayerTreeHostTest {
     layer_tree_host()->root_layer()->AddChild(layer);
   }
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     Layer* root = layer_tree_host()->root_layer();
     PictureLayer* layer = static_cast<PictureLayer*>(root->child_at(0));
     PicturePile* pile = layer->GetPicturePileForTesting();
@@ -4787,18 +4780,18 @@ class LayerTreeHostTestGpuRasterizationDefault : public LayerTreeHostTest {
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
     EXPECT_FALSE(host_impl->pending_tree()->use_gpu_rasterization());
     EXPECT_FALSE(host_impl->use_gpu_rasterization());
   }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
     EXPECT_FALSE(host_impl->active_tree()->use_gpu_rasterization());
     EXPECT_FALSE(host_impl->use_gpu_rasterization());
     EndTest();
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   FakeContentLayerClient layer_client_;
 };
@@ -4807,14 +4800,14 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationDefault);
 
 class LayerTreeHostTestGpuRasterizationEnabled : public LayerTreeHostTest {
  protected:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->impl_side_painting = true;
 
     EXPECT_FALSE(settings->gpu_rasterization_enabled);
     settings->gpu_rasterization_enabled = true;
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     LayerTreeHostTest::SetupTree();
 
     scoped_refptr<PictureLayer> layer = PictureLayer::Create(&layer_client_);
@@ -4823,7 +4816,7 @@ class LayerTreeHostTestGpuRasterizationEnabled : public LayerTreeHostTest {
     layer_tree_host()->root_layer()->AddChild(layer);
   }
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     Layer* root = layer_tree_host()->root_layer();
     PictureLayer* layer = static_cast<PictureLayer*>(root->child_at(0));
     PicturePile* pile = layer->GetPicturePileForTesting();
@@ -4852,18 +4845,18 @@ class LayerTreeHostTestGpuRasterizationEnabled : public LayerTreeHostTest {
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
     EXPECT_FALSE(host_impl->pending_tree()->use_gpu_rasterization());
     EXPECT_FALSE(host_impl->use_gpu_rasterization());
   }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
     EXPECT_FALSE(host_impl->active_tree()->use_gpu_rasterization());
     EXPECT_FALSE(host_impl->use_gpu_rasterization());
     EndTest();
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   FakeContentLayerClient layer_client_;
 };
@@ -4872,14 +4865,14 @@ MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationEnabled);
 
 class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest {
  protected:
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->impl_side_painting = true;
 
     EXPECT_FALSE(settings->gpu_rasterization_forced);
     settings->gpu_rasterization_forced = true;
   }
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     LayerTreeHostTest::SetupTree();
 
     scoped_refptr<PictureLayer> layer = PictureLayer::Create(&layer_client_);
@@ -4888,7 +4881,7 @@ class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest {
     layer_tree_host()->root_layer()->AddChild(layer);
   }
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     Layer* root = layer_tree_host()->root_layer();
     PictureLayer* layer = static_cast<PictureLayer*>(root->child_at(0));
     PicturePile* pile = layer->GetPicturePileForTesting();
@@ -4917,18 +4910,18 @@ class LayerTreeHostTestGpuRasterizationForced : public LayerTreeHostTest {
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
     EXPECT_TRUE(host_impl->pending_tree()->use_gpu_rasterization());
     EXPECT_TRUE(host_impl->use_gpu_rasterization());
   }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
     EXPECT_TRUE(host_impl->active_tree()->use_gpu_rasterization());
     EXPECT_TRUE(host_impl->use_gpu_rasterization());
     EndTest();
   }
 
-  virtual void AfterTest() OVERRIDE {}
+  void AfterTest() override {}
 
   FakeContentLayerClient layer_client_;
 };
@@ -4943,7 +4936,7 @@ class LayerTreeHostTestContinuousPainting : public LayerTreeHostTest {
  protected:
   enum { kExpectedNumCommits = 10 };
 
-  virtual void SetupTree() OVERRIDE {
+  void SetupTree() override {
     scoped_refptr<Layer> root_layer = Layer::Create();
     root_layer->SetBounds(bounds_);
 
@@ -4963,7 +4956,7 @@ class LayerTreeHostTestContinuousPainting : public LayerTreeHostTest {
     LayerTreeHostTest::SetupTree();
   }
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     MainThreadTaskRunner()->PostTask(
         FROM_HERE,
         base::Bind(
@@ -4981,11 +4974,11 @@ class LayerTreeHostTestContinuousPainting : public LayerTreeHostTest {
                                           milliseconds_per_frame));
   }
 
-  virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE {
+  void BeginMainFrame(const BeginFrameArgs& args) override {
     child_layer_->SetNeedsDisplay();
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     EXPECT_LE(kExpectedNumCommits, num_commits_);
     EXPECT_LE(kExpectedNumCommits, num_draws_);
     int update_count = content_layer_.get()
@@ -4994,12 +4987,12 @@ class LayerTreeHostTestContinuousPainting : public LayerTreeHostTest {
     EXPECT_LE(kExpectedNumCommits, update_count);
   }
 
-  virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void DrawLayersOnThread(LayerTreeHostImpl* impl) override {
     if (++num_draws_ == kExpectedNumCommits)
       EndTest();
   }
 
-  virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
+  void CommitCompleteOnThread(LayerTreeHostImpl* impl) override {
     ++num_commits_;
   }
 
@@ -5033,41 +5026,41 @@ class LayerTreeHostTestActivateOnInvisible : public LayerTreeHostTest {
   LayerTreeHostTestActivateOnInvisible()
       : activation_count_(0), visible_(true) {}
 
-  virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
+  void InitializeSettings(LayerTreeSettings* settings) override {
     settings->impl_side_painting = true;
   }
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     // Kick off the test with a commit.
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override {
     // Make sure we don't activate using the notify signal from tile manager.
     host_impl->BlockNotifyReadyToActivateForTesting(true);
   }
 
-  virtual void DidCommit() OVERRIDE { layer_tree_host()->SetVisible(false); }
+  void DidCommit() override { layer_tree_host()->SetVisible(false); }
 
-  virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl,
-                                       bool visible) OVERRIDE {
+  void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl,
+                               bool visible) override {
     visible_ = visible;
 
     // Once invisible, we can go visible again.
     if (!visible) {
       PostSetVisibleToMainThread(true);
     } else {
-      EXPECT_TRUE(host_impl->active_tree()->RequiresHighResToDraw());
+      EXPECT_TRUE(host_impl->RequiresHighResToDraw());
       EndTest();
     }
   }
 
-  virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE {
+  void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
     ++activation_count_;
     EXPECT_FALSE(visible_);
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     // Ensure we activated even though the signal was blocked.
     EXPECT_EQ(1, activation_count_);
     EXPECT_TRUE(visible_);
@@ -5084,6 +5077,83 @@ class LayerTreeHostTestActivateOnInvisible : public LayerTreeHostTest {
 // TODO(vmpstr): Enable with single thread impl-side painting.
 MULTI_THREAD_TEST_F(LayerTreeHostTestActivateOnInvisible);
 
+// Do a synchronous composite and assert that the swap promise succeeds.
+class LayerTreeHostTestSynchronousCompositeSwapPromise
+    : public LayerTreeHostTest {
+ public:
+  LayerTreeHostTestSynchronousCompositeSwapPromise() : commit_count_(0) {}
+
+  void InitializeSettings(LayerTreeSettings* settings) override {
+    settings->single_thread_proxy_scheduler = false;
+  }
+
+  void BeginTest() override {
+    // Successful composite.
+    scoped_ptr<SwapPromise> swap_promise0(
+        new TestSwapPromise(&swap_promise_result_[0]));
+    layer_tree_host()->QueueSwapPromise(swap_promise0.Pass());
+    layer_tree_host()->Composite(gfx::FrameTime::Now());
+
+    // Fail to swap (no damage).
+    scoped_ptr<SwapPromise> swap_promise1(
+        new TestSwapPromise(&swap_promise_result_[1]));
+    layer_tree_host()->QueueSwapPromise(swap_promise1.Pass());
+    layer_tree_host()->SetNeedsCommit();
+    layer_tree_host()->Composite(gfx::FrameTime::Now());
+
+    // Fail to draw (not visible).
+    scoped_ptr<SwapPromise> swap_promise2(
+        new TestSwapPromise(&swap_promise_result_[2]));
+    layer_tree_host()->QueueSwapPromise(swap_promise2.Pass());
+    layer_tree_host()->SetNeedsDisplayOnAllLayers();
+    layer_tree_host()->SetVisible(false);
+    layer_tree_host()->Composite(gfx::FrameTime::Now());
+
+    EndTest();
+  }
+
+  void DidCommit() override {
+    commit_count_++;
+    ASSERT_LE(commit_count_, 3);
+  }
+
+  void AfterTest() override {
+    EXPECT_EQ(3, commit_count_);
+
+    // Initial swap promise should have succeded.
+    {
+      base::AutoLock lock(swap_promise_result_[0].lock);
+      EXPECT_TRUE(swap_promise_result_[0].did_swap_called);
+      EXPECT_FALSE(swap_promise_result_[0].did_not_swap_called);
+      EXPECT_TRUE(swap_promise_result_[0].dtor_called);
+    }
+
+    // Second swap promise fails to swap.
+    {
+      base::AutoLock lock(swap_promise_result_[1].lock);
+      EXPECT_FALSE(swap_promise_result_[1].did_swap_called);
+      EXPECT_TRUE(swap_promise_result_[1].did_not_swap_called);
+      EXPECT_EQ(SwapPromise::SWAP_FAILS, swap_promise_result_[1].reason);
+      EXPECT_TRUE(swap_promise_result_[1].dtor_called);
+    }
+
+    // Third swap promises also fails to swap (and draw).
+    {
+      base::AutoLock lock(swap_promise_result_[2].lock);
+      EXPECT_FALSE(swap_promise_result_[2].did_swap_called);
+      EXPECT_TRUE(swap_promise_result_[2].did_not_swap_called);
+      EXPECT_EQ(SwapPromise::SWAP_FAILS, swap_promise_result_[2].reason);
+      EXPECT_TRUE(swap_promise_result_[2].dtor_called);
+    }
+  }
+
+  int commit_count_;
+  TestSwapPromiseResult swap_promise_result_[3];
+};
+
+// Impl-side painting is not supported for synchronous compositing.
+SINGLE_THREAD_NOIMPL_TEST_F(LayerTreeHostTestSynchronousCompositeSwapPromise);
+
 // Make sure page scale and top control deltas are applied to the client even
 // when the LayerTreeHost doesn't have a root layer.
 class LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer
@@ -5092,7 +5162,7 @@ class LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer
   LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer()
       : deltas_sent_to_client_(false) {}
 
-  virtual void BeginTest() OVERRIDE {
+  void BeginTest() override {
     layer_tree_host()->SetRootLayer(nullptr);
     info_.page_scale_delta = 3.14f;
     info_.top_controls_delta = 2.73f;
@@ -5100,23 +5170,33 @@ class LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer
     PostSetNeedsCommitToMainThread();
   }
 
-  virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE {
+  void BeginMainFrame(const BeginFrameArgs& args) override {
     EXPECT_EQ(nullptr, layer_tree_host()->root_layer());
 
     layer_tree_host()->ApplyScrollAndScale(&info_);
     EndTest();
   }
 
-  virtual void ApplyViewportDeltas(
+  void ApplyViewportDeltas(
+      const gfx::Vector2d& inner,
+      const gfx::Vector2d& outer,
+      float scale_delta,
+      float top_controls_delta) override {
+    EXPECT_EQ(info_.page_scale_delta, scale_delta);
+    EXPECT_EQ(info_.top_controls_delta, top_controls_delta);
+    deltas_sent_to_client_ = true;
+  }
+
+  void ApplyViewportDeltas(
       const gfx::Vector2d& scroll,
       float scale_delta,
-      float top_controls_delta) OVERRIDE {
+      float top_controls_delta) override {
     EXPECT_EQ(info_.page_scale_delta, scale_delta);
     EXPECT_EQ(info_.top_controls_delta, top_controls_delta);
     deltas_sent_to_client_ = true;
   }
 
-  virtual void AfterTest() OVERRIDE {
+  void AfterTest() override {
     EXPECT_TRUE(deltas_sent_to_client_);
   }