Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(766)

Issue 3012039: Add ExecuteJavascript() method to PyUITestBase (Closed)

Created:
10 years, 4 months ago by Dirk Pranke
Modified:
9 years, 7 months ago
CC:
chromium-reviews, Paweł Hajdan Jr.
Visibility:
Public.

Description

Add ExecuteJavascript() method to PyUITestBase This allows us to evaluate JavaScript expressions in the renderer and read values out of the DOM of the page, which is useful for testing things like the PasswordManager. R=nirimesh@chromium.org, jrg@chromium.org, alyssad@chromium.org TEST=chrome/test/functional/test_execute_javascript.py BUG=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=55013

Patch Set 1 #

Total comments: 18

Patch Set 2 : update w/ changes from review, add native GetDOMValue() method #

Total comments: 1

Patch Set 3 : merge to head #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -0 lines) Patch
A chrome/test/functional/execute_javascript.py View 1 chunk +39 lines, -0 lines 0 comments Download
M chrome/test/pyautolib/pyauto.py View 2 1 chunk +1 line, -0 lines 2 comments Download
M chrome/test/pyautolib/pyautolib.h View 1 2 1 chunk +16 lines, -0 lines 2 comments Download
M chrome/test/pyautolib/pyautolib.cc View 1 2 1 chunk +30 lines, -0 lines 0 comments Download
M chrome/test/pyautolib/pyautolib.i View 1 2 chunks +17 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
Dirk Pranke
10 years, 4 months ago (2010-07-31 01:35:43 UTC) #1
Dirk Pranke
This is a proof of concept. Let me know if you want me to rename ...
10 years, 4 months ago (2010-07-31 01:38:42 UTC) #2
Nirnimesh
I'm fine with the function name. Thanks for looking into this and putting it together. ...
10 years, 4 months ago (2010-07-31 05:28:34 UTC) #3
Alyssa
Thanks for doing this! Just a couple of minor comments from me. http://codereview.chromium.org/3012039/diff/1/2 File chrome/test/functional/test_execute_javascript.py ...
10 years, 4 months ago (2010-08-02 16:28:35 UTC) #4
John Grabowski
http://codereview.chromium.org/3012039/diff/1/2 File chrome/test/functional/test_execute_javascript.py (right): http://codereview.chromium.org/3012039/diff/1/2#newcode18 chrome/test/functional/test_execute_javascript.py:18: "window.domAutomationController.send(" + The window.domAutomationController.send seems like it would be ...
10 years, 4 months ago (2010-08-02 17:27:22 UTC) #5
Paweł Hajdan Jr.
Drive-by with automation comment. http://codereview.chromium.org/3012039/diff/1/3 File chrome/test/pyautolib/pyautolib.cc (right): http://codereview.chromium.org/3012039/diff/1/3#newcode304 chrome/test/pyautolib/pyautolib.cc:304: EXPECT_TRUE(browser_proxy.get()); Oh, then you need ...
10 years, 4 months ago (2010-08-02 17:52:01 UTC) #6
Dirk Pranke
revised patch to follow shortly ... http://codereview.chromium.org/3012039/diff/1/2 File chrome/test/functional/test_execute_javascript.py (right): http://codereview.chromium.org/3012039/diff/1/2#newcode1 chrome/test/functional/test_execute_javascript.py:1: #!/usr/bin/python On 2010/07/31 ...
10 years, 4 months ago (2010-08-02 22:26:11 UTC) #7
John Grabowski
need a 2nd 'gcl upload' plz On Mon, Aug 2, 2010 at 3:26 PM, <dpranke@chromium.org> ...
10 years, 4 months ago (2010-08-02 22:40:52 UTC) #8
Dirk Pranke
Once I've written it ... ;) On Mon, Aug 2, 2010 at 3:40 PM, John ...
10 years, 4 months ago (2010-08-02 22:47:49 UTC) #9
Dirk Pranke
revised patch uploaded. please take a look :)
10 years, 4 months ago (2010-08-03 00:13:25 UTC) #10
Nirnimesh
LGTM http://codereview.chromium.org/3012039/diff/13001/14001 File chrome/test/functional/execute_javascript.py (right): http://codereview.chromium.org/3012039/diff/13001/14001#newcode21 chrome/test/functional/execute_javascript.py:21: self.NavigateToURL("file://%s" % path) You could use self.GetFileURLForPath(path) -- ...
10 years, 4 months ago (2010-08-03 06:38:47 UTC) #11
John Grabowski
LGTM http://codereview.chromium.org/3012039/diff/15004/16002 File chrome/test/pyautolib/pyauto.py (right): http://codereview.chromium.org/3012039/diff/15004/16002#newcode1381 chrome/test/pyautolib/pyauto.py:1381: chrome_flags += ' --dom-automation' add comment explaining what ...
10 years, 4 months ago (2010-08-03 06:42:44 UTC) #12
Alyssa
LGTM
10 years, 4 months ago (2010-08-03 15:45:43 UTC) #13
Paweł Hajdan Jr.
LGTM
10 years, 4 months ago (2010-08-03 20:44:54 UTC) #14
Dirk Pranke
10 years, 4 months ago (2010-08-04 21:44:12 UTC) #15
http://codereview.chromium.org/3012039/diff/15004/16002
File chrome/test/pyautolib/pyauto.py (right):

http://codereview.chromium.org/3012039/diff/15004/16002#newcode1381
chrome/test/pyautolib/pyauto.py:1381: chrome_flags += ' --dom-automation'
On 2010/08/03 06:42:45, John Grabowski wrote:
> add comment explaining what this does; unlike --enable-crash-reporter, the
> benefit isn't so obvious.

Done.

http://codereview.chromium.org/3012039/diff/15004/16004
File chrome/test/pyautolib/pyautolib.h (right):

http://codereview.chromium.org/3012039/diff/15004/16004#newcode154
chrome/test/pyautolib/pyautolib.h:154: // like WebDriver, not PyAuto.
On 2010/08/03 06:42:45, John Grabowski wrote:
> Clarify that the only return value is something set by
> window.domAutomationController.send().
> 

Done.

Powered by Google App Engine
This is Rietveld 408576698