paragraph_builder_test.dart 718 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1 2 3 4
// 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.

5
import 'dart:ui';
6 7 8 9 10 11 12 13 14

import 'package:test/test.dart';

void main() {
  test("Should be able to build and layout a paragraph", () {
    ParagraphBuilder builder = new ParagraphBuilder();
    builder.addText('Hello');
    Paragraph paragraph = builder.build(new ParagraphStyle());
    expect(paragraph, isNotNull);
15 16 17 18 19 20

    paragraph.minWidth = 0.0;
    paragraph.maxWidth = 800.0;
    paragraph.minHeight = 0.0;
    paragraph.maxHeight = 600.0;

21
    paragraph.layout();
22 23
    expect(paragraph.width, isNonZero);
    expect(paragraph.height, isNonZero);
24 25
  });
}