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

Side by Side Diff: LayoutTests/dart/Multiscript.dart

Issue 974273003: Revert "Revert "Support multiple DOM isolates and tweak devtools frontend to better handle large #s… (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/dartium
Patch Set: Created 5 years, 9 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/dart/Multiscript.html » ('j') | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Dart test for testing isolation across multiple script tags. 5 // Dart test for testing isolation across multiple script tags.
6 library multiscript; 6 library multiscript;
7 import 'dart:async'; 7 import 'dart:js' as js;
8 8
9 class State { 9 class State {
10 static int s = 0; 10 // Static stored in Dart so there is a unique value in each Dart DOM isolate.
11 static _update() { s++; } 11 static int sDart = 0;
12 static int record(int value) { 12 static update() {
13 _update(); 13 sDart++;
14 _results.add(value); 14 js.context['sJs']++;
15 if (_results.length == 4) {
16 _completer.complete(_results);
17 }
18 } 15 }
19 static final _completer = new Completer(); 16
20 static final _results = new List(); 17 // Static stored on the JS side of the world so there is one value for it
21 static Future<List<int>> result = _completer.future; 18 // across all Dart DOM isolates.
19 static int get sJs => js.context['sJs'];
20
21 static registerCallback(int index, Function callback) {
22 js.context.callMethod('registerCallback', [index, callback]);
23 }
22 } 24 }
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/dart/Multiscript.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698