Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7046)

Unified Diff: chrome/browser/task_manager_browsertest.cc

Issue 300005: Correctly handle extension reloading in the task manager.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/task_manager.cc ('k') | chrome/browser/task_manager_resource_providers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/task_manager_browsertest.cc
===================================================================
--- chrome/browser/task_manager_browsertest.cc (revision 29395)
+++ chrome/browser/task_manager_browsertest.cc (working copy)
@@ -118,6 +118,39 @@
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());
« no previous file with comments | « chrome/browser/task_manager.cc ('k') | chrome/browser/task_manager_resource_providers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698