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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 #include <stddef.h> | 6 #include <stddef.h> |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/strings/pattern.h" | 9 #include "base/strings/pattern.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 void SetUpOnMainThread() override { | 43 void SetUpOnMainThread() override { |
44 ASSERT_FALSE(GetTaskManagerMac()); | 44 ASSERT_FALSE(GetTaskManagerMac()); |
45 host_resolver()->AddRule("*", "127.0.0.1"); | 45 host_resolver()->AddRule("*", "127.0.0.1"); |
46 ASSERT_TRUE(embedded_test_server()->Start()); | 46 ASSERT_TRUE(embedded_test_server()->Start()); |
47 } | 47 } |
48 | 48 |
49 void TearDownOnMainThread() override { | 49 void TearDownOnMainThread() override { |
50 // Make sure the task manager is closed (if any). | 50 // Make sure the task manager is closed (if any). |
51 chrome::HideTaskManager(); | 51 chrome::HideTaskManager(); |
52 ASSERT_FALSE(GetTaskManagerMac()); | 52 ASSERT_FALSE(GetTaskManagerMac()); |
53 | |
54 InProcessBrowserTest::TearDownOnMainThread(); | |
55 } | 53 } |
56 | 54 |
57 TaskManagerMac* GetTaskManagerMac() const { | 55 TaskManagerMac* GetTaskManagerMac() const { |
58 return TaskManagerMac::GetInstanceForTests(); | 56 return TaskManagerMac::GetInstanceForTests(); |
59 } | 57 } |
60 | 58 |
61 NSTableView* GetTable() const { | 59 NSTableView* GetTable() const { |
62 return GetTaskManagerMac() ? [GetTaskManagerMac()->CocoaControllerForTests() | 60 return GetTaskManagerMac() ? [GetTaskManagerMac()->CocoaControllerForTests() |
63 tableViewForTesting] | 61 tableViewForTesting] |
64 : nullptr; | 62 : nullptr; |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 // tabs[2] should still be selected. | 292 // tabs[2] should still be selected. |
295 EXPECT_EQ(TableFirstSelectedRow(), FindRowForTab(tabs[2])); | 293 EXPECT_EQ(TableFirstSelectedRow(), FindRowForTab(tabs[2])); |
296 | 294 |
297 // Close tabs[0]. The selection should not change. | 295 // Close tabs[0]. The selection should not change. |
298 chrome::CloseWebContents(browser(), tabs[0], false); | 296 chrome::CloseWebContents(browser(), tabs[0], false); |
299 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows((rows -= 1), pattern)); | 297 ASSERT_NO_FATAL_FAILURE(WaitForTaskManagerRows((rows -= 1), pattern)); |
300 EXPECT_EQ(TableFirstSelectedRow(), FindRowForTab(tabs[2])); | 298 EXPECT_EQ(TableFirstSelectedRow(), FindRowForTab(tabs[2])); |
301 } | 299 } |
302 | 300 |
303 } // namespace task_manager | 301 } // namespace task_manager |
OLD | NEW |