summaryrefslogtreecommitdiffstats
path: root/chrome/browser/task_manager_browsertest.cc
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 17:59:03 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 17:59:03 +0000
commitec9773681c979a58f966d6cb0fc8ad16746e3adf (patch)
tree2cbc893a1d4eb757b5bc9691351419d2eeceb007 /chrome/browser/task_manager_browsertest.cc
parent1224e328aa1210ed5c194a5626479ac15519f3af (diff)
downloadchromium_src-ec9773681c979a58f966d6cb0fc8ad16746e3adf.zip
chromium_src-ec9773681c979a58f966d6cb0fc8ad16746e3adf.tar.gz
chromium_src-ec9773681c979a58f966d6cb0fc8ad16746e3adf.tar.bz2
Adds three new off-by-default columns to the task manager to track WebCore caches
These values are currently exposed via about:histograms/WebCoreCache. This change allows for users to monitor the cache sizes in real-time broken out by renderer. TEST=Open task manager, right click on chrome, select columns, observe that they update along with browsing. BUG=16221 Review URL: http://codereview.chromium.org/217010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27216 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager_browsertest.cc')
-rw-r--r--chrome/browser/task_manager_browsertest.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/chrome/browser/task_manager_browsertest.cc b/chrome/browser/task_manager_browsertest.cc
index 5439043..77a79e7 100644
--- a/chrome/browser/task_manager_browsertest.cc
+++ b/chrome/browser/task_manager_browsertest.cc
@@ -4,12 +4,14 @@
#include "chrome/browser/task_manager.h"
+#include "app/l10n_util.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/common/page_transition_types.h"
#include "chrome/test/in_process_browser_test.h"
#include "chrome/test/ui_test_utils.h"
+#include "grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -115,3 +117,28 @@ IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NoticeExtensionChanges) {
test_data_dir_.AppendASCII("common").AppendASCII("background_page")));
WaitForResourceChange(4);
}
+
+IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, PopulateWebCacheFields) {
+ EXPECT_EQ(0, model()->ResourceCount());
+
+ // Show the task manager. This populates the model, and helps with debugging
+ // (you see the task manager).
+ browser()->window()->ShowTaskManager();
+
+ // Browser and the New Tab Page.
+ EXPECT_EQ(2, model()->ResourceCount());
+
+ // Open a new tab and make sure we notice that.
+ GURL url(ui_test_utils::GetTestUrl(L".", L"title1.html"));
+ browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED,
+ true, 0, false, NULL);
+ WaitForResourceChange(3);
+
+ // Check that we get some value for the cache columns.
+ DCHECK_NE(model()->GetResourceWebCoreImageCacheSize(2),
+ l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT));
+ DCHECK_NE(model()->GetResourceWebCoreScriptsCacheSize(2),
+ l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT));
+ DCHECK_NE(model()->GetResourceWebCoreCSSCacheSize(2),
+ l10n_util::GetString(IDS_TASK_MANAGER_NA_CELL_TEXT));
+}