repaint_boundary_test.dart 1016 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/rendering.dart';
import 'package:test/test.dart';

import 'rendering_tester.dart';

void main() {
Ian Hickson's avatar
Ian Hickson committed
11
  test('nested repaint boundaries - smoke test', () {
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
    RenderOpacity a, b, c;
    a = new RenderOpacity(
      opacity: 1.0,
      child: new RenderRepaintBoundary(
        child: b = new RenderOpacity(
          opacity: 1.0,
          child: new RenderRepaintBoundary(
            child: c = new RenderOpacity(
              opacity: 1.0
            )
          )
        )
      )
    );
    layout(a, phase: EnginePhase.flushSemantics);
    c.opacity = 0.9;
28
    pumpFrame(phase: EnginePhase.flushSemantics);
29 30
    a.opacity = 0.8;
    c.opacity = 0.8;
31
    pumpFrame(phase: EnginePhase.flushSemantics);
32 33 34
    a.opacity = 0.7;
    b.opacity = 0.7;
    c.opacity = 0.7;
35
    pumpFrame(phase: EnginePhase.flushSemantics);
36 37
  });
}