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

Unified Diff: tests/html/js_type_test.dart

Issue 2134973002: Revert "Type test tests for js interop" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/js_type_test.dart
diff --git a/tests/html/js_type_test.dart b/tests/html/js_type_test.dart
deleted file mode 100644
index f8c9e43bdb2e82cc466dc2d250b789482da53d1d..0000000000000000000000000000000000000000
--- a/tests/html/js_type_test.dart
+++ /dev/null
@@ -1,163 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library jsTest;
-
-import 'dart:html';
-
-import 'package:js/js.dart';
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_individual_config.dart';
-import 'package:expect/expect.dart' show NoInline, AssumeDynamic;
-
-const _SCRIPT_TEXT = r"""
- function Foo() {}
-""";
-
-@JS()
-class Foo {
- external factory Foo();
-}
-
-class Bar {}
-
-_injectJs(String text) {
- final script = new ScriptElement();
- script.type = 'text/javascript';
- script.innerHtml = text;
- document.body.append(script);
-}
-
-@NoInline() @AssumeDynamic()
-confuse(x) => x;
-
-class Is<T> {
- const Is();
- check(o) => o is T;
-}
-
-main() {
- _injectJs(_SCRIPT_TEXT);
- useHtmlIndividualConfiguration();
-
- new Is<Foo>().check(new Bar()); // Bar is instantiated by this code.
- new Is<Foo>().check([]);
- new Is<List>().check([]);
-
- group('static', () {
- test('not-String', () {
- Foo e = new Foo();
- expect(e is String, isFalse);
- });
-
- test('not-int', () {
- Foo e = new Foo();
- expect(e is int, isFalse);
- });
-
- test('not-Null', () {
- Foo e = new Foo();
- expect(e is Null, isFalse);
- });
-
- test('not-Bar', () {
- Foo e = new Foo();
- expect(e is Bar, isFalse);
- });
-
- test('is-Foo', () {
- Foo e = new Foo();
- expect(e is Foo, isTrue);
- });
-
- test('String-not-Foo', () {
- String e = 'hello';
- expect(e is Foo, isFalse);
- });
- });
-
- group('dynamic', () {
- test('not-String', () {
- var e = confuse(new Foo());
- expect(e is String, isFalse);
- });
-
- test('not-int', () {
- var e = confuse(new Foo());
- expect(e is int, isFalse);
- });
-
- test('not-Null', () {
- var e = confuse(new Foo());
- expect(e is Null, isFalse);
- });
-
- test('not-Bar', () {
- var e = confuse(new Foo());
- expect(e is Bar, isFalse);
- });
-
- test('is-Foo', () {
- var e = confuse(new Foo());
- expect(e is Foo, isTrue);
- });
- });
-
- group('dynamic-String-not-Foo', () {
- test('test', () {
- var e = confuse('hello');
- expect(e is Foo, isFalse);
- });
- });
-
- group('dynamic-null-not-Foo', () {
- test('test', () {
- var e = confuse(null);
- expect(e is Foo, isFalse);
- });
- });
-
- group('dynamic-type', () {
- test('not-String', () {
- var e = confuse(new Foo());
- expect(const Is<String>().check(e), isFalse);
- });
-
- test('not-int', () {
- var e = confuse(new Foo());
- expect(const Is<int>().check(e), isFalse);
- });
-
- test('not-Null', () {
- var e = confuse(new Foo());
- expect(const Is<Null>().check(e), isFalse);
- });
-
- test('not-Bar', () {
- var e = confuse(new Foo());
- expect(const Is<Bar>().check(e), isFalse);
- });
-
- test('is-Foo', () {
- var e = confuse(new Foo());
- expect(const Is<Foo>().check(e), isTrue);
- });
- });
-
- group('dynamic-String-not-dynamic-Foo', () {
- test('test', () {
- var e = confuse('hello');
- expect(const Is<Foo>().check(e), isFalse);
- });
- });
-
- group('dynamic-null-not-dynamic-Foo', () {
- test('test', () {
- var e = confuse(null);
- expect(const Is<Foo>().check(e), isFalse);
- });
- });
-
-}
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698