diff options
-rw-r--r-- | chrome/browser/task_manager.h | 4 | ||||
-rw-r--r-- | chrome/browser/task_manager_unittest.cc | 6 | ||||
-rw-r--r-- | chrome/browser/task_manager_win.cc | 12 |
3 files changed, 10 insertions, 12 deletions
diff --git a/chrome/browser/task_manager.h b/chrome/browser/task_manager.h index 1d2c311..c0eaa8b 100644 --- a/chrome/browser/task_manager.h +++ b/chrome/browser/task_manager.h @@ -121,8 +121,8 @@ class TaskManager { void OnWindowClosed(); private: - FRIEND_TEST(TaskManagerTest, DISABLED_Basic); - FRIEND_TEST(TaskManagerTest, DISABLED_Resources); + FRIEND_TEST(TaskManagerTest, Basic); + FRIEND_TEST(TaskManagerTest, Resources); // Obtain an instance via GetInstance(). TaskManager(); diff --git a/chrome/browser/task_manager_unittest.cc b/chrome/browser/task_manager_unittest.cc index 1e79534..70bb710 100644 --- a/chrome/browser/task_manager_unittest.cc +++ b/chrome/browser/task_manager_unittest.cc @@ -30,16 +30,14 @@ class TestResource : public TaskManager::Resource { class TaskManagerTest : public testing::Test { }; -TEST_F(TaskManagerTest, DISABLED_Basic) { +TEST_F(TaskManagerTest, Basic) { TaskManager task_manager; TaskManagerModel* model = task_manager.model_; - TaskManager::Open(); EXPECT_FALSE(task_manager.BrowserProcessIsSelected()); EXPECT_EQ(0, model->ResourceCount()); - TaskManager::Close(); } -TEST_F(TaskManagerTest, DISABLED_Resources) { +TEST_F(TaskManagerTest, Resources) { TaskManager task_manager; TaskManagerModel* model = task_manager.model_; diff --git a/chrome/browser/task_manager_win.cc b/chrome/browser/task_manager_win.cc index e88024d..166169d 100644 --- a/chrome/browser/task_manager_win.cc +++ b/chrome/browser/task_manager_win.cc @@ -235,7 +235,7 @@ class TaskManagerViewImpl : public TaskManagerView, scoped_ptr<views::NativeButton> kill_button_; scoped_ptr<views::Link> about_memory_link_; - views::GroupTableView* tab_table_; + scoped_ptr<views::GroupTableView> tab_table_; TaskManager* task_manager_; @@ -293,9 +293,10 @@ void TaskManagerViewImpl::Init() { views::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - tab_table_ = new views::GroupTableView(table_model_.get(), columns_, - views::ICON_AND_TEXT, false, true, - true); + tab_table_.reset(new views::GroupTableView(table_model_.get(), columns_, + views::ICON_AND_TEXT, false, true, + true)); + tab_table_->SetParentOwned(false); // Hide some columns by default tab_table_->SetColumnVisibility(IDS_TASK_MANAGER_PROCESS_ID_COLUMN, false); @@ -357,8 +358,7 @@ void TaskManagerViewImpl::ViewHierarchyChanged(bool is_add, if (is_add) { parent->AddChildView(kill_button_.get()); parent->AddChildView(about_memory_link_.get()); - if (tab_table_->GetParent() != this) - AddChildView(tab_table_); + AddChildView(tab_table_.get()); } else { parent->RemoveChildView(kill_button_.get()); parent->RemoveChildView(about_memory_link_.get()); |