-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add all dart:html tests from the sdk to test/codegen. All tests are a…
…dded except for js_array_test.dart and js_dart_to_string_test.dart which have to be stripped out for now due to failures. BUG= R=vsm@google.com Review URL: https://codereview.chromium.org/1930043002 .
- Loading branch information
Showing
214 changed files
with
18,931 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
dart_library.library('html_config', null, /* Imports */[ | ||
'dart_sdk' | ||
], function(exports, dart_sdk) { | ||
'use strict'; | ||
const core = dart_sdk.core; | ||
const dart = dart_sdk.dart; | ||
const dartx = dart_sdk.dartx; | ||
const html_config = Object.create(null); | ||
// Exports: | ||
exports.html_config = html_config; | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
pkg/dev_compiler/test/codegen/expect/unittest/html_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
dart_library.library('html_config', null, /* Imports */[ | ||
'dart_sdk' | ||
], function(exports, dart_sdk) { | ||
'use strict'; | ||
const core = dart_sdk.core; | ||
const dart = dart_sdk.dart; | ||
const dartx = dart_sdk.dartx; | ||
const html_config = Object.create(null); | ||
// Exports: | ||
exports.html_config = html_config; | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
/// A simple unit test library for running tests in a browser. | ||
library unittest.html_config; | ||
|
||
// void useHtmlConfiguration([bool isLayoutTest = false]) { } |
Binary file not shown.
31 changes: 31 additions & 0 deletions
31
pkg/dev_compiler/test/codegen/lib/html/async_cancellingisolate.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
library async_cancellingisolate; | ||
|
||
import 'dart:async'; | ||
import 'package:unittest/unittest.dart'; | ||
|
||
main(message, replyTo) { | ||
var command = message.first; | ||
expect(command, 'START'); | ||
var shot = false; | ||
var oneshot; | ||
var periodic; | ||
periodic = new Timer.periodic(const Duration(milliseconds: 10), (timer) { | ||
expect(shot, isFalse); | ||
shot = true; | ||
expect(timer, same(periodic)); | ||
periodic.cancel(); | ||
oneshot.cancel(); | ||
// Wait some more time to be sure callbacks won't be invoked any | ||
// more. | ||
new Timer(const Duration(milliseconds: 50), () { | ||
replyTo.send('DONE'); | ||
}); | ||
}); | ||
// We launch the oneshot timer after the periodic timer. Otherwise a | ||
// (very long) context switch could make this test flaky: assume the | ||
// oneshot timer is created first and then there is a 30ms context switch. | ||
// when the periodic timer is scheduled it would execute after the oneshot. | ||
oneshot = new Timer(const Duration(milliseconds: 30), () { | ||
fail('Should never be invoked'); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import 'dart:async'; | ||
import 'package:unittest/unittest.dart'; | ||
|
||
main(message, replyTo) { | ||
var command = message.first; | ||
expect(command, 'START'); | ||
new Timer(const Duration(milliseconds: 10), () { | ||
replyTo.send('DONE'); | ||
}); | ||
} | ||
|
24 changes: 24 additions & 0 deletions
24
pkg/dev_compiler/test/codegen/lib/html/async_periodictimer.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
library async_periodictimer; | ||
|
||
import 'dart:async'; | ||
import 'package:unittest/unittest.dart'; | ||
|
||
main(message, replyTo) { | ||
var command = message.first; | ||
expect(command, 'START'); | ||
int counter = 0; | ||
new Timer.periodic(const Duration(milliseconds: 10), (timer) { | ||
if (counter == 3) { | ||
counter = 1024; | ||
timer.cancel(); | ||
// Wait some more time to be sure callback won't be invoked any | ||
// more. | ||
new Timer(const Duration(milliseconds: 30), () { | ||
replyTo.send('DONE'); | ||
}); | ||
return; | ||
} | ||
assert(counter < 3); | ||
counter++; | ||
}); | ||
} |
Oops, something went wrong.