Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(839)

Unified Diff: pkg/dev_compiler/test/codegen/lib/html/instance_of_test.dart

Issue 2413073002: Start cleaning up the HTML tests. (Closed)
Patch Set: Unfork expect.dart. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/dev_compiler/test/codegen/lib/html/instance_of_test.dart
diff --git a/pkg/dev_compiler/test/codegen/lib/html/instance_of_test.dart b/pkg/dev_compiler/test/codegen/lib/html/instance_of_test.dart
index da664db79bef29053fa8ed0c0c4cb3cc75604706..e2c32f3a97adde4d835af700f8ff036fec9c4dae 100644
--- a/pkg/dev_compiler/test/codegen/lib/html/instance_of_test.dart
+++ b/pkg/dev_compiler/test/codegen/lib/html/instance_of_test.dart
@@ -1,8 +1,7 @@
-library InstanceOfTest;
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
import 'dart:html';
+import 'package:minitest/minitest.dart';
+
main() {
CanvasElement canvas;
@@ -13,53 +12,61 @@ main() {
var isCanvasRenderingContext = predicate((x) => x is CanvasRenderingContext,
'is a CanvasRenderingContext');
+ var isNotCanvasRenderingContext = predicate((x) => x is! CanvasRenderingContext,
+ 'is not a CanvasRenderingContext');
var isCanvasRenderingContext2D =
predicate((x) => x is CanvasRenderingContext2D,
'is a CanvasRenderingContext2D');
+ var isNotCanvasRenderingContext2D =
+ predicate((x) => x is! CanvasRenderingContext2D,
+ 'is not a CanvasRenderingContext2D');
var isElement = predicate((x) => x is Element, 'is an Element');
+ var isNotElement = predicate((x) => x is! Element, 'is not an Element');
var isCanvasElement =
predicate((x) => x is CanvasElement, 'is a CanvasElement');
+ var isNotCanvasElement =
+ predicate((x) => x is! CanvasElement, 'is not a CanvasElement');
var isImageData = predicate((x) => x is ImageData, 'is an ImageData');
+ var isNotImageData = predicate((x) => x is! ImageData, 'is not an ImageData');
//var isUint8ClampedArray =
// predicate((x) => x is Uint8ClampedArray, 'is a Uint8ClampedArray');
var isIntList =
predicate((x) => x is List<int>, 'is a List<int>');
- useHtmlConfiguration();
test('Instanceof', () {
- expect(canvas, isNot(isCanvasRenderingContext));
- expect(canvas, isNot(isCanvasRenderingContext2D));
+ expect(canvas, isNotCanvasRenderingContext);
+ expect(canvas, isNotCanvasRenderingContext2D);
expect(canvas, isElement);
expect(canvas, isCanvasElement);
- expect(canvas, isNot(isImageData));
+ expect(canvas, isNotImageData);
// expect(canvas, isNot(isCanvasPixelArray));
CanvasRenderingContext2D context = canvas.getContext('2d');
expect(context, isCanvasRenderingContext);
expect(context, isCanvasRenderingContext2D);
- expect(context, isNot(isElement));
- expect(context, isNot(isCanvasElement));
- expect(context, isNot(isImageData));
+ expect(context, isNotElement);
+ expect(context, isNotCanvasElement);
+ expect(context, isNotImageData);
// expect(context, isNot(isCanvasPixelArray));
// FIXME(b/5286633): Interface injection type check workaround.
var image = context.createImageData(canvas.width as dynamic,
canvas.height as dynamic);
- expect(image, isNot(isCanvasRenderingContext));
- expect(image, isNot(isCanvasRenderingContext2D));
- expect(image, isNot(isElement));
- expect(image, isNot(isCanvasElement));
+ expect(image, isNotCanvasRenderingContext);
+ expect(image, isNotCanvasRenderingContext2D);
+ expect(image, isNotElement);
+ expect(image, isNotCanvasElement);
expect(image, isImageData);
// expect(image, isNot(isCanvasPixelArray));
// Include CanvasPixelArray since constructor and prototype are not
// available until one is created.
var bytes = image.data;
- expect(bytes, isNot(isCanvasRenderingContext));
- expect(bytes, isNot(isCanvasRenderingContext2D));
- expect(bytes, isNot(isElement));
- expect(bytes, isNot(isCanvasElement));
- expect(bytes, isNot(isImageData));
+ expect(bytes, isNotCanvasRenderingContext);
+ expect(bytes, isNotCanvasRenderingContext2D);
+ expect(bytes, isNotElement);
+ expect(bytes, isNotCanvasElement);
+ expect(bytes, isNotImageData);
expect(bytes, isIntList);
// FIXME: Ensure this is an SpanElement when we next update

Powered by Google App Engine
This is Rietveld 408576698