summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsgk@chromium.org <sgk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 22:46:30 +0000
committersgk@chromium.org <sgk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 22:46:30 +0000
commita39d1d15e39b8dbbf15115507f70e5fbbd01d847 (patch)
tree4699e9325f8cbb7789f17003e4c62680653bf251
parent9aff1a6f03eae501be2b8d992ebdccd25937dc49 (diff)
downloadchromium_src-a39d1d15e39b8dbbf15115507f70e5fbbd01d847.zip
chromium_src-a39d1d15e39b8dbbf15115507f70e5fbbd01d847.tar.gz
chromium_src-a39d1d15e39b8dbbf15115507f70e5fbbd01d847.tar.bz2
Fix memory_test to use the correct temporary user_data_dir_, so it
reports valid memory stats for browser and {ws,vm}_final_{browser,total}. Add a sanitary assert for returned browser process id so the test will actually fail if it breaks again. BUG=none TEST=none Review URL: http://codereview.chromium.org/245030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27428 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/test/memory_test/memory_test.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/chrome/test/memory_test/memory_test.cc b/chrome/test/memory_test/memory_test.cc
index 63367d3..f15c76f 100644
--- a/chrome/test/memory_test/memory_test.cc
+++ b/chrome/test/memory_test/memory_test.cc
@@ -21,6 +21,7 @@
#include "chrome/test/perf/mem_usage.h"
#include "googleurl/src/gurl.h"
#include "net/base/net_util.h"
+#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -270,9 +271,11 @@ class MemoryTest : public UITest {
void PrintIOPerfInfo(const char* test_name) {
printf("\n");
- FilePath data_dir(user_data_dir());
- int browser_process_pid = ChromeBrowserProcessId(data_dir);
- ChromeProcessList chrome_processes(GetRunningChromeProcesses(data_dir));
+ int browser_process_pid = ChromeBrowserProcessId(user_data_dir_);
+ ASSERT_NE(browser_process_pid, -1);
+
+ ChromeProcessList chrome_processes(
+ GetRunningChromeProcesses(user_data_dir_));
ChromeProcessList::const_iterator it;
for (it = chrome_processes.begin(); it != chrome_processes.end(); ++it) {
@@ -318,9 +321,11 @@ class MemoryTest : public UITest {
void PrintMemoryUsageInfo(const char* test_name) {
printf("\n");
- FilePath data_dir(user_data_dir());
- int browser_process_pid = ChromeBrowserProcessId(data_dir);
- ChromeProcessList chrome_processes(GetRunningChromeProcesses(data_dir));
+ int browser_process_pid = ChromeBrowserProcessId(user_data_dir_);
+ ASSERT_NE(browser_process_pid, -1);
+
+ ChromeProcessList chrome_processes(
+ GetRunningChromeProcesses(user_data_dir_));
size_t browser_virtual_size = 0;
size_t browser_working_set_size = 0;