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

Unified Diff: tests/compiler/dart2js_native/native_novel_html_test.dart

Issue 2984403002: dart2js_native tests: Migrate 'native STRING' to JS-calls (Closed)
Patch Set: the rest of the files Created 3 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
Index: tests/compiler/dart2js_native/native_novel_html_test.dart
diff --git a/tests/compiler/dart2js_native/native_novel_html_test.dart b/tests/compiler/dart2js_native/native_novel_html_test.dart
index 81da1fad992612c2b41cf8bc05e40f417c1d0050..19f9ecae882a9909bdc89459ba1e421471efd7c5 100644
--- a/tests/compiler/dart2js_native/native_novel_html_test.dart
+++ b/tests/compiler/dart2js_native/native_novel_html_test.dart
@@ -15,23 +15,26 @@ class Element {
makeE() native;
makeF() native;
-void setup() native """
-// A novel HTML element.
-function HTMLGoofyElement(){}
-HTMLGoofyElement.prototype.nativeMethod = function(a) {
- return 'Goofy.nativeMethod(' + a + ')';
-};
-makeE = function(){return new HTMLGoofyElement};
-
-// A non-HTML element with a misleading name.
-function HTMLFakeyElement(){}
-HTMLFakeyElement.prototype.nativeMethod = function(a) {
- return 'Fakey.nativeMethod(' + a + ')';
-};
-makeF = function(){return new HTMLFakeyElement};
-
-self.nativeConstructor(HTMLGoofyElement);
-""";
+void setup() {
+ JS('', r"""
+(function(){
+ // A novel HTML element.
+ function HTMLGoofyElement(){}
+ HTMLGoofyElement.prototype.nativeMethod = function(a) {
+ return 'Goofy.nativeMethod(' + a + ')';
+ };
+ makeE = function(){return new HTMLGoofyElement()};
+
+ // A non-HTML element with a misleading name.
+ function HTMLFakeyElement(){}
+ HTMLFakeyElement.prototype.nativeMethod = function(a) {
+ return 'Fakey.nativeMethod(' + a + ')';
+ };
+ makeF = function(){return new HTMLFakeyElement()};
+
+ self.nativeConstructor(HTMLGoofyElement);
+})()""");
+}
main() {
nativeTesting();

Powered by Google App Engine
This is Rietveld 408576698