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

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

Issue 10383216: Replaced EXPECT_TRUE with a LOG(WARNING) for automation commands to provide more information... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Switched to LOG(FATAL). Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 356 }
357 357
358 scoped_refptr<BrowserProxy> PyUITestBase::GetBrowserWindow(int window_index) { 358 scoped_refptr<BrowserProxy> PyUITestBase::GetBrowserWindow(int window_index) {
359 return automation()->GetBrowserWindow(window_index); 359 return automation()->GetBrowserWindow(window_index);
360 } 360 }
361 361
362 std::string PyUITestBase::_SendJSONRequest(int window_index, 362 std::string PyUITestBase::_SendJSONRequest(int window_index,
363 const std::string& request, 363 const std::string& request,
364 int timeout) { 364 int timeout) {
365 std::string response; 365 std::string response;
366 bool response_status;
366 if (window_index < 0) { // Do not need to target a browser window. 367 if (window_index < 0) { // Do not need to target a browser window.
367 EXPECT_TRUE(automation()->SendJSONRequest(request, timeout, &response)); 368 response_status = automation()->SendJSONRequest(request, timeout,
369 &response);
368 } else { 370 } else {
369 scoped_refptr<BrowserProxy> browser_proxy = 371 scoped_refptr<BrowserProxy> browser_proxy =
370 automation()->GetBrowserWindow(window_index); 372 automation()->GetBrowserWindow(window_index);
371 EXPECT_TRUE(browser_proxy.get()); 373 EXPECT_TRUE(browser_proxy.get());
372 if (browser_proxy.get()) { 374 if (browser_proxy.get()) {
373 EXPECT_TRUE(browser_proxy->SendJSONRequest(request, timeout, &response)); 375 response_status = browser_proxy->SendJSONRequest(request, timeout,
376 &response);
374 } 377 }
375 } 378 }
379 if (!response_status) {
380 LOG(FATAL) << "Automation failed: " << request;
Nirnimesh 2012/05/16 19:55:17 No, do not make it fatal. There are tests to verif
381 }
376 return response; 382 return response;
377 } 383 }
378 384
379 bool PyUITestBase::ResetToDefaultTheme() { 385 bool PyUITestBase::ResetToDefaultTheme() {
380 return automation()->ResetToDefaultTheme(); 386 return automation()->ResetToDefaultTheme();
381 } 387 }
382 388
383 bool PyUITestBase::SetCookie(const GURL& cookie_url, 389 bool PyUITestBase::SetCookie(const GURL& cookie_url,
384 const std::string& value, 390 const std::string& value,
385 int window_index, 391 int window_index,
(...skipping 18 matching lines...) Expand all
404 // TODO(phadjan.jr): figure out a way to unambiguously report error. 410 // TODO(phadjan.jr): figure out a way to unambiguously report error.
405 if (!browser_proxy.get()) 411 if (!browser_proxy.get())
406 return cookie_val; 412 return cookie_val;
407 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index); 413 scoped_refptr<TabProxy> tab_proxy = browser_proxy->GetTab(tab_index);
408 EXPECT_TRUE(tab_proxy.get()); 414 EXPECT_TRUE(tab_proxy.get());
409 if (!tab_proxy.get()) 415 if (!tab_proxy.get())
410 return cookie_val; 416 return cookie_val;
411 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val)); 417 EXPECT_TRUE(tab_proxy->GetCookies(cookie_url, &cookie_val));
412 return cookie_val; 418 return cookie_val;
413 } 419 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698