コード例 #1
0
ファイル: LayoutTest.java プロジェクト: oaperez/rap
  /** Run the test */
  protected void runTest() throws CoreException, WorkbenchException {

    widgetFactory.init();
    final Composite widget = widgetFactory.getControl();
    final Point maxSize = widgetFactory.getMaxSize();
    Rectangle initialBounds = widget.getBounds();
    final Rectangle newBounds = Geometry.copy(initialBounds);

    // This test is different now duw to trim API changes so 'gray' it...
    setDegradationComment(
        "<a href=https://bugs.eclipse.org/bugs/show_bug.cgi?id=129001>See Bug 129001</a> ");

    for (int xIteration = 0; xIteration < xIterations; xIteration++) {

      processEvents();

      startMeasuring();

      for (int yIteration = 0; yIteration < yIterations; yIteration++) {
        // Avoid giving the same x value twice in a row in order to make
        // it hard to cache
        int xSize = maxSize.x * ((xIteration + yIteration) % xIterations) / xIterations;
        int ySize = maxSize.y * yIteration / yIterations;

        newBounds.width = xSize;
        newBounds.height = ySize;

        widget.setBounds(newBounds);
        widget.layout(flushState);
      }

      stopMeasuring();
    }

    commitMeasurements();
    assertPerformance();

    widget.setBounds(initialBounds);
    widgetFactory.done();
  }
コード例 #2
0
  /** Run the test */
  @Override
  protected void runTest() throws CoreException, WorkbenchException {

    tagIfNecessary(tagString, Dimension.ELAPSED_PROCESS);

    widgetFactory.init();
    final Composite widget = widgetFactory.getControl();
    Rectangle initialBounds = widget.getBounds();
    final Point maxSize = widgetFactory.getMaxSize();

    waitForBackgroundJobs();
    processEvents();
    for (int j = 0; j < 50; j++) {

      startMeasuring();
      for (int i = 0; i < 2; i++) {

        for (int xIteration = 0; xIteration < xIterations; xIteration += 5) {

          for (int yIteration = 0; yIteration < yIterations; yIteration++) {
            // Avoid giving the same x value twice in a row in order
            // to make it hard to cache
            int xSize = maxSize.x * ((xIteration + yIteration) % xIterations) / xIterations;
            int ySize = maxSize.y * yIteration / yIterations;

            widget.setSize(xSize, ySize);

            processEvents();
          }
        }
      }
      stopMeasuring();
    }
    commitMeasurements();
    assertPerformance();

    widget.setBounds(initialBounds);
    widgetFactory.done();
  }
コード例 #3
0
 /**
  * Create a new instance of the receiver.
  *
  * @param factory
  * @param tagging
  * @param tag
  */
 public ResizeTest(TestWidgetFactory factory, int tagging, String tag) {
   super(factory.getName() + " setSize", tagging);
   this.tagString = tag;
   this.widgetFactory = factory;
 }
コード例 #4
0
 /**
  * Create a new instance of the receiver.
  *
  * @param factory
  */
 public ResizeTest(TestWidgetFactory factory) {
   this(factory, NONE, factory.getName() + " setSize");
 }
コード例 #5
0
ファイル: LayoutTest.java プロジェクト: oaperez/rap
  /** @param testName */
  public LayoutTest(TestWidgetFactory widgetFactory, boolean flushState) {
    super(widgetFactory.getName() + " layout(" + (flushState ? "true" : "false") + ")");

    this.widgetFactory = widgetFactory;
    this.flushState = flushState;
  }