diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-20 06:40:15 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-20 06:40:15 +0000 |
commit | e172584ff551a313430fda5439f3cf7f87cbdec6 (patch) | |
tree | 9c86221f0789b9964b4632a5eb84bb7e5fa49903 /chrome/browser/task_manager_browsertest.cc | |
parent | 3553c6cc33291037232c0b9b70f744ac5d2dc03c (diff) | |
download | chromium_src-e172584ff551a313430fda5439f3cf7f87cbdec6.zip chromium_src-e172584ff551a313430fda5439f3cf7f87cbdec6.tar.gz chromium_src-e172584ff551a313430fda5439f3cf7f87cbdec6.tar.bz2 |
Correctly handle extension reloading in the task manager.
BUG=18693
TEST=Added new tests to browser_tests.
Review URL: http://codereview.chromium.org/300005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29498 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager_browsertest.cc')
-rw-r--r-- | chrome/browser/task_manager_browsertest.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/chrome/browser/task_manager_browsertest.cc b/chrome/browser/task_manager_browsertest.cc index 77a79e7..cedcc84 100644 --- a/chrome/browser/task_manager_browsertest.cc +++ b/chrome/browser/task_manager_browsertest.cc @@ -118,6 +118,39 @@ IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, NoticeExtensionChanges) { WaitForResourceChange(4); } +// Regression test for http://crbug.com/18693. +IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, ReloadExtension) { + // Show the task manager. This populates the model, and helps with debugging + // (you see the task manager). + browser()->window()->ShowTaskManager(); + + ASSERT_TRUE(LoadExtension( + test_data_dir_.AppendASCII("common").AppendASCII("background_page"))); + + // Wait until we see the loaded extension in the task manager (the three + // resources are: the browser process, New Tab Page, and the extension). + WaitForResourceChange(3); + + EXPECT_TRUE(model()->GetResourceExtension(0) == NULL); + EXPECT_TRUE(model()->GetResourceExtension(1) == NULL); + ASSERT_TRUE(model()->GetResourceExtension(2) != NULL); + + const Extension* extension = model()->GetResourceExtension(2); + + // Reload the extension a few times and make sure our resource count + // doesn't increase. + ReloadExtension(extension->id()); + EXPECT_EQ(3, model()->ResourceCount()); + extension = model()->GetResourceExtension(2); + + ReloadExtension(extension->id()); + EXPECT_EQ(3, model()->ResourceCount()); + extension = model()->GetResourceExtension(2); + + ReloadExtension(extension->id()); + EXPECT_EQ(3, model()->ResourceCount()); +} + IN_PROC_BROWSER_TEST_F(TaskManagerBrowserTest, PopulateWebCacheFields) { EXPECT_EQ(0, model()->ResourceCount()); |