From 5d71030fd14f4481f1e574d28042c9f86731c933 Mon Sep 17 00:00:00 2001 From: "sgk@google.com" Date: Wed, 18 Nov 2009 17:13:05 +0000 Subject: 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 --- chrome/test/page_cycler/page_cycler_test.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'chrome') 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 */); -- cgit v1.1