Bug 969483 - Remove stub test code that is inferior to the real code. r=BenWa
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 18 Feb 2014 16:38:29 -0500
changeset 169388 b8ee6ec3af984dd42215e88ef6820923bbef9833
parent 169387 018ee8ea0c126adef3ba26118b5d43a2580a6095
child 169389 e1c8174ce97b7114e40f545fd0ede9383f71a312
push id39937
push userkgupta@mozilla.com
push dateTue, 18 Feb 2014 21:38:59 +0000
treeherdermozilla-inbound@e1c8174ce97b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa
bugs969483
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 969483 - Remove stub test code that is inferior to the real code. r=BenWa
gfx/tests/gtest/TestLayers.cpp
--- a/gfx/tests/gtest/TestLayers.cpp
+++ b/gfx/tests/gtest/TestLayers.cpp
@@ -46,43 +46,16 @@ public:
 
   virtual LayerType GetType() const {
     return TYPE_CONTAINER;
   }
 
   virtual void ComputeEffectiveTransforms(const Matrix4x4& 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)
   {}
 
@@ -225,17 +198,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(Matrix4x4());
   }