Running test pages in iFrame vs new Window

837 views
Skip to first unread message

Parashuram

unread,
Nov 7, 2013, 12:10:52 AM11/7/13
to karma...@googlegroups.com
Is there a specific reason why Karma opens the test pages in an iFrame instead of a new window. I am looking at writing an adapter and some of the data I can collect can only be done when the test page is opened in a new window.

Does an option to open the test pages in an iFrame vs a newWindow make sense ? Is there any problems if the test page is opened in a new window (if the browser-launchers) are configured to allow popups?

Vojta Jína

unread,
Nov 10, 2013, 10:40:33 AM11/10/13
to karma...@googlegroups.com
Currently, there is no option to open a new window.
Why do you need it?

Browser typically does not give your app resources (CPU) when the tab is not active. I think that might be an issue, when opening a new window, instead of an iframe.

That said, feel free to give it a try. Change the client code of Karma (https://github.com/karma-runner/karma/blob/master/client/karma.js) to open new window rather than using an iframe.

V.


On Wed, Nov 6, 2013 at 9:10 PM, Parashuram <n.para...@gmail.com> wrote:
Is there a specific reason why Karma opens the test pages in an iFrame instead of a new window. I am looking at writing an adapter and some of the data I can collect can only be done when the test page is opened in a new window.

Does an option to open the test pages in an iFrame vs a newWindow make sense ? Is there any problems if the test page is opened in a new window (if the browser-launchers) are configured to allow popups?

--
You received this message because you are subscribed to the Google Groups "karma-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to karma-users...@googlegroups.com.
To post to this group, send email to karma...@googlegroups.com.
Visit this group at http://groups.google.com/group/karma-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/karma-users/929a535a-ca10-4fa4-a13e-202afb7560be%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Parashuram

unread,
Nov 10, 2013, 9:15:51 PM11/10/13
to karma...@googlegroups.com
I am working on a performance benchmarking test suite - http://github.com/axemclion/karma-telemetry which runs the Chromium telemetry suites. Some of the performance measurements do not show up inside iFrame and only work for a new window.

For now, the adapter.js in the framework opens debug.html and communicated with context.html once the results are ready.

I was also able to get a new option "newWindow" in the configuration that opens the framework in a new window instead of an iframe. Would this be something that would benefit karma and would a pull request make sense?

Vojta Jína

unread,
Nov 12, 2013, 2:16:11 PM11/12/13
to karma...@googlegroups.com
Do you have the code somewhere so that I can try it (Karma with the new window)?
I just wanna make sure that using new window does not slow down.

Otherwise I think a PR would be awesome!


Parashuram

unread,
Nov 12, 2013, 4:06:40 PM11/12/13
to karma...@googlegroups.com
Here is the karma code that I changed. I am not yet using a config option to open iframe vs new window - my fork opens it in new window by default. If you think this looks good, I can add the code to use a config to open it in a new window

https://github.com/axemclion/karma

Note that for this to run, you may also have to add '--disable-popup-blocking' to a Chrome custom browser. For firefox, I did not see a way to add custom preferences, so I had to modify lib/index.js in karma-firefox launcher and add 'user_pref("dom.disable_open_during_load", false)\n; to the PREFS variable declared at the top.

Parashuram

unread,
Nov 18, 2013, 6:15:20 PM11/18/13
to karma...@googlegroups.com
Created a pull request with the implementation that works using new Window - https://github.com/karma-runner/karma/pull/830. Comments and feedback appreciated.

This can enable frameworks that cannot run inside an iframe.

Vojta Jína

unread,
Nov 22, 2013, 11:38:35 AM11/22/13
to karma...@googlegroups.com
Thanks Parashuram, I'm gonna look into it!


Reply all
Reply to author
Forward
0 new messages