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

Unified Diff: LayoutTests/dart/multiscript-js-interop.dart

Issue 1663753002: Apply all blink changes between @202695 and tip of trunk (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/2454_1
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/dart/multi-wrapper-frame-test.html ('k') | LayoutTests/dart/multiscript-js-interop.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/dart/multiscript-js-interop.dart
diff --git a/LayoutTests/dart/multiscript-js-interop.dart b/LayoutTests/dart/multiscript-js-interop.dart
new file mode 100644
index 0000000000000000000000000000000000000000..a795bffa5701baca80bd8f7bce3455bde587e2d2
--- /dev/null
+++ b/LayoutTests/dart/multiscript-js-interop.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2015, 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.
+
+// Dart test for testing isolation across multiple script tags.
+library multiscript_js_interop;
+import 'package:js/js.dart';
+
+typedef int GetValue();
+
+@JS('window')
+class State {
+ // Static stored in Dart so there is a unique value in each Dart DOM isolate.
+ static int sDart = 0;
+
+ @JS('sJs')
+ external static List<UpdateValue> get sJs;
+ @JS('sJs')
+ external static set sJs(List<UpdateValue> v);
+
+ static int getValue() { return sDart; }
+
+ static update() {
+ sDart++;
+ // We set this JS value from Dart to verify that JS Interop can pass Arrays
+ // between Dart and JS correctly.
+ if (sJs == null) {
+ sJs = <UpdateValue>[];
+ }
+ sJs.add(allowInterop(getValue));
+ }
+
+ @JS('registerCallback')
+ external static registerCallback(int index, Function callback);
+}
« no previous file with comments | « LayoutTests/dart/multi-wrapper-frame-test.html ('k') | LayoutTests/dart/multiscript-js-interop.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698