summaryrefslogtreecommitdiffstats
path: root/chrome/test/reliability
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 01:12:18 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-14 01:12:18 +0000
commited3ce0d59e2f52f805a8a76b112bfd48156416d0 (patch)
tree4438ca308863f6dde9d8fb4642c2c872fc30fb11 /chrome/test/reliability
parentb410bc3a7509a653af93fdc1d4466bfc1b3f9cfd (diff)
downloadchromium_src-ed3ce0d59e2f52f805a8a76b112bfd48156416d0.zip
chromium_src-ed3ce0d59e2f52f805a8a76b112bfd48156416d0.tar.gz
chromium_src-ed3ce0d59e2f52f805a8a76b112bfd48156416d0.tar.bz2
coverity: Don't leak the FileVersionInfo.
CID=5739 BUG=none TEST=none Review URL: http://codereview.chromium.org/164533 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23405 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/reliability')
-rw-r--r--chrome/test/reliability/page_load_test.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc
index d64ef21..371d102 100644
--- a/chrome/test/reliability/page_load_test.cc
+++ b/chrome/test/reliability/page_load_test.cc
@@ -161,8 +161,8 @@ class PageLoadTest : public UITest {
// TODO(estade): port.
#if defined(OS_WIN)
// Check file version info for chrome dll.
- FileVersionInfo* file_info;
- file_info = FileVersionInfo::CreateFileVersionInfo(kChromeDll);
+ scoped_ptr<FileVersionInfo> file_info;
+ file_info.reset(FileVersionInfo::CreateFileVersionInfo(kChromeDll));
std::wstring last_change = file_info->last_change();
test_log << "Last Change: ";
test_log << last_change << std::endl;
@@ -199,7 +199,8 @@ class PageLoadTest : public UITest {
if (!is_timeout && result == AUTOMATION_MSG_NAVIGATION_SUCCESS) {
if (page_down) {
// Page down twice.
- scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
+ scoped_refptr<BrowserProxy> browser(
+ automation()->GetBrowserWindow(0));
if (browser.get()) {
scoped_refptr<WindowProxy> window(browser->GetWindow());
if (window.get()) {
@@ -685,14 +686,14 @@ void SetPageRange(const CommandLine& parsed_command_line) {
ASSERT_TRUE(
StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue(
kStartIndexSwitch)), &start_index));
- ASSERT_TRUE(start_index > 0);
+ ASSERT_GT(start_index, 0);
}
if (parsed_command_line.HasSwitch(kEndIndexSwitch)) {
ASSERT_TRUE(
StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue(
kEndIndexSwitch)), &end_index));
- ASSERT_TRUE(end_index > 0);
+ ASSERT_GT(end_index, 0);
}
ASSERT_TRUE(end_index >= start_index);
@@ -706,7 +707,7 @@ void SetPageRange(const CommandLine& parsed_command_line) {
ASSERT_TRUE(
StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue(
kIterationSwitch)), &iterations));
- ASSERT_TRUE(iterations > 0);
+ ASSERT_GT(iterations, 0);
}
if (parsed_command_line.HasSwitch(kMemoryUsageSwitch))
@@ -722,14 +723,15 @@ void SetPageRange(const CommandLine& parsed_command_line) {
if (parsed_command_line.HasSwitch(kLogFileSwitch)) {
log_file_path =
- FilePath::FromWStringHack(parsed_command_line.GetSwitchValue(kLogFileSwitch));
+ FilePath::FromWStringHack(
+ parsed_command_line.GetSwitchValue(kLogFileSwitch));
}
if (parsed_command_line.HasSwitch(kTimeoutSwitch)) {
ASSERT_TRUE(
StringToInt(WideToUTF16(parsed_command_line.GetSwitchValue(
kTimeoutSwitch)), &timeout_ms));
- ASSERT_TRUE(timeout_ms > 0);
+ ASSERT_GT(timeout_ms, 0);
}
if (parsed_command_line.HasSwitch(kNoPageDownSwitch))