Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No unittest 0.4.1 output from DumpRenderTree #9131

Closed
DartBot opened this issue Mar 13, 2013 · 8 comments
Closed

No unittest 0.4.1 output from DumpRenderTree #9131

DartBot opened this issue Mar 13, 2013 · 8 comments

Comments

@DartBot
Copy link

@DartBot DartBot commented Mar 13, 2013

This issue was originally filed by chris...@gmail.com


What steps will reproduce the problem?

  1. DumpRenderTree test/index.html

Where index.html contains 'dart:html' based unittests.

I expect to see output that ends with unittest messages:

CONSOLE MESSAGE: PASS: unsupported remove
CONSOLE MESSAGE:
CONSOLE MESSAGE: All 1 tests passed.
CONSOLE MESSAGE: unittest-suite-success

Instead, I see no console output. If I run the same test in the browser, I see those messages.

I am running this locally under Linux Mint with:

Dart VM version: 0.4.1.0_r19425 (Mon Mar 4 22:53:32 2013)

I see the same behavior on drone.io: https://drone.io/eee-c/HipsterMVC/6

Additional info: If I downgrade from unittest 0.4.1 to 0.4.0, it works again: https://drone.io/eee-c/HipsterMVC/7

@kasperl
Copy link
Contributor

@kasperl kasperl commented Mar 18, 2013

Added Area-UnitTest, Triaged labels.

@gramster
Copy link

@gramster gramster commented May 3, 2013

I think the old version worked for you because there are some changes in the async behavior; we used to use message passing between isolates to separate the execution of test() from the execution of the tests themselves. Now we use futures.

If you want to see the output from DRT, you should add this to your HTML file, before the Dart script:

    <script type='text/javascript'>
      var testRunner = window.testRunner || window.layoutTestController;
      if (testRunner) {
        function handleMessage(m) {
          if (m.data == 'done') {
            testRunner.notifyDone();
          }
        }
        testRunner.waitUntilDone();
        window.addEventListener("message", handleMessage, false);
      }
      if (navigator.webkitStartDart) {
        navigator.webkitStartDart();
      }
    </script>

This will stop DRT from exiting until it gets a done message posted from unittest.

@gramster
Copy link

@gramster gramster commented May 3, 2013

Added NotPlanned label.

@DartBot
Copy link
Author

@DartBot DartBot commented May 15, 2013

This comment was originally written by aniquilatorbloody...@gmail.com


Hello. I'm having a similar problem. Before I could not see the tests results, but after I used your suggestion including the script in the tests html I can now see the tests, but then the process never stops.

I always get a "FAIL: Timed out waiting for notifyDone to be called".

It seems that the on done message is never sent. What am I doing wrong?

The build status can be checked here:
https://drone.io/github.com/cantidio/gorgonDart/71

Thanks in advance.

@DartBot
Copy link
Author

@DartBot DartBot commented May 18, 2013

This comment was originally written by chris.eee...@gmail.com


Is there a future in unittest that will complete when the tests are all done? I am able to get this to work, but I have to use Timer from dart:async to implement a poor-man's polling:

import 'dart:async';
main(){
  // tests here...
  pollForDone(testCases);
}
pollForDone(List tests) {
  if (tests.every((t)=> t.isComplete)) {
    window.postMessage('done', window.location.href);
    return;
  }
  var wait = new Duration(milliseconds: 100);
  new Timer(wait, ()=> pollForDone(tests));
}

It'd be cleaner to be able to just add something like the following to main():

main() {
  // tests here
  allTestsComplete.then((_)=> window.postMessage('done', window.location.href));
}

@kevmoo
Copy link
Member

@kevmoo kevmoo commented Feb 12, 2014

Added Pkg-Unittest label.

@kevmoo
Copy link
Member

@kevmoo kevmoo commented Feb 12, 2014

Removed Area-UnitTest label.
Added Area-Pkg label.

@DartBot
Copy link
Author

@DartBot DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/test#198.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.