Migrate cros browser.Create to use Telemetry's new APIs |
|||||||
Issue descriptionIn the following files: - src/components/proximity_auth/e2e_test/cros.py - autotest/files/client/common_lib/cros/chrome.py Instead of - possible_browser.Create(finder_options) The new API to create & use browser is: - possible_browser.SetUpEnvironment(browser_options) - possible_browser.Create() # No longer receives any options - possible_browser.CleanUpEnvironment() Or: with possible_browser.BrowserSession(browser_options) as browser: # Do something with the browser. (see detail in issue 801578 ) +achuith could you please help me with these?
,
Jan 22 2018
Juan, I'm having quite a bit of trouble using the new API. The previous flow in chrome.py was this: 1. finder_options = browser_options.BrowserFinderOptions() 2. set finder_options and browser_options related to command line flags. 3. finder_options.CreateParser() 4. browser_options = finder_options.browser_options 5. set browser_options 6. browser_to_create = browser_finder.FindBrowser(finder_options) 7. browser = browser_to_create.Create(finder_options) Replacing browser_to_create.Create(finder_options) with browser_to_create.BrowserSession(browser_options) doesn't work. I've tried a few other permutations that didn't work either, but honestly I just don't understand enough about what's happening here to fix this. On your VM, the file chrome.py is at: /usr/local/autotest/common_lib/cros/chrome.py You can log in to the VM, modify this file, and run /usr/local/autotest/bin/vm_sanity.py, and if the test passes, your changes are probably good. If you get stuck for any reason, I can dig deeper into this but it'll probably take me some time to get up to speed on your changes.
,
Jan 23 2018
Yes, BrowserSession must be called in a with-statement otherwise it won't work. For your case, since you open/close the browser from different methods, you need to explicitly SetUpEnvironment before calling Create, and then CleanUpEnvironment after Close. Attaching a patch I tested on the VM as you suggested.
,
Jan 23 2018
Actually, it might be a good idea to take out the "SetUpEnvironment" out of the retry-loop, similar to what I've done here: https://chromium-review.googlesource.com/c/chromium/src/+/881142
,
Jan 23 2018
Thanks for the diff! Let me know if this looks ok to you. I verified it locally and it's currently running on trybots: https://chromium-review.googlesource.com/881308
,
Jan 25 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/5a12e4d3bfb30a47009afc7fdcf6d3c6fcd698c2 commit 5a12e4d3bfb30a47009afc7fdcf6d3c6fcd698c2 Author: Achuith Bhandarkar <achuith@chromium.org> Date: Thu Jan 25 04:30:39 2018 [chrome]: Migrate browser.Create to new api BUG= chromium:804292 TEST=vm_sanity.py, bots Change-Id: If34a42ec90d469d07bcd34e015abf8699c8f8c7d Reviewed-on: https://chromium-review.googlesource.com/881308 Commit-Ready: Achuith Bhandarkar <achuith@chromium.org> Tested-by: Achuith Bhandarkar <achuith@chromium.org> Reviewed-by: Achuith Bhandarkar <achuith@chromium.org> Reviewed-by: Juan Antonio Navarro Pérez <perezju@chromium.org> [modify] https://crrev.com/5a12e4d3bfb30a47009afc7fdcf6d3c6fcd698c2/client/common_lib/cros/chrome.py
,
Jan 25 2018
Should be fixed
,
Jan 25 2018
We're still missing: - src/components/proximity_auth/e2e_test/cros.py To be migrated here: https://chromium-review.googlesource.com/c/chromium/src/+/881142
,
Jan 29 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5983e37f9c214ac0c248738ffc0c5cd2b82a3490 commit 5983e37f9c214ac0c248738ffc0c5cd2b82a3490 Author: Juan Antonio Navarro Perez <perezju@google.com> Date: Mon Jan 29 09:37:57 2018 [Telemetry refactor] Migrate proximity_auth client to new browser API - Add explicit calls to SetUp-/CleanUpEnvironment. TBR=tengs@chromium.org Bug: 804292 , 801578 Change-Id: I54d0925b308867020ed69b4330abd529beb61d77 Reviewed-on: https://chromium-review.googlesource.com/881142 Reviewed-by: Juan Antonio Navarro Pérez <perezju@chromium.org> Commit-Queue: Juan Antonio Navarro Pérez <perezju@chromium.org> Cr-Commit-Position: refs/heads/master@{#532372} [modify] https://crrev.com/5983e37f9c214ac0c248738ffc0c5cd2b82a3490/components/proximity_auth/e2e_test/cros.py
,
Jan 29 2018
Finished now.
,
Feb 6 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/autotest/+/a134cca3ce3a859dd63281250bb0915adfc0690a commit a134cca3ce3a859dd63281250bb0915adfc0690a Author: Achuith Bhandarkar <achuith@chromium.org> Date: Tue Feb 06 18:13:17 2018 [chrome]: Migrate browser.Create to new api BUG= chromium:804292 TEST=vm_sanity.py, bots Change-Id: If34a42ec90d469d07bcd34e015abf8699c8f8c7d Reviewed-on: https://chromium-review.googlesource.com/881308 Commit-Ready: Achuith Bhandarkar <achuith@chromium.org> Tested-by: Achuith Bhandarkar <achuith@chromium.org> Reviewed-by: Achuith Bhandarkar <achuith@chromium.org> Reviewed-by: Juan Antonio Navarro Pérez <perezju@chromium.org> (cherry picked from commit 5a12e4d3bfb30a47009afc7fdcf6d3c6fcd698c2) Reviewed-on: https://chromium-review.googlesource.com/904944 Reviewed-by: Bernie Thompson <bhthompson@chromium.org> Commit-Queue: Bernie Thompson <bhthompson@chromium.org> Tested-by: Bernie Thompson <bhthompson@chromium.org> [modify] https://crrev.com/a134cca3ce3a859dd63281250bb0915adfc0690a/client/common_lib/cros/chrome.py |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by perezju@chromium.org
, Jan 22 2018