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

Unified Diff: pkg/polymer/lib/testing/testing.js

Issue 23461006: Moved test changes to dart-lang (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged Created 7 years, 4 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: pkg/polymer/lib/testing/testing.js
diff --git a/pkg/polymer/lib/testing/testing.js b/pkg/polymer/lib/testing/testing.js
index de27047f288bd8051ae87c3d72d8ca7ea085845f..957a48c1d70696faff3124c493e289347f09f7fc 100644
--- a/pkg/polymer/lib/testing/testing.js
+++ b/pkg/polymer/lib/testing/testing.js
@@ -55,18 +55,35 @@
cleanTree(n);
}
- // Remove dart-port attributes
- if (node.attributes) {
- for (var i = 0; i < node.attributes.length; i++) {
- if (node.attributes[i].value.indexOf('dart-port') == 0) {
- node.removeAttribute(i);
+ // TODO(terry): Need to remove attributes in the dart-port: namespace
+ // these are added for JS interop. See bug
+ // https://code.google.com/p/dart/issues/detail?id=12645
+ // The new dart:js shouldn't need these attrs for dart2js or
+ // Dartium (won't need with native support) then remove the
+ // below code.
+ // Remove JS interop dart-port attributes,
+ if (node.tagName == 'HTML' && node.attributes) {
+ for (var i = node.attributes.length; i--; i >= 0) {
+ var attrNode = node.attributes[i];
+ if (attrNode && attrNode.name.indexOf('dart-port:') == 0) {
+ node.removeAttributeNode(attrNode);
}
}
}
- if (node.tagName == 'script' &&
- node.textContent.indexOf('_DART_TEMPORARY_ATTACHED') >= 0) {
- node.parentNode.removeChild(node);
+ if (node.tagName == 'SCRIPT') {
+ if (node.textContent.indexOf('_DART_TEMPORARY_ATTACHED') >= 0) {
+ node.parentNode.removeChild(node);
+ } else {
+ // Remove the JS Interop script.
+ var typeAttr = node.getAttributeNode("type");
+ if (typeAttr && typeAttr.value == "text/javascript") {
+ if (node.textContent.indexOf(
+ "(function() {\n // Proxy support for js.dart.\n\n") == 0) {
+ node.parentNode.removeChild(node);
+ }
+ }
+ }
}
}
« no previous file with comments | « pkg/polymer/lib/src/emitters.dart ('k') | samples/third_party/todomvc/test/expected/todomvc_listorder_test.html.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698