| 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;
|
| }
|
|
|