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

Side by Side Diff: LayoutTests/dart/dom/InstanceOf.dart

Issue 9188009: Things to unfork. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/dart/dom/Implementation-expected.txt ('k') | LayoutTests/dart/dom/InstanceOf.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #import('../../../../../dart/client/testing/unittest/unittest.dart');
2 #import('dart:dom');
3
4 main() {
5 HTMLCanvasElement canvas;
6
7 // FIXME: remove when main is ran on content loaded.
8 window.setTimeout(() {
9 canvas = document.createElement('canvas');
10 canvas.setAttribute('width', '100');
11 canvas.setAttribute('height', '100');
12 document.body.appendChild(canvas);
13 }, 0);
14
15 forLayoutTests();
16 test('Instanceof', () {
17 Expect.isFalse(canvas is CanvasRenderingContext);
18 Expect.isFalse(canvas is CanvasRenderingContext2D);
19 Expect.isTrue(canvas is HTMLElement);
20 Expect.isTrue(canvas is HTMLCanvasElement);
21 Expect.isFalse(canvas is ImageData);
22 Expect.isFalse(canvas is CanvasPixelArray);
23
24 CanvasRenderingContext2D context = canvas.getContext('2d');
25 Expect.isTrue(context is CanvasRenderingContext);
26 Expect.isTrue(context is CanvasRenderingContext2D);
27 Expect.isFalse(context is HTMLElement);
28 Expect.isFalse(context is HTMLCanvasElement);
29 Expect.isFalse(context is ImageData);
30 Expect.isFalse(context is CanvasPixelArray);
31
32 // FIXME(b/5286633): Interface injection type check workaround.
33 var image = context.createImageData(canvas.width.dynamic, canvas.height.dyna mic);
34 Expect.isFalse(image is CanvasRenderingContext);
35 Expect.isFalse(image is CanvasRenderingContext2D);
36 Expect.isFalse(image is HTMLElement);
37 Expect.isFalse(image is HTMLCanvasElement);
38 Expect.isTrue(image is ImageData);
39 Expect.isFalse(image is CanvasPixelArray);
40
41 // Include CanvasPixelArray since constructor and prototype are not
42 // available until one is created.
43 var bytes = image.data;
44 Expect.isFalse(bytes is CanvasRenderingContext);
45 Expect.isFalse(bytes is CanvasRenderingContext2D);
46 Expect.isFalse(bytes is HTMLElement);
47 Expect.isFalse(bytes is HTMLCanvasElement);
48 Expect.isFalse(bytes is ImageData);
49 Expect.isTrue(bytes is CanvasPixelArray);
50
51 // FIXME: Ensure this is an HTMLSpanElement when we next update
52 // WebKit IDL.
53 var span = document.createElement('span');
54 Expect.isTrue(span is HTMLElement);
55 });
56 }
OLDNEW
« no previous file with comments | « LayoutTests/dart/dom/Implementation-expected.txt ('k') | LayoutTests/dart/dom/InstanceOf.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698