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

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

Issue 4223001: Add pyauto tests and helper files for system-level testing of Web SQL Databases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/functional
Patch Set: ... Created 10 years, 1 month 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 GURL url(url_string); 73 GURL url(url_string);
74 UITestBase::NavigateToURL(url); 74 UITestBase::NavigateToURL(url);
75 } 75 }
76 76
77 void PyUITestBase::NavigateToURL( 77 void PyUITestBase::NavigateToURL(
78 const char* url_string, int window_index, int tab_index) { 78 const char* url_string, int window_index, int tab_index) {
79 GURL url(url_string); 79 GURL url(url_string);
80 UITestBase::NavigateToURL(url, window_index, tab_index); 80 UITestBase::NavigateToURL(url, window_index, tab_index);
81 } 81 }
82 82
83 void PyUITestBase::ReloadActiveTab(int window_index) {
84 scoped_refptr<TabProxy> tab_proxy(GetActiveTab());
85 ASSERT_TRUE(tab_proxy.get());
86 ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, tab_proxy->Reload());
87 }
88
83 bool PyUITestBase::AppendTab(const GURL& tab_url, int window_index) { 89 bool PyUITestBase::AppendTab(const GURL& tab_url, int window_index) {
84 scoped_refptr<BrowserProxy> browser_proxy = 90 scoped_refptr<BrowserProxy> browser_proxy =
85 automation()->GetBrowserWindow(window_index); 91 automation()->GetBrowserWindow(window_index);
86 return browser_proxy->AppendTab(tab_url); 92 return browser_proxy->AppendTab(tab_url);
87 } 93 }
88 94
89 bool PyUITestBase::ApplyAccelerator(int id, int window_index) { 95 bool PyUITestBase::ApplyAccelerator(int id, int window_index) {
90 scoped_refptr<BrowserProxy> browser_proxy = 96 scoped_refptr<BrowserProxy> browser_proxy =
91 automation()->GetBrowserWindow(window_index); 97 automation()->GetBrowserWindow(window_index);
92 return browser_proxy->ApplyAccelerator(id); 98 return browser_proxy->ApplyAccelerator(id);
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 // TODO(phadjan.jr): figure out a way to unambiguously report error. 364 // TODO(phadjan.jr): figure out a way to unambiguously report error.
359 if (!browser_proxy.get()) 365 if (!browser_proxy.get())
360 return cookie_val; 366 return cookie_val;
361 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index); 367 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index);
362 EXPECT_TRUE(tab_proxy.get()); 368 EXPECT_TRUE(tab_proxy.get());
363 if (!tab_proxy.get()) 369 if (!tab_proxy.get())
364 return cookie_val; 370 return cookie_val;
365 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val)); 371 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val));
366 return cookie_val; 372 return cookie_val;
367 } 373 }
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