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

Side by Side Diff: chrome/test/pyautolib/pyautolib.cc

Issue 5255005: Add pyauto tests for the New Tab page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/pyautolib/pyautolib.h ('k') | chrome/test/pyautolib/pyautolib.i » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/scoped_ptr.h" 5 #include "base/scoped_ptr.h"
6 #include "base/string_number_conversions.h" 6 #include "base/string_number_conversions.h"
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/test/automation/extension_proxy.h" 9 #include "chrome/test/automation/extension_proxy.h"
10 #include "chrome/test/automation/tab_proxy.h" 10 #include "chrome/test/automation/tab_proxy.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 if (!tab_proxy.get()) 164 if (!tab_proxy.get())
165 return download_dir; 165 return download_dir;
166 EXPECT_TRUE(tab_proxy->GetDownloadDirectory(&download_dir)); 166 EXPECT_TRUE(tab_proxy->GetDownloadDirectory(&download_dir));
167 return download_dir; 167 return download_dir;
168 } 168 }
169 169
170 bool PyUITestBase::OpenNewBrowserWindow(bool show) { 170 bool PyUITestBase::OpenNewBrowserWindow(bool show) {
171 return automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, show); 171 return automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, show);
172 } 172 }
173 173
174 bool PyUITestBase::CloseBrowserWindow(int window_index) {
175 scoped_refptr<BrowserProxy> browser_proxy =
176 automation()->GetBrowserWindow(window_index);
177 if (!browser_proxy.get())
178 return false;
179 bool app_closed;
180 return CloseBrowser(browser_proxy.get(), &app_closed);
181 }
182
174 int PyUITestBase::GetBrowserWindowCount() { 183 int PyUITestBase::GetBrowserWindowCount() {
175 int num_windows = 0; 184 int num_windows = 0;
176 EXPECT_TRUE(automation()->GetBrowserWindowCount(&num_windows)); 185 EXPECT_TRUE(automation()->GetBrowserWindowCount(&num_windows));
177 return num_windows; 186 return num_windows;
178 } 187 }
179 188
180 bool PyUITestBase::InstallExtension(const FilePath& crx_file, bool with_ui) { 189 bool PyUITestBase::InstallExtension(const FilePath& crx_file, bool with_ui) {
181 scoped_refptr<ExtensionProxy> proxy = 190 scoped_refptr<ExtensionProxy> proxy =
182 automation()->InstallExtension(crx_file, with_ui); 191 automation()->InstallExtension(crx_file, with_ui);
183 return proxy.get() != NULL; 192 return proxy.get() != NULL;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 // TODO(phadjan.jr): figure out a way to unambiguously report error. 373 // TODO(phadjan.jr): figure out a way to unambiguously report error.
365 if (!browser_proxy.get()) 374 if (!browser_proxy.get())
366 return cookie_val; 375 return cookie_val;
367 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index); 376 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index);
368 EXPECT_TRUE(tab_proxy.get()); 377 EXPECT_TRUE(tab_proxy.get());
369 if (!tab_proxy.get()) 378 if (!tab_proxy.get())
370 return cookie_val; 379 return cookie_val;
371 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val)); 380 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val));
372 return cookie_val; 381 return cookie_val;
373 } 382 }
OLDNEW
« 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