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

Side by Side Diff: tests/html/custom/js_custom_test.dart

Issue 47073010: Removing window.console.log from js_custom_test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library js_custom_test; 5 library js_custom_test;
6 6
7 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
8 import 'package:unittest/html_config.dart'; 8 import 'package:unittest/html_config.dart';
9 import 'dart:html'; 9 import 'dart:html';
10 import '../utils.dart'; 10 import '../utils.dart';
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 expect(a.attributes['fromJS'], 'true'); 49 expect(a.attributes['fromJS'], 'true');
50 }); 50 });
51 51
52 test('accessing custom JS element from Dart', () { 52 test('accessing custom JS element from Dart', () {
53 var script = ''' 53 var script = '''
54 var Foo = document.register('x-foo', { 54 var Foo = document.register('x-foo', {
55 prototype: Object.create(HTMLElement.prototype, { 55 prototype: Object.create(HTMLElement.prototype, {
56 createdCallback: { 56 createdCallback: {
57 value: function() { 57 value: function() {
58 window.console.log('Foo created!');
59 this.setAttribute('fromJS', 'true'); 58 this.setAttribute('fromJS', 'true');
60 } 59 }
61 } 60 }
62 })}); 61 })});
63 var foo = new Foo(); 62 var foo = new Foo();
64 foo.id = 'b'; 63 foo.id = 'b';
65 document.body.appendChild(foo); 64 document.body.appendChild(foo);
66 '''; 65 ''';
67 66
68 document.body.append(new ScriptElement()..text = script); 67 document.body.append(new ScriptElement()..text = script);
69 var custom = document.querySelector('#b'); 68 var custom = document.querySelector('#b');
70 expect(custom is HtmlElement, isTrue); 69 expect(custom is HtmlElement, isTrue);
71 expect(custom.attributes['fromJS'], 'true'); 70 expect(custom.attributes['fromJS'], 'true');
72 }); 71 });
73 } 72 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698