From 1e7c809033fb9bc89d307ef021ed8299b19bd427 Mon Sep 17 00:00:00 2001 From: "nhiroki@chromium.org" Date: Thu, 21 Feb 2013 05:50:49 +0000 Subject: Revert 183709 > Added unit tests for the Dart Chrome.* API wrappers, testing the Dart output mode from JSON Schema Compiler. > > The physical tests I've added are initial dummies - kalman, please take a look at the *structure* of the test setup. It feels like there is a lot of repetition of test names, but I like using python's unittest framework so it runs as a presubmit check. Any hints? > > I have a lot more tests I'd like to add. > > Note that there needs to be functionality to disable tests, e.g. there will need to be some tests that will fail from the IDL return value type bug (https://code.google.com/p/chromium/issues/detail?id=170837). > > Thanks, > > Sasha > > Review URL: https://chromiumcodereview.appspot.com/12218151 TBR=sashab@chromium.org Review URL: https://codereview.chromium.org/12320030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183751 0039d316-1c4b-4281-b951-d872f2087c98 --- .../dart_test/basic_event.dart | 40 ------- .../json_schema_compiler/dart_test/basic_event.idl | 10 -- .../dart_test/basic_function.dart | 29 ------ .../dart_test/basic_function.idl | 13 --- .../json_schema_compiler/dart_test/basic_type.dart | 77 -------------- .../json_schema_compiler/dart_test/basic_type.idl | 20 ---- tools/json_schema_compiler/dart_test/comments.dart | 31 ------ tools/json_schema_compiler/dart_test/comments.idl | 32 ------ .../dart_test/complex_type.dart | 86 --------------- .../dart_test/complex_type.idl | 23 ---- .../dart_test/empty_namespace.dart | 19 ---- .../dart_test/empty_namespace.idl | 6 -- .../json_schema_compiler/dart_test/empty_type.dart | 37 ------- .../json_schema_compiler/dart_test/empty_type.idl | 9 -- .../dart_test/operatable_type.dart | 49 --------- .../dart_test/operatable_type.idl | 14 --- tools/json_schema_compiler/dart_test/tags.dart | 116 --------------------- tools/json_schema_compiler/dart_test/tags.idl | 32 ------ 18 files changed, 643 deletions(-) delete mode 100644 tools/json_schema_compiler/dart_test/basic_event.dart delete mode 100644 tools/json_schema_compiler/dart_test/basic_event.idl delete mode 100644 tools/json_schema_compiler/dart_test/basic_function.dart delete mode 100644 tools/json_schema_compiler/dart_test/basic_function.idl delete mode 100644 tools/json_schema_compiler/dart_test/basic_type.dart delete mode 100644 tools/json_schema_compiler/dart_test/basic_type.idl delete mode 100644 tools/json_schema_compiler/dart_test/comments.dart delete mode 100644 tools/json_schema_compiler/dart_test/comments.idl delete mode 100644 tools/json_schema_compiler/dart_test/complex_type.dart delete mode 100644 tools/json_schema_compiler/dart_test/complex_type.idl delete mode 100644 tools/json_schema_compiler/dart_test/empty_namespace.dart delete mode 100644 tools/json_schema_compiler/dart_test/empty_namespace.idl delete mode 100644 tools/json_schema_compiler/dart_test/empty_type.dart delete mode 100644 tools/json_schema_compiler/dart_test/empty_type.idl delete mode 100644 tools/json_schema_compiler/dart_test/operatable_type.dart delete mode 100644 tools/json_schema_compiler/dart_test/operatable_type.idl delete mode 100644 tools/json_schema_compiler/dart_test/tags.dart delete mode 100644 tools/json_schema_compiler/dart_test/tags.idl (limited to 'tools/json_schema_compiler/dart_test') diff --git a/tools/json_schema_compiler/dart_test/basic_event.dart b/tools/json_schema_compiler/dart_test/basic_event.dart deleted file mode 100644 index 905ab7f..0000000 --- a/tools/json_schema_compiler/dart_test/basic_event.dart +++ /dev/null @@ -1,40 +0,0 @@ -// 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. - -// Generated from namespace: basic_event - -part of chrome; -/** - * Events - */ - -/// Documentation for basicEvent. -class Event_basic_event_basicEvent extends Event { - void addListener(void callback()) => super.addListener(callback); - - void removeListener(void callback()) => super.removeListener(callback); - - bool hasListener(void callback()) => super.hasListener(callback); - - Event_basic_event_basicEvent(jsObject) : super._(jsObject, 0); -} - -/** - * Functions - */ - -class API_basic_event { - /* - * API connection - */ - Object _jsObject; - - /* - * Events - */ - Event_basic_event_basicEvent basicEvent; - API_basic_event(this._jsObject) { - basicEvent = new Event_basic_event_basicEvent(JS('', '#.basicEvent', this._jsObject)); - } -} diff --git a/tools/json_schema_compiler/dart_test/basic_event.idl b/tools/json_schema_compiler/dart_test/basic_event.idl deleted file mode 100644 index 8e5e13c..0000000 --- a/tools/json_schema_compiler/dart_test/basic_event.idl +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -namespace basic_event { - interface Events { - // Documentation for basicEvent. - static void basicEvent(); - }; -}; diff --git a/tools/json_schema_compiler/dart_test/basic_function.dart b/tools/json_schema_compiler/dart_test/basic_function.dart deleted file mode 100644 index 3eb7947..0000000 --- a/tools/json_schema_compiler/dart_test/basic_function.dart +++ /dev/null @@ -1,29 +0,0 @@ -// 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. - -// Generated from namespace: basic_function - -part of chrome; -/** - * Functions - */ - -class API_basic_function { - /* - * API connection - */ - Object _jsObject; - - /* - * Functions - */ - /// Documentation for the basic function, foo(). - void foo() => JS('void', '#.foo()', this._jsObject); - - /// Documentation for the basic static function, staticFoo(). - void staticFoo() => JS('void', '#.staticFoo()', this._jsObject); - - API_basic_function(this._jsObject) { - } -} diff --git a/tools/json_schema_compiler/dart_test/basic_function.idl b/tools/json_schema_compiler/dart_test/basic_function.idl deleted file mode 100644 index 29f62be..0000000 --- a/tools/json_schema_compiler/dart_test/basic_function.idl +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -namespace basic_function { - interface Functions { - // Documentation for the basic function, foo(). - void foo(); - - // Documentation for the basic static function, staticFoo(). - static void staticFoo(); - }; -}; diff --git a/tools/json_schema_compiler/dart_test/basic_type.dart b/tools/json_schema_compiler/dart_test/basic_type.dart deleted file mode 100644 index 53183d0..0000000 --- a/tools/json_schema_compiler/dart_test/basic_type.dart +++ /dev/null @@ -1,77 +0,0 @@ -// 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. - -// Generated from namespace: basic_type - -part of chrome; - -/** - * Types - */ - -class Basic_typeBasicType extends ChromeObject { - /* - * Public constructor - */ - Basic_typeBasicType({String s, int i, int l, double d}) { - if (?s) - this.s = s; - if (?i) - this.i = i; - if (?l) - this.l = l; - if (?d) - this.d = d; - } - - /* - * Private constructor - */ - Basic_typeBasicType._proxy(_jsObject) : super._proxy(_jsObject); - - /* - * Public accessors - */ - /// Documentation for the String s. - String get s => JS('String', '#.s', this._jsObject); - - void set s(String s) { - JS('void', '#.s = #', this._jsObject, s); - } - - /// Documentation for the int i. - int get i => JS('int', '#.i', this._jsObject); - - void set i(int i) { - JS('void', '#.i = #', this._jsObject, i); - } - - /// Documentation for the long l. - int get l => JS('int', '#.l', this._jsObject); - - void set l(int l) { - JS('void', '#.l = #', this._jsObject, l); - } - - /// Documentation for the double d. - double get d => JS('double', '#.d', this._jsObject); - - void set d(double d) { - JS('void', '#.d = #', this._jsObject, d); - } - -} - -/** - * Functions - */ - -class API_basic_type { - /* - * API connection - */ - Object _jsObject; - API_basic_type(this._jsObject) { - } -} diff --git a/tools/json_schema_compiler/dart_test/basic_type.idl b/tools/json_schema_compiler/dart_test/basic_type.idl deleted file mode 100644 index 52837f8..0000000 --- a/tools/json_schema_compiler/dart_test/basic_type.idl +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -namespace basic_type { - // Documentation for BasicType. - dictionary BasicType { - // Documentation for the String s. - DOMString s; - - // Documentation for the int i. - int i; - - // Documentation for the long l. - long l; - - // Documentation for the double d. - double d; - }; -}; diff --git a/tools/json_schema_compiler/dart_test/comments.dart b/tools/json_schema_compiler/dart_test/comments.dart deleted file mode 100644 index d734d56..0000000 --- a/tools/json_schema_compiler/dart_test/comments.dart +++ /dev/null @@ -1,31 +0,0 @@ -// 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. - -// Generated from namespace: comments - -part of chrome; -/** - * Functions - */ - -class API_comments { - /* - * API connection - */ - Object _jsObject; - - /* - * Functions - */ - /// There's a blank line at the start of this comment. Documentation for - /// basicFunction. BasicFunction() is a great function. There is a newline - /// after this.

It works like so: +-----+ | | - /// +--+ | | | | +-----+ --> +--+

Some other - /// stuff here. This paragraph starts with whitespace. Overall, its a - /// great function. There's also a blank line at the end of this comment. - void basicFunction() => JS('void', '#.basicFunction()', this._jsObject); - - API_comments(this._jsObject) { - } -} diff --git a/tools/json_schema_compiler/dart_test/comments.idl b/tools/json_schema_compiler/dart_test/comments.idl deleted file mode 100644 index 867d289..0000000 --- a/tools/json_schema_compiler/dart_test/comments.idl +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This comment is for the comments namespace. -namespace comments { - // This comments the "Functions" block, and should be ignored. - interface Functions { - // This comment is separated by at least one blank line from the start of - // the function, and should be ignored. - - // - // There's a blank line at the start of this comment. - // - // Documentation for basicFunction. - // BasicFunction() is a great function. - // There is a newline after this. - // - // It works like so: - // +-----+ - // | | +--+ - // | | | | - // +-----+ --> +--+ - // - // Some other stuff here. - // This paragraph starts with whitespace. - // Overall, its a great function. - // There's also a blank line at the end of this comment. - // - static void basicFunction(); - }; -}; diff --git a/tools/json_schema_compiler/dart_test/complex_type.dart b/tools/json_schema_compiler/dart_test/complex_type.dart deleted file mode 100644 index f66821a..0000000 --- a/tools/json_schema_compiler/dart_test/complex_type.dart +++ /dev/null @@ -1,86 +0,0 @@ -// 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. - -// Generated from namespace: complex_type - -part of chrome; - -/** - * Types - */ - -class Complex_typeComplexType extends ChromeObject { - /* - * Public constructor - */ - Complex_typeComplexType({String s, int i, int l, double d, Complex_typeComplexType c}) { - if (?s) - this.s = s; - if (?i) - this.i = i; - if (?l) - this.l = l; - if (?d) - this.d = d; - if (?c) - this.c = c; - } - - /* - * Private constructor - */ - Complex_typeComplexType._proxy(_jsObject) : super._proxy(_jsObject); - - /* - * Public accessors - */ - /// Documentation for the String s. - String get s => JS('String', '#.s', this._jsObject); - - void set s(String s) { - JS('void', '#.s = #', this._jsObject, s); - } - - /// Documentation for the int i. - int get i => JS('int', '#.i', this._jsObject); - - void set i(int i) { - JS('void', '#.i = #', this._jsObject, i); - } - - /// Documentation for the long l. - int get l => JS('int', '#.l', this._jsObject); - - void set l(int l) { - JS('void', '#.l = #', this._jsObject, l); - } - - /// Documentation for the double d. - double get d => JS('double', '#.d', this._jsObject); - - void set d(double d) { - JS('void', '#.d = #', this._jsObject, d); - } - - /// Documentation for the ComplexType c. - Complex_typeComplexType get c => new Complex_typeComplexType._proxy(JS('', '#.c', this._jsObject)); - - void set c(Complex_typeComplexType c) { - JS('void', '#.c = #', this._jsObject, convertArgument(c)); - } - -} - -/** - * Functions - */ - -class API_complex_type { - /* - * API connection - */ - Object _jsObject; - API_complex_type(this._jsObject) { - } -} diff --git a/tools/json_schema_compiler/dart_test/complex_type.idl b/tools/json_schema_compiler/dart_test/complex_type.idl deleted file mode 100644 index c75f97e..0000000 --- a/tools/json_schema_compiler/dart_test/complex_type.idl +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -namespace complex_type { - // Documentation for ComplexType. - dictionary ComplexType { - // Documentation for the String s. - DOMString s; - - // Documentation for the int i. - int i; - - // Documentation for the long l. - long l; - - // Documentation for the double d. - double d; - - // Documentation for the ComplexType c. - ComplexType c; - }; -}; diff --git a/tools/json_schema_compiler/dart_test/empty_namespace.dart b/tools/json_schema_compiler/dart_test/empty_namespace.dart deleted file mode 100644 index d2378a2..0000000 --- a/tools/json_schema_compiler/dart_test/empty_namespace.dart +++ /dev/null @@ -1,19 +0,0 @@ -// 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. - -// Generated from namespace: empty_namespace - -part of chrome; -/** - * Functions - */ - -class API_empty_namespace { - /* - * API connection - */ - Object _jsObject; - API_empty_namespace(this._jsObject) { - } -} diff --git a/tools/json_schema_compiler/dart_test/empty_namespace.idl b/tools/json_schema_compiler/dart_test/empty_namespace.idl deleted file mode 100644 index 5a5ea03..0000000 --- a/tools/json_schema_compiler/dart_test/empty_namespace.idl +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -namespace empty_namespace { -}; diff --git a/tools/json_schema_compiler/dart_test/empty_type.dart b/tools/json_schema_compiler/dart_test/empty_type.dart deleted file mode 100644 index ebe8e69..0000000 --- a/tools/json_schema_compiler/dart_test/empty_type.dart +++ /dev/null @@ -1,37 +0,0 @@ -// 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. - -// Generated from namespace: empty_type - -part of chrome; - -/** - * Types - */ - -class Empty_typeEmptyType extends ChromeObject { - /* - * Public constructor - */ - Empty_typeEmptyType({}) { - } - - /* - * Private constructor - */ - Empty_typeEmptyType._proxy(_jsObject) : super._proxy(_jsObject); -} - -/** - * Functions - */ - -class API_empty_type { - /* - * API connection - */ - Object _jsObject; - API_empty_type(this._jsObject) { - } -} diff --git a/tools/json_schema_compiler/dart_test/empty_type.idl b/tools/json_schema_compiler/dart_test/empty_type.idl deleted file mode 100644 index af5de84..0000000 --- a/tools/json_schema_compiler/dart_test/empty_type.idl +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -namespace empty_type { - // Documentation for EmptyType. - dictionary EmptyType { - }; -}; diff --git a/tools/json_schema_compiler/dart_test/operatable_type.dart b/tools/json_schema_compiler/dart_test/operatable_type.dart deleted file mode 100644 index 9e3d708..0000000 --- a/tools/json_schema_compiler/dart_test/operatable_type.dart +++ /dev/null @@ -1,49 +0,0 @@ -// 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. - -// Generated from namespace: operatable_type - -part of chrome; - -/** - * Types - */ - -class Operatable_typeOperatableType extends ChromeObject { - /* - * Private constructor - */ - Operatable_typeOperatableType._proxy(_jsObject) : super._proxy(_jsObject); - - /* - * Public accessors - */ - /// Documentation for the String t. - String get t => JS('String', '#.t', this._jsObject); - - void set t(String t) { - JS('void', '#.t = #', this._jsObject, t); - } - - - /* - * Methods - */ - /// Documentation for staticFoo. - void staticFoo() => JS('void', '#.staticFoo()', this._jsObject); - -} - -/** - * Functions - */ - -class API_operatable_type { - /* - * API connection - */ - Object _jsObject; - API_operatable_type(this._jsObject) { - } -} diff --git a/tools/json_schema_compiler/dart_test/operatable_type.idl b/tools/json_schema_compiler/dart_test/operatable_type.idl deleted file mode 100644 index 64dd382..0000000 --- a/tools/json_schema_compiler/dart_test/operatable_type.idl +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -namespace operatable_type { - // Documentation for OperatableType. - dictionary OperatableType { - // Documentation for the String t. - DOMString t; - - // Documentation for staticFoo. - static void staticFoo(); - }; -}; diff --git a/tools/json_schema_compiler/dart_test/tags.dart b/tools/json_schema_compiler/dart_test/tags.dart deleted file mode 100644 index 78da51a..0000000 --- a/tools/json_schema_compiler/dart_test/tags.dart +++ /dev/null @@ -1,116 +0,0 @@ -// 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. - -// Generated from namespace: tags - -part of chrome; - -/** - * Types - */ - -class TagsInlineDoc extends ChromeObject { - /* - * Public constructor - */ - TagsInlineDoc({}) { - } - - /* - * Private constructor - */ - TagsInlineDoc._proxy(_jsObject) : super._proxy(_jsObject); -} - -class TagsNodoc extends ChromeObject { - /* - * Public constructor - */ - TagsNodoc({}) { - } - - /* - * Private constructor - */ - TagsNodoc._proxy(_jsObject) : super._proxy(_jsObject); -} - -class TagsNocompile extends ChromeObject { - /* - * Public constructor - */ - TagsNocompile({}) { - } - - /* - * Private constructor - */ - TagsNocompile._proxy(_jsObject) : super._proxy(_jsObject); -} - -class TagsPlainDict extends ChromeObject { - /* - * Public constructor - */ - TagsPlainDict({int inline_doc, String nodoc, double nocompile, fileEntry instance_of_tag}) { - if (?inline_doc) - this.inline_doc = inline_doc; - if (?nodoc) - this.nodoc = nodoc; - if (?nocompile) - this.nocompile = nocompile; - if (?instance_of_tag) - this.instance_of_tag = instance_of_tag; - } - - /* - * Private constructor - */ - TagsPlainDict._proxy(_jsObject) : super._proxy(_jsObject); - - /* - * Public accessors - */ - /// This int has the property [inline_doc]. - int get inline_doc => JS('int', '#.inline_doc', this._jsObject); - - void set inline_doc(int inline_doc) { - JS('void', '#.inline_doc = #', this._jsObject, inline_doc); - } - - /// This String has the property [nodoc]. - String get nodoc => JS('String', '#.nodoc', this._jsObject); - - void set nodoc(String nodoc) { - JS('void', '#.nodoc = #', this._jsObject, nodoc); - } - - /// This double has the property [nocompile]. - double get nocompile => JS('double', '#.nocompile', this._jsObject); - - void set nocompile(double nocompile) { - JS('void', '#.nocompile = #', this._jsObject, nocompile); - } - - /// This object has the property [instanceOf=fileEntry]. - fileEntry get instance_of_tag => JS('fileEntry', '#.instance_of_tag', this._jsObject); - - void set instance_of_tag(fileEntry instance_of_tag) { - JS('void', '#.instance_of_tag = #', this._jsObject, convertArgument(instance_of_tag)); - } - -} - -/** - * Functions - */ - -class API_tags { - /* - * API connection - */ - Object _jsObject; - API_tags(this._jsObject) { - } -} diff --git a/tools/json_schema_compiler/dart_test/tags.idl b/tools/json_schema_compiler/dart_test/tags.idl deleted file mode 100644 index f4ddff4..0000000 --- a/tools/json_schema_compiler/dart_test/tags.idl +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -namespace tags { - // This dictionary has the property [inline_doc]. - [inline_doc] dictionary InlineDoc { - }; - - // This dictionary has the property [nodoc]. - [nodoc] dictionary Nodoc { - }; - - // This dictionary has the property [nocompile]. - [nocompile] dictionary Nocompile { - }; - - // This dictionary has no tags on the dictionary itself. - dictionary PlainDict { - // This int has the property [inline_doc]. - [inline_doc] int inline_doc; - - // This String has the property [nodoc]. - [nodoc] String nodoc; - - // This double has the property [nocompile]. - [nocompile] double nocompile; - - // This object has the property [instanceOf=fileEntry]. - [instanceOf=fileEntry] object instance_of_tag; - }; -}; -- cgit v1.1