Chromedriver and CefV8Context

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Chromedriver and CefV8Context

Postby TomDigitale » Mon Mar 02, 2015 5:30 am

Hello,

We currently use chromedriver to test our application which use multiple CefClient. We encounter a problem when trying to use contexts in order to execute javascript:
without using chromedriver, everything works fine, contexts included.
But with chromedriver, during javascript execution (CefV8Handler::Execute()) every context is null.

For example, from the wiki:
Code: Select all
bool MyV8Handler::Execute(const CefString& name,
                          CefRefPtr<CefV8Value> object,
                          const CefV8ValueList& arguments,
                          CefRefPtr<CefV8Value>& retval,
                          CefString& exception) {
  if (name == "register") {
    if (arguments.size() == 1 && arguments[0]->IsFunction()) {
      callback_func_ = arguments[0];
      callback_context_ = CefV8Context::GetCurrentContext(); // <== callback_context_ is NULL
      return true;
    }
  }
  return false;
}


We are running on Linux 64, Ubuntu 14.04 and CEF 2171

Is this a known problem or is it related only to Chromedriver ?

Thanks.
TomDigitale
Techie
 
Posts: 18
Joined: Fri Mar 14, 2014 6:00 am

Re: Chromedriver and CefV8Context

Postby magreenblatt » Mon Mar 02, 2015 11:34 am

How are you executing the JavaScript?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Chromedriver and CefV8Context

Postby TomDigitale » Tue Mar 03, 2015 4:01 am

We are executing javascript in a mere index.html file with some javascript.
The function we are calling is implemented in c++ and using a callback function in one of its parameters.
Our implementation of CefV8Handler is similar to the one from the wiki (storing callback function and current context for a later use).

Like I said, the problem only occurs when using chromedriver to automatize tests for our application:
either CefV8Context::GetCurrentContext() or CefV8Context::GetEnteredContext return null once the chromedriver is plugged.
TomDigitale
Techie
 
Posts: 18
Joined: Fri Mar 14, 2014 6:00 am

Re: Chromedriver and CefV8Context

Postby magreenblatt » Tue Mar 03, 2015 12:52 pm

TomDigitale wrote:We are executing javascript in a mere index.html file with some javascript.
The function we are calling is implemented in c++ and using a callback function in one of its parameters.
Our implementation of CefV8Handler is similar to the one from the wiki (storing callback function and current context for a later use).

Like I said, the problem only occurs when using chromedriver to automatize tests for our application:
either CefV8Context::GetCurrentContext() or CefV8Context::GetEnteredContext return null once the chromedriver is plugged.

This is the first I've heard of the problem but it sounds like a bug. Please add an issue to the CEF issue tracker.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Chromedriver and CefV8Context

Postby TomDigitale » Fri Mar 06, 2015 5:18 am

We opened an issue about this, and submitted a patch with minimal code to apply to cefsimple to highlight this issue.
We noticed that contrary to what we previously said, context is not null when executing CefV8Handler::Execute() for storing current context and callback function, but is null when using it after inter-processes communications, resulting in a crash when using Chromedriver while using callback functions.

Issue is here:
https://code.google.com/p/chromiumembed ... &start=200
TomDigitale
Techie
 
Posts: 18
Joined: Fri Mar 14, 2014 6:00 am


Return to Support Forum

Who is online

Users browsing this forum: amaitland and 95 guests