Skip to content

Commit

Permalink
Merge branch 'WD_1.X_dev' of https://portal-ua.globallogic.com/git/wd
Browse files Browse the repository at this point in the history
…into WD_1.X_dev
  • Loading branch information
nataliakoval committed Jan 31, 2014
2 parents 2b3c8b7 + d5e5c96 commit 05c6b0f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/webdriver/extension_qt/qwebkit_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "frame_path.h"
#include "value_conversion_util.h"
#include "webdriver_logging.h"
#include "webdriver_server.h"
#include "webdriver_switches.h"

#include "third_party/webdriver/atoms.h"

Expand Down Expand Up @@ -511,6 +513,8 @@ Error* QWebkitProxy::SetActiveElement(const ElementId& element) {
Error* QWebkitProxy::SwitchTo() {
AddBrowserLoggerToView();

SetWebInspectorSupport(page_);

// reset frame path
session_->frame_elements_.clear();
session_->set_current_frame(FramePath());
Expand Down Expand Up @@ -1861,6 +1865,26 @@ void QWebkitProxy::AddBrowserLoggerToView() {
logHandler->loadConsoleJS(page_);
}

void QWebkitProxy::SetWebInspectorSupport(QWebPage *page)
{
page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
CommandLine cmdLine = webdriver::Server::GetInstance()->GetCommandLine();

if (cmdLine.HasSwitch(webdriver::Switches::kWIServer))
{
if (cmdLine.HasSwitch(webdriver::Switches::kWIPort))
{
std::string wiPort = cmdLine.GetSwitchValueASCII(webdriver::Switches::kWIPort);
int port = QString(wiPort.c_str()).toInt();
page->setProperty("_q_webInspectorServerPort", port);
}
else
{
page->setProperty("_q_webInspectorServerPort", 9222);
}
}
}


} // namespace webdriver

Expand Down
1 change: 1 addition & 0 deletions src/webdriver/extension_qt/qwebkit_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ class QWebkitProxy {
base::ListValue* args);

void AddBrowserLoggerToView();
void SetWebInspectorSupport(QWebPage *page);


private:
Expand Down

0 comments on commit 05c6b0f

Please sign in to comment.