| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/memory/scoped_nsobject.h" | 8 #include "base/memory/scoped_nsobject.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #import "chrome/browser/ui/cocoa/task_manager_mac.h" | 10 #import "chrome/browser/ui/cocoa/task_manager_mac.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 task_manager.AddResource(&resource2); | 59 task_manager.AddResource(&resource2); |
| 60 task_manager.AddResource(&resource3); // Will be in the same group as 2. | 60 task_manager.AddResource(&resource3); // Will be in the same group as 2. |
| 61 | 61 |
| 62 TaskManagerMac* bridge(new TaskManagerMac(&task_manager, false)); | 62 TaskManagerMac* bridge(new TaskManagerMac(&task_manager, false)); |
| 63 TaskManagerWindowController* controller = bridge->cocoa_controller(); | 63 TaskManagerWindowController* controller = bridge->cocoa_controller(); |
| 64 NSTableView* table = [controller tableView]; | 64 NSTableView* table = [controller tableView]; |
| 65 ASSERT_EQ(3, [controller numberOfRowsInTableView:table]); | 65 ASSERT_EQ(3, [controller numberOfRowsInTableView:table]); |
| 66 | 66 |
| 67 // Test that table is sorted on title. | 67 // Test that table is sorted on title. |
| 68 NSTableColumn* title_column = [table tableColumnWithIdentifier: | 68 NSTableColumn* title_column = [table tableColumnWithIdentifier: |
| 69 [NSNumber numberWithInt:IDS_TASK_MANAGER_PAGE_COLUMN]]; | 69 [NSNumber numberWithInt:IDS_TASK_MANAGER_TASK_COLUMN]]; |
| 70 NSCell* cell; | 70 NSCell* cell; |
| 71 cell = [controller tableView:table dataCellForTableColumn:title_column row:0]; | 71 cell = [controller tableView:table dataCellForTableColumn:title_column row:0]; |
| 72 EXPECT_NSEQ(@"zzb", [cell title]); | 72 EXPECT_NSEQ(@"zzb", [cell title]); |
| 73 cell = [controller tableView:table dataCellForTableColumn:title_column row:1]; | 73 cell = [controller tableView:table dataCellForTableColumn:title_column row:1]; |
| 74 EXPECT_NSEQ(@"zza", [cell title]); | 74 EXPECT_NSEQ(@"zza", [cell title]); |
| 75 cell = [controller tableView:table dataCellForTableColumn:title_column row:2]; | 75 cell = [controller tableView:table dataCellForTableColumn:title_column row:2]; |
| 76 EXPECT_NSEQ(@"zzz", [cell title]); | 76 EXPECT_NSEQ(@"zzz", [cell title]); |
| 77 | 77 |
| 78 // Releases the controller, which in turn deletes |bridge|. | 78 // Releases the controller, which in turn deletes |bridge|. |
| 79 [controller close]; | 79 [controller close]; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 109 NSIndexSet* selection = [table selectedRowIndexes]; | 109 NSIndexSet* selection = [table selectedRowIndexes]; |
| 110 ASSERT_EQ(1u, [selection count]); | 110 ASSERT_EQ(1u, [selection count]); |
| 111 EXPECT_EQ(1u, [selection firstIndex]); | 111 EXPECT_EQ(1u, [selection firstIndex]); |
| 112 | 112 |
| 113 // Releases the controller, which in turn deletes |bridge|. | 113 // Releases the controller, which in turn deletes |bridge|. |
| 114 [controller close]; | 114 [controller close]; |
| 115 | 115 |
| 116 task_manager.RemoveResource(&resource1); | 116 task_manager.RemoveResource(&resource1); |
| 117 task_manager.RemoveResource(&resource2); | 117 task_manager.RemoveResource(&resource2); |
| 118 } | 118 } |
| OLD | NEW |