content: /*
   * Copyright (C) 2021 The Android Open Source Project
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package androidx.constraintlayout.core;
  
  import androidx.constraintlayout.core.widgets.ConstraintAnchor;
  import androidx.constraintlayout.core.widgets.ConstraintWidget;
  import androidx.constraintlayout.core.widgets.ConstraintWidgetContainer;
  
  import org.junit.Test;
  
  /**
   * Basic performance test
   */
  public class PerformanceTest {
  
      @Test
      public void testBasic() {
          ConstraintWidgetContainer root = new ConstraintWidgetContainer(0, 0, 1000, 600);
          ConstraintWidget a = new ConstraintWidget(100, 40);
          ConstraintWidget b = new ConstraintWidget(100, 100);
          ConstraintWidget c = new ConstraintWidget(100, 20);
          root.setDebugName("root");
          a.setDebugName("A");
          b.setDebugName("B");
          c.setDebugName("C");
          root.add(a);
          root.add(b);
          root.add(c);
  
          a.connect(ConstraintAnchor.Type.LEFT, root, ConstraintAnchor.Type.LEFT);
          a.connect(ConstraintAnchor.Type.RIGHT, b, ConstraintAnchor.Type.LEFT);
          a.connect(ConstraintAnchor.Type.TOP, root, ConstraintAnchor.Type.TOP);
          a.connect(ConstraintAnchor.Type.BOTTOM, c, ConstraintAnchor.Type.TOP);
          b.connect(ConstraintAnchor.Type.RIGHT, root, ConstraintAnchor.Type.RIGHT);
          b.connect(ConstraintAnchor.Type.TOP, root, ConstraintAnchor.Type.TOP);
          c.connect(ConstraintAnchor.Type.LEFT, root, ConstraintAnchor.Type.LEFT);
          c.connect(ConstraintAnchor.Type.RIGHT, b, ConstraintAnchor.Type.LEFT);
          c.connect(ConstraintAnchor.Type.BOTTOM, root, ConstraintAnchor.Type.BOTTOM);
          a.setHorizontalDimensionBehaviour(ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT);
          c.setHorizontalDimensionBehaviour(ConstraintWidget.DimensionBehaviour.MATCH_CONSTRAINT);
  
          root.layout();
          System.out.println("root: " + root + " A: " + a + " B: " + b + " C: " + c);
      }
  }
  