Bug 969483 - Remove stub test code that is inferior to the real code. r=BenWa a=sledru
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 19 Feb 2014 08:12:53 -0500
changeset 176339 b24e6c62e64a18ff8e410bbd0ee41bb5cbe983fa
parent 176338 6ab352514ce1822bb34744b8071ce9f917e0bcfa
child 176340 175f7f1ac03ffe837b0e69e321d6ee90dbceb50c
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa, sledru
bugs969483
milestone28.0
Bug 969483 - Remove stub test code that is inferior to the real code. r=BenWa a=sledru
gfx/tests/gtest/TestLayers.cpp
--- a/gfx/tests/gtest/TestLayers.cpp
+++ b/gfx/tests/gtest/TestLayers.cpp
@@ -45,43 +45,16 @@ public:
 
   virtual LayerType GetType() const {
     return TYPE_CONTAINER;
   }
 
   virtual void ComputeEffectiveTransforms(const gfx3DMatrix& aTransformToSurface) {
     DefaultComputeEffectiveTransforms(aTransformToSurface);
   }
-
-  virtual void RepositionChild(Layer* aChild, Layer* aAfter) {
-    MOZ_CRASH();
-  }
-
-  virtual void InsertAfter(Layer* aChild, Layer* aAfter) {
-    // Bad implementation but it should be fine for testing
-    if (this == aChild) {
-      MOZ_CRASH();
-    }
-    if (aAfter != nullptr && aAfter != mLastChild) {
-      // Fix the implementation to support this if you need it
-      MOZ_CRASH();
-    }
-    if (!mFirstChild) {
-      mFirstChild = aChild;
-    }
-    if (mLastChild) {
-      mLastChild->SetNextSibling(aChild);
-    }
-    aChild->SetPrevSibling(mLastChild);
-    mLastChild = aChild;
-  }
-
-  virtual void RemoveChild(Layer* aChild) {
-    MOZ_CRASH();
-  }
 };
 
 class TestThebesLayer: public ThebesLayer {
 public:
   TestThebesLayer(LayerManager* aManager)
     : ThebesLayer(aManager, nullptr)
   {}
 
@@ -222,17 +195,17 @@ already_AddRefed<Layer> CreateLayerTree(
       layerNumber++;
       if (rootLayer && !parentContainerLayer) {
         MOZ_CRASH();
       }
       if (!rootLayer) {
         rootLayer = layer;
       }
       if (parentContainerLayer) {
-        parentContainerLayer->InsertAfter(layer, nullptr);
+        parentContainerLayer->InsertAfter(layer, parentContainerLayer->GetLastChild());
         layer->SetParent(parentContainerLayer);
       }
       lastLayer = layer;
     }
   }
   if (rootLayer) {
     rootLayer->ComputeEffectiveTransforms(gfx3DMatrix());
   }