summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 17:13:05 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 17:13:05 +0000
commit5d71030fd14f4481f1e574d28042c9f86731c933 (patch)
tree68858c8f8a98ac414a8efd11f15f1e670b9b9703 /chrome
parent3a48e0549d3f58a56dd519d4af5c0e9ee5ece974 (diff)
downloadchromium_src-5d71030fd14f4481f1e574d28042c9f86731c933.zip
chromium_src-5d71030fd14f4481f1e574d28042c9f86731c933.tar.gz
chromium_src-5d71030fd14f4481f1e574d28042c9f86731c933.tar.bz2
Add memory commit charge reporting to the page_cycler tests.
BUG=none TEST=none Review URL: http://codereview.chromium.org/401015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32332 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/test/page_cycler/page_cycler_test.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/test/page_cycler/page_cycler_test.cc b/chrome/test/page_cycler/page_cycler_test.cc
index ca804de..942003d 100644
--- a/chrome/test/page_cycler/page_cycler_test.cc
+++ b/chrome/test/page_cycler/page_cycler_test.cc
@@ -378,6 +378,12 @@ class PageCyclerTest : public UITest {
#endif // !defined(OS_MACOSX)
}
+ void PrintSystemCommitCharge(const char* test_name, size_t charge) {
+ std::string trace_name(test_name);
+ PrintResult("commit_charge", "", "cc" + trace_name, charge, "kb",
+ true /* important */);
+ }
+
// When use_http is true, the test name passed here will be used directly in
// the path to the test data, so it must be safe for use in a URL without
// escaping. (No pound (#), question mark (?), semicolon (;), non-ASCII, or
@@ -385,12 +391,16 @@ class PageCyclerTest : public UITest {
void RunTestWithSuffix(const char* name, bool use_http, const char* suffix) {
std::wstring pages;
std::string timings;
+ size_t start_size = base::GetSystemCommitCharge();
RunPageCycler(name, &pages, &timings, use_http);
if (timings.empty())
return;
+ size_t stop_size = base::GetSystemCommitCharge();
PrintMemoryUsageInfo(suffix);
PrintIOPerfInfo(suffix);
+ PrintSystemCommitCharge(suffix, stop_size - start_size);
+
std::string trace_name = "t" + std::string(suffix);
wprintf(L"\nPages: [%ls]\n", pages.c_str());
PrintResultList("times", "", trace_name, timings, "ms",
@@ -428,12 +438,15 @@ class PageCyclerReferenceTest : public PageCyclerTest {
void RunTest(const char* name, bool use_http) {
std::wstring pages;
std::string timings;
+ size_t start_size = base::GetSystemCommitCharge();
RunPageCycler(name, &pages, &timings, use_http);
if (timings.empty())
return;
+ size_t stop_size = base::GetSystemCommitCharge();
PrintMemoryUsageInfo("_ref");
PrintIOPerfInfo("_ref");
+ PrintSystemCommitCharge("_ref", stop_size - start_size);
PrintResultList("times", "", "t_ref", timings, "ms",
true /* important */);