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

Unified Diff: chrome/test/pyautolib/pyautolib.cc

Issue 6410134: Use named automation interface to control primary chrome on ChromeOS (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: nit Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/pyautolib/pyautolib.h ('k') | chrome/test/pyautolib/pyautolib.i » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/pyautolib/pyautolib.cc
diff --git a/chrome/test/pyautolib/pyautolib.cc b/chrome/test/pyautolib/pyautolib.cc
index a1da13778f49572409bdca523c097a10a29c36af..12d57d7cbcad70d6bbfd2b125ef3a3c5655b6d06 100644
--- a/chrome/test/pyautolib/pyautolib.cc
+++ b/chrome/test/pyautolib/pyautolib.cc
@@ -65,6 +65,12 @@ void PyUITestBase::Initialize(const FilePath& browser_dir) {
UITestBase::SetBrowserDirectory(browser_dir);
}
+ProxyLauncher* PyUITestBase::CreateProxyLauncher() {
+ if (named_channel_id_.empty())
+ return new AnonymousProxyLauncher(false);
+ return new NamedProxyLauncher(named_channel_id_, false, false);
+}
+
void PyUITestBase::SetUp() {
UITestBase::SetUp();
}
@@ -313,13 +319,17 @@ scoped_refptr<BrowserProxy> PyUITestBase::GetBrowserWindow(int window_index) {
}
std::string PyUITestBase::_SendJSONRequest(int window_index,
- std::string& request) {
- scoped_refptr<BrowserProxy> browser_proxy =
- automation()->GetBrowserWindow(window_index);
- EXPECT_TRUE(browser_proxy.get());
+ const std::string& request) {
std::string response;
- if (browser_proxy.get()) {
- EXPECT_TRUE(browser_proxy->SendJSONRequest(request, &response));
+ if (window_index < 0) { // Do not need to target a browser window.
+ EXPECT_TRUE(automation()->SendJSONRequest(request, &response));
+ } else {
+ scoped_refptr<BrowserProxy> browser_proxy =
+ automation()->GetBrowserWindow(window_index);
+ EXPECT_TRUE(browser_proxy.get());
+ if (browser_proxy.get()) {
+ EXPECT_TRUE(browser_proxy->SendJSONRequest(request, &response));
+ }
}
return response;
}
« no previous file with comments | « chrome/test/pyautolib/pyautolib.h ('k') | chrome/test/pyautolib/pyautolib.i » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698