From 19a5147493db11d2029b02ca20e47dfbeb972f77 Mon Sep 17 00:00:00 2001 From: "ahe@google.com" Date: Tue, 25 Mar 2014 14:08:36 +0000 Subject: [PATCH] Add a test suite for Try Dart! R=kasperl@google.com, lukechurch@google.com Review URL: https://codereview.chromium.org//210873002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34360 260f80e4-7a28-3924-810f-c04153c831b5 --- tests/try/paste_content_rewriting_test.dart | 40 +++++++++++++++++++++ tests/try/try.status | 10 ++++++ tools/test.dart | 1 + 3 files changed, 51 insertions(+) create mode 100644 tests/try/paste_content_rewriting_test.dart create mode 100644 tests/try/try.status diff --git a/tests/try/paste_content_rewriting_test.dart b/tests/try/paste_content_rewriting_test.dart new file mode 100644 index 00000000000..cfe9418a155 --- /dev/null +++ b/tests/try/paste_content_rewriting_test.dart @@ -0,0 +1,40 @@ +// Copyright (c) 2014, 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. + +// SharedOptions=--package-root=sdk/lib/_internal/ + +library trydart.paste_test; + +import 'dart:html'; +import 'dart:async'; + +import '../../site/try/src/interaction_manager.dart' show + InteractionManager; + +import '../../site/try/src/ui.dart' show + inputPre, + observer; + +import '../../site/try/src/user_option.dart' show + UserOption; + +import '../../pkg/expect/lib/expect.dart'; +import '../../pkg/async_helper/lib/async_helper.dart'; + +main() { + UserOption.storage = {}; + + var interaction = new InteractionManager(); + inputPre = new DivElement(); + document.body.append(inputPre); + observer = new MutationObserver(interaction.onMutation) + ..observe(inputPre, childList: true, characterData: true, subtree: true); + + inputPre.innerHtml = "

//...

}
"; + + asyncTest(() => new Future(() { + print('Welcome to the future'); + Expect.stringEquals('//...\n}\n', inputPre.text); + })); +} diff --git a/tests/try/try.status b/tests/try/try.status new file mode 100644 index 00000000000..1d6b0719315 --- /dev/null +++ b/tests/try/try.status @@ -0,0 +1,10 @@ +# Copyright (c) 2014, 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. + +# Not dart2js on chrome or drt. +[ $compiler != dart2js || ($runtime != drt && $runtime != chrome) ] +*: Skip + +[ $compiler == dart2js && ($runtime == drt || $runtime == chrome) ] +paste_content_rewriting_test: Fail # http://dartbug.com/17726 diff --git a/tools/test.dart b/tools/test.dart index b4f7b630d9e..3a6c14ac539 100755 --- a/tools/test.dart +++ b/tools/test.dart @@ -62,6 +62,7 @@ final TEST_SUITE_DIRECTORIES = [ new Path('tests/language'), new Path('tests/lib'), new Path('tests/standalone'), + new Path('tests/try'), new Path('tests/utils'), new Path('utils/tests/css'), new Path('utils/tests/peg'),