Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Issue 6306013: Dispatch all WebDriverCommands on the session thread. (Closed)

Created:
9 years, 11 months ago by kkania
Modified:
9 years, 7 months ago
Reviewers:
Joe, jleyba
CC:
chromium-reviews, Paweł Hajdan Jr.
Visibility:
Public.

Description

Break Session off into a separate Automation class, which is just focused on controlling Chrome. Have Session create its own thread which automation messages are executed on. BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=73670

Patch Set 1 : '' #

Total comments: 4

Patch Set 2 : move thread out of session #

Total comments: 12

Patch Set 3 : small fixes #

Total comments: 1

Patch Set 4 : breakoff automation from session #

Total comments: 5

Patch Set 5 : fix 80 line #

Unified diffs Side-by-side diffs Delta from patch set Stats (+499 lines, -401 lines) Patch
M chrome/chrome_tests.gypi View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
A chrome/test/webdriver/automation.h View 1 2 3 1 chunk +61 lines, -0 lines 0 comments Download
A chrome/test/webdriver/automation.cc View 1 2 3 4 1 chunk +95 lines, -0 lines 0 comments Download
M chrome/test/webdriver/chromedriver_launcher.py View 1 2 3 5 chunks +34 lines, -74 lines 0 comments Download
M chrome/test/webdriver/commands/create_session.cc View 1 2 3 1 chunk +15 lines, -4 lines 0 comments Download
M chrome/test/webdriver/commands/navigate_commands.cc View 1 2 3 4 chunks +3 lines, -4 lines 0 comments Download
M chrome/test/webdriver/commands/response.h View 1 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/webdriver/commands/source_command.cc View 1 2 3 2 chunks +4 lines, -7 lines 0 comments Download
M chrome/test/webdriver/commands/title_command.cc View 1 2 3 1 chunk +3 lines, -5 lines 0 comments Download
M chrome/test/webdriver/commands/url_command.cc View 1 2 3 3 chunks +4 lines, -7 lines 0 comments Download
M chrome/test/webdriver/commands/webdriver_command.h View 1 2 3 2 chunks +0 lines, -11 lines 0 comments Download
M chrome/test/webdriver/commands/webdriver_command.cc View 1 2 3 1 chunk +0 lines, -11 lines 0 comments Download
M chrome/test/webdriver/dispatch.h View 1 2 3 3 chunks +31 lines, -40 lines 0 comments Download
M chrome/test/webdriver/dispatch.cc View 1 2 3 3 chunks +87 lines, -27 lines 0 comments Download
M chrome/test/webdriver/server.cc View 1 2 3 4 chunks +3 lines, -2 lines 0 comments Download
M chrome/test/webdriver/session.h View 1 2 3 6 chunks +20 lines, -31 lines 0 comments Download
M chrome/test/webdriver/session.cc View 1 2 3 3 chunks +104 lines, -144 lines 0 comments Download
M chrome/test/webdriver/session_manager.h View 1 2 3 4 chunks +3 lines, -3 lines 0 comments Download
M chrome/test/webdriver/session_manager.cc View 1 2 3 2 chunks +27 lines, -31 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
kkania
9 years, 11 months ago (2011-01-26 02:34:31 UTC) #1
jleyba
http://codereview.chromium.org/6306013/diff/40001/chrome/test/webdriver/dispatch.cc File chrome/test/webdriver/dispatch.cc (right): http://codereview.chromium.org/6306013/diff/40001/chrome/test/webdriver/dispatch.cc#newcode256 chrome/test/webdriver/dispatch.cc:256: response->set_status(kInternalServerError); Use the SET_WEBDRIVER_ERROR from commands/response.h. This will include ...
9 years, 10 months ago (2011-01-28 00:22:04 UTC) #2
kkania
http://codereview.chromium.org/6306013/diff/40001/chrome/test/webdriver/dispatch.cc File chrome/test/webdriver/dispatch.cc (right): http://codereview.chromium.org/6306013/diff/40001/chrome/test/webdriver/dispatch.cc#newcode256 chrome/test/webdriver/dispatch.cc:256: response->set_status(kInternalServerError); On 2011/01/28 00:22:04, jleyba wrote: > Use the ...
9 years, 10 months ago (2011-01-28 22:34:57 UTC) #3
jleyba
Just two last comments, then LGTM http://codereview.chromium.org/6306013/diff/63001/chrome/test/webdriver/commands/command.h File chrome/test/webdriver/commands/command.h (right): http://codereview.chromium.org/6306013/diff/63001/chrome/test/webdriver/commands/command.h#newcode22 chrome/test/webdriver/commands/command.h:22: enum DispatchThreadType { ...
9 years, 10 months ago (2011-01-31 17:54:48 UTC) #4
Joe
http://codereview.chromium.org/6306013/diff/63001/chrome/test/webdriver/commands/create_session.cc File chrome/test/webdriver/commands/create_session.cc (right): http://codereview.chromium.org/6306013/diff/63001/chrome/test/webdriver/commands/create_session.cc#newcode33 chrome/test/webdriver/commands/create_session.cc:33: thread->message_loop_proxy()->PostTask(FROM_HERE, NewRunnableMethod( Are you always guaranteed a valid message_loop_proxy ...
9 years, 10 months ago (2011-01-31 23:40:51 UTC) #5
kkania
http://codereview.chromium.org/6306013/diff/63001/chrome/test/webdriver/commands/command.h File chrome/test/webdriver/commands/command.h (right): http://codereview.chromium.org/6306013/diff/63001/chrome/test/webdriver/commands/command.h#newcode22 chrome/test/webdriver/commands/command.h:22: enum DispatchThreadType { On 2011/01/31 17:54:48, jleyba wrote: > ...
9 years, 10 months ago (2011-02-01 01:54:47 UTC) #6
Joe
LGTM, I am also fine with the session manager handling the threads On 2011/02/01 01:54:47, ...
9 years, 10 months ago (2011-02-01 01:58:40 UTC) #7
jleyba
http://codereview.chromium.org/6306013/diff/5003/chrome/test/webdriver/dispatch.cc File chrome/test/webdriver/dispatch.cc (right): http://codereview.chromium.org/6306013/diff/5003/chrome/test/webdriver/dispatch.cc#newcode271 chrome/test/webdriver/dispatch.cc:271: thread->message_loop_proxy()->PostTask( Suppose the server receives two requests: DELETE /session/foo ...
9 years, 10 months ago (2011-02-01 17:49:36 UTC) #8
kkania
sorry this has grown so big. I decided I didn't like the idea of dispatching ...
9 years, 10 months ago (2011-02-03 01:22:47 UTC) #9
kkania
Remove the cleanup and test stuff from this CL.
9 years, 10 months ago (2011-02-03 03:53:18 UTC) #10
jleyba
LGTM, just a few remaining comments. http://codereview.chromium.org/6306013/diff/66022/chrome/test/webdriver/automation.cc File chrome/test/webdriver/automation.cc (right): http://codereview.chromium.org/6306013/diff/66022/chrome/test/webdriver/automation.cc#newcode56 chrome/test/webdriver/automation.cc:56: *success = tab_->ExecuteAndExtractString(wide_xpath, ...
9 years, 10 months ago (2011-02-03 19:01:22 UTC) #11
kkania
http://codereview.chromium.org/6306013/diff/66022/chrome/test/webdriver/automation.cc File chrome/test/webdriver/automation.cc (right): http://codereview.chromium.org/6306013/diff/66022/chrome/test/webdriver/automation.cc#newcode56 chrome/test/webdriver/automation.cc:56: *success = tab_->ExecuteAndExtractString(wide_xpath, wide_script, &wide_result); On 2011/02/03 19:01:22, jleyba ...
9 years, 10 months ago (2011-02-03 19:07:01 UTC) #12
jleyba
9 years, 10 months ago (2011-02-03 19:07:45 UTC) #13
http://codereview.chromium.org/6306013/diff/66022/chrome/test/webdriver/autom...
File chrome/test/webdriver/automation.cc (right):

http://codereview.chromium.org/6306013/diff/66022/chrome/test/webdriver/autom...
chrome/test/webdriver/automation.cc:83: *url = gurl.possibly_invalid_spec();
On 2011/02/03 19:07:01, kkania wrote:
> On 2011/02/03 19:01:22, jleyba wrote:
> > If we get a URL from the tab, shouldn't it always be a valid URL spec?
> 
> probably, but I'm not sure. Some special pages may give us problems (like
> about:blank)?  Instead of investigating if its ok, I thought to save time to
> just return whatever it has and be safe.

SGTM

Powered by Google App Engine
This is Rietveld 408576698