| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/pattern.h" | 8 #include "base/strings/pattern.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 void SetUpOnMainThread() override { | 45 void SetUpOnMainThread() override { |
| 46 host_resolver()->AddRule("*", "127.0.0.1"); | 46 host_resolver()->AddRule("*", "127.0.0.1"); |
| 47 ASSERT_TRUE(embedded_test_server()->Start()); | 47 ASSERT_TRUE(embedded_test_server()->Start()); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void TearDownOnMainThread() override { | 50 void TearDownOnMainThread() override { |
| 51 // Make sure the task manager is closed (if any). | 51 // Make sure the task manager is closed (if any). |
| 52 chrome::HideTaskManager(); | 52 chrome::HideTaskManager(); |
| 53 content::RunAllPendingInMessageLoop(); | 53 content::RunAllPendingInMessageLoop(); |
| 54 ASSERT_FALSE(GetView()); | 54 ASSERT_FALSE(GetView()); |
| 55 | |
| 56 InProcessBrowserTest::TearDownOnMainThread(); | |
| 57 } | 55 } |
| 58 | 56 |
| 59 TaskManagerView* GetView() const { | 57 TaskManagerView* GetView() const { |
| 60 return TaskManagerView::GetInstanceForTests(); | 58 return TaskManagerView::GetInstanceForTests(); |
| 61 } | 59 } |
| 62 | 60 |
| 63 views::TableView* GetTable() const { | 61 views::TableView* GetTable() const { |
| 64 return GetView() ? GetView()->tab_table_ : nullptr; | 62 return GetView() ? GetView()->tab_table_ : nullptr; |
| 65 } | 63 } |
| 66 | 64 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 // tabs[2] should still be selected. | 317 // tabs[2] should still be selected. |
| 320 EXPECT_EQ(GetTable()->FirstSelectedRow(), FindRowForTab(tabs[2])); | 318 EXPECT_EQ(GetTable()->FirstSelectedRow(), FindRowForTab(tabs[2])); |
| 321 | 319 |
| 322 // Close tabs[0]. The selection should not change. | 320 // Close tabs[0]. The selection should not change. |
| 323 chrome::CloseWebContents(browser(), tabs[0], false); | 321 chrome::CloseWebContents(browser(), tabs[0], false); |
| 324 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows((rows -= 1), pattern)); | 322 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows((rows -= 1), pattern)); |
| 325 EXPECT_EQ(GetTable()->FirstSelectedRow(), FindRowForTab(tabs[2])); | 323 EXPECT_EQ(GetTable()->FirstSelectedRow(), FindRowForTab(tabs[2])); |
| 326 } | 324 } |
| 327 | 325 |
| 328 } // namespace task_manager | 326 } // namespace task_manager |
| OLD | NEW |