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

Unified Diff: tests/html/js_typed_interop_test.dart

Issue 1415463019: Make Dartium JS interop implementation more robust in the presence of JS paths that touch dart:html… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « sdk/lib/js/dartium/js_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/js_typed_interop_test.dart
diff --git a/tests/html/js_typed_interop_test.dart b/tests/html/js_typed_interop_test.dart
index 0e7cd0c301e0095936adeb5787c03fb7657478f9..14d931f0d69ec46d16ee00151d29406804ad76fe 100644
--- a/tests/html/js_typed_interop_test.dart
+++ b/tests/html/js_typed_interop_test.dart
@@ -86,6 +86,11 @@ _injectJs() {
return this.str.charCodeAt(index);
}
};
+ function getCanvasContext() {
+ return document.createElement('canvas').getContext('2d');
+ }
+ window.windowProperty = 42;
+ document.documentProperty = 45;
""");
}
@@ -176,6 +181,15 @@ class StringWrapper {
@JS()
external confuse(obj);
+@JS()
+external CanvasRenderingContext2D getCanvasContext();
+
+@JS('window.window.document.documentProperty')
+external num get propertyOnDocument;
+
+@JS('window.self.window.window.windowProperty')
+external num get propertyOnWindow;
+
main() {
_injectJs();
@@ -374,4 +388,13 @@ main() {
expect(selection is List, isTrue);
});
});
+ group('html', () {
+ test('return html type', () {
+ expect(getCanvasContext() is CanvasRenderingContext2D, isTrue);
+ });
+ test('js path contains html types', () {
Alan Knight 2015/11/04 18:44:14 nit: Not clear to me what this testing.
Jacob 2015/11/04 19:01:30 This case would fail previously note the path to
+ expect(propertyOnWindow, equals(42));
+ expect(propertyOnDocument, equals(45));
+ });
+ });
}
« no previous file with comments | « sdk/lib/js/dartium/js_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698