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

Unified Diff: LayoutTests/dart/WindowAttrs.html

Issue 1532413002: Added Dartium changes onto 45.0.2454.104 (Closed) Base URL: http://src.chromium.org/blink/branches/chromium/2454
Patch Set: Created 5 years 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/Window-postMessage-expected.txt ('k') | LayoutTests/dart/WindowAttrs-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/dart/WindowAttrs.html
diff --git a/LayoutTests/dart/WindowAttrs.html b/LayoutTests/dart/WindowAttrs.html
new file mode 100644
index 0000000000000000000000000000000000000000..ee356bd1c417f48728be2067f8efd18fa68ff15c
--- /dev/null
+++ b/LayoutTests/dart/WindowAttrs.html
@@ -0,0 +1,52 @@
+<html>
+<body>
+
+<div id='foo'></div>
+
+<script type="application/dart">
+import 'dart:html';
+
+void main() {
+ log("window.document is Document: ${document is Document}");
+ // FIXME: move into separate HTMLDocument test.
+ Element foo = document.query('#foo');
+ log("window.document.query('#foo') is DivElement: ${foo is DivElement}");
+ Element missing = document.query('#missing_id');
+ log("window.document.query('#missing_id'): $missing");
+ bool closed = window.closed;
+ log("window.closed: $closed");
+ window.name = "WindowAttr";
+ String name = window.name;
+ log("window.name: '$name'");
+ mustThrow("window.name = 239", () { window.name = 239; });
+ // Note: later we may rethink it and treat null as allowed value.
+ mustThrow("window.name = null", () { window.name = null; });
+ mustThrow("window.onload = 239", () { window.onload = 239; });
+ log("PASS");
+}
+
+void mustThrow(String snippet, void code()) {
+ // FIXME: re-enable when we don't immediately output exceptions into stdout.
+ return;
+ try {
+ code();
+ log("FAILED: $snippet should have thrown");
+ } catch(e) {
+ log("$snippet threw $e");
+ }
+}
+
+void log(String msg) {
+ Element element = new Element.tag('div');
+ element.innerHtml = msg;
+ document.body.nodes.add(element);
+}
+</script>
+
+<script>
+ if (window.testRunner)
+ window.testRunner.dumpAsText();
+</script>
+
+</body>
+</html>
« no previous file with comments | « LayoutTests/dart/Window-postMessage-expected.txt ('k') | LayoutTests/dart/WindowAttrs-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698