Commit Graph

13 Commits

Author SHA1 Message Date
William Hesse 64c150ab1a Revert "Capture stack traces in asynchronous browser test failures."
This reverts commit ca987d5c01.
This commit was slowing down Safari by a significant factor, causing
timeouts.

Bug:
Change-Id: Iddb3bf4f86664fa823cae5b08f24b3e240b4c67d
Reviewed-on: https://dart-review.googlesource.com/15881
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-23 08:32:13 +00:00
Bob Nystrom 9c0a6fd27c Add rudimentary support for dartdevk to test.dart.
It's added as a new compiler, so pass "-c dartdevk" to use it.

It doesn't support any test packages yet, so tests that, say, import
package expect won't compile. I'll work on that next, but it will
require adding some stuff to the build scripts to build .dill files for
those packages.

This does get test.dart invoking the compiler, running the resulting
test, and correctly reporting the result:

- A test that doesn't throw an exception and stays within the bounds of
  what is currently implemented in dartdevk passes.

- A test that compiles correctly but fails at runtime fails with a
  RuntimeError.

- A test that contains a compile error fails with a non-zero exit code
  and is reported as a CompileTimeError.

Change-Id: Icacbf1ff54dfe7aa4d245382d3b0aeb375cf105b
Reviewed-on: https://dart-review.googlesource.com/15420
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-20 16:00:28 +00:00
Bob Nystrom ca987d5c01 Capture stack traces in asynchronous browser test failures.
This works for both dart2js and DDC.

Change-Id: Ic27a99c3691ee06259597b227239b974a60b2484
Reviewed-on: https://dart-review.googlesource.com/15320
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2017-10-19 21:10:57 +00:00
Bob Nystrom 5f8f77fd03 Capture DDC JavaScript stack traces in synchronous test failures.
This still doesn't *display* then very nicely (they are buried in the
giant blob of "events" JSON in the output), but it captures them and
plumbs them out of the browser into test.dart.

Change-Id: I54ab024ed55f18af89da7742967117f0a212673d
Reviewed-on: https://dart-review.googlesource.com/15005
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-10-19 18:32:27 +00:00
Erik Corry 2fb5d08102 Spelling a
R=ahe@google.com
BUG=

Review-Url: https://codereview.chromium.org/2841543002 .
2017-04-24 14:53:51 +02:00
whesse@google.com b21c902607 Add support in test scripts backend for simple HTML tests.
BUG=dartbug.com/20698
R=ricow@google.com

Review URL: https://codereview.chromium.org//632283002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40956 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 15:29:39 +00:00
whesse@google.com 1d73d2c30c Test scripts: Detect and report error in accessing window.parent in browser_controller.
BUG=
R=ricow@google.com

Review URL: https://codereview.chromium.org//472883002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39249 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-14 15:31:33 +00:00
sigmund@google.com fdc6d43083 Improve how we handle packages/ HTML imports. This improves resolution of URLs containing
"package/" under the web/ directory. Resolution under 'lib' is the same, but it and gives better suggestions if the path looks wrong. This summarizes what changed:

- source file: lib/b.html

  import to "packages/c/d.html" was error, now is error + suggestion
  import to "../packages/c/d.html" was error, now is error + suggestion
  import to "../../packages/c/d.html" was resolved, now is resolved too

- source file: lib/a/b.html

  import to "packages/c/d.html" was error, now is error + suggestion
  import to "../packages/c/d.html" was error, now is error + suggestion
  import to "../../packages/c/d.html" was error, now is error + suggestion
  import to "../../../packages/c/d.html" was resolved, now is resolved too

- source file: web/b.html

  import to "packages/c/d.html" was and continues to be resolved
  import to "../packages/c/d.html" was error, now is resolved

- source file: web/a/b.html

  import to "packages/c/d.html" was error, now is resolved
  import to "../packages/c/d.html" was and continues to be resolved
  import to "../../packages/c/d.html" was and continues to be resolved

Note: polymer-build and development mode are slightly different: polymer-build
detects and issues an error for bad paths inside lib/. These are not detected by
our package-resolution in loader.dart, but as long as users are not creating
symlinks by hand, Dartium should detect if the paths are wrong.

When we switch to start using pub-serve by default, we should be able to go back
to the web-ui style of using "package:" urls directly in HTML.

R=jmesserly@google.com, kustermann@google.com

Review URL: https://codereview.chromium.org//148913003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32170 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-30 20:51:28 +00:00
ricow@google.com bae4d99ce1 Add debug information to verify that we actually get the onDone event send to the driver page.
I am aware that we should not clutter up the message that we show to developers, but I think it is important to validate that we actually send the onDone message to the driver page.

We should also put in functionality for tracking network errors in the browser_controller generated js (+potentially retrying the send of the message)

R=kustermann@google.com

Review URL: https://codereview.chromium.org//96503002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30771 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-29 08:57:47 +00:00
kustermann@google.com e634fb20a4 Make status updates after 10 seconds + fix handling of status updates
R=ricow@google.com

Review URL: https://codereview.chromium.org//94213002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30748 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-28 08:50:58 +00:00
kustermann@google.com c23917be9b Print events only to the console and never to the DOM
IE9 does not have a console, so events were printed to the DOM. But since we get
all events anyway when using the browser controller, there is no need to print
it to the DOM.

R=ricow@google.com

Review URL: https://codereview.chromium.org//85853002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30630 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-25 14:35:50 +00:00
kustermann@google.com 8649be6036 Implement a periodic timer which sends the current state of a browser test back to the browser controller
R=ricow@google.com

Review URL: https://codereview.chromium.org//77763004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30468 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-20 13:32:16 +00:00
kustermann@google.com e3d8608ca2 test.py: Sending JSON between test_controller.js <-> browser_controller
Currently test.py will look for FAIL/PASS messages in the DOM to determine if a
test has failed or not. test_controller.js will add these PASS/FAIL messages to
the DOM (in addition to other messages).

This approach has several issues:
- The test itself could create nodes in the DOM containing FAIL/PASS. This means
  that the outcome of a test cannot be reliably determined.
- The test ifself can remove nodes from the DOM (e.g. setting
  document.body.innerHTML). This could result in a situation where the
  stacktraces/... test_controller.js prints to the DOM are lost.
- It is unclear which parts of the DOM we see in test failure messages
  (reported by test.py) come from the test itself and which parts come from
  test_controller.js.

This CL tries to fix this by recording all events that happend with global
variables in test_controller.js and send back a JSON string with information
about
  - debug messages
  - posted messages
  - print() calls of the test
  - DOM
  - errors (from window.onerror, script.onerror ...)

Furthermore this CL fixes unittest to report
unittest-suite-success/unittest-suite-fail instead of unittest-suite-done (which
is broken).

R=ricow@google.com

Review URL: https://codereview.chromium.org//36913002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30407 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-19 12:54:41 +00:00