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

Side by Side Diff: LayoutTests/dart/WindowAttrs.html

Issue 9188009: Things to unfork. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <html>
2 <body>
3
4 <div id='foo'></div>
5
6 <script type="application/dart">
7 #import("dart:dom");
8
9 void main() {
10 if (null !== layoutTestController) {
11 layoutTestController.dumpAsText();
12 }
13 log("window.document: $document");
14 // FIXME: move into separate HTMLDocument test.
15 HTMLElement foo = document.getElementById('foo');
16 log("window.document.getElementById('foo'): $foo");
17 HTMLElement missing = document.getElementById('missing_id');
18 log("window.document.getElementById('missing_id'): $missing");
19 bool closed = window.closed;
20 log("window.closed: $closed");
21 window.name = "WindowAttr";
22 String name = window.name;
23 log("window.name: '$name'");
24 mustThrow("window.name = 239", function() { window.name = 239; });
25 // Note: later we may rethink it and treat null as allowed value.
26 mustThrow("window.name = null", function() { window.name = null; });
27 mustThrow("window.onload = 239", function() { window.onload = 239; });
28 log("PASS");
29 }
30
31 void mustThrow(String snippet, void code()) {
32 // FIXME: re-enable when we don't immediately output exceptions into stdout.
33 return;
34 try {
35 code();
36 log("FAILED: $snippet should have thrown");
37 } catch(var e) {
38 log("$snippet threw $e");
39 }
40 }
41
42 void log(String msg) {
43 HTMLElement element = document.createElement('div');
44 element.innerHTML = msg;
45 document.body.appendChild(element);
46 }
47 </script>
48
49 <script>
50 // Fake script to trigger Dart execution.
51 </script>
52
53 </body>
54 </html>
OLDNEW
« 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