scrollbar_paint_test.dart 751 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
// Copyright 2016 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_test/flutter_test.dart';
import 'package:flutter/material.dart';

import '../rendering/mock_canvas.dart';

void main() {
Adam Barth's avatar
Adam Barth committed
11
  testWidgets('Viewport basic test', (WidgetTester tester) async {
12
    await tester.pumpWidget(new Scrollbar(
13
      child: new SingleChildScrollView(
14
        child: const SizedBox(width: 4000.0, height: 4000.0),
15 16
      ),
    ));
17
    expect(find.byType(Scrollbar), isNot(paints..rect()));
18
    await tester.fling(find.byType(SingleChildScrollView), const Offset(0.0, -10.0), 10.0);
19
    expect(find.byType(Scrollbar), paints..rect());
20 21
  });
}