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

Side by Side Diff: chrome/browser/cocoa/task_manager_mac_unittest.mm

Issue 3095004: [Mac] Use the new {EXPECT,ASSERT}_NS{EQ,NE} macros where possible. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Fix compile Created 10 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/scoped_nsobject.h" 7 #include "base/scoped_nsobject.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #import "chrome/browser/cocoa/task_manager_mac.h" 9 #import "chrome/browser/cocoa/task_manager_mac.h"
10 #import "chrome/browser/cocoa/cocoa_test_helper.h" 10 #import "chrome/browser/cocoa/cocoa_test_helper.h"
11 #include "grit/generated_resources.h" 11 #include "grit/generated_resources.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #import "testing/gtest_mac.h"
13 #include "testing/platform_test.h" 14 #include "testing/platform_test.h"
14 15
15 namespace { 16 namespace {
16 17
17 class TestResource : public TaskManager::Resource { 18 class TestResource : public TaskManager::Resource {
18 public: 19 public:
19 TestResource(const string16& title, pid_t pid) : title_(title), pid_(pid) {} 20 TestResource(const string16& title, pid_t pid) : title_(title), pid_(pid) {}
20 virtual std::wstring GetTitle() const { return UTF16ToWide(title_); } 21 virtual std::wstring GetTitle() const { return UTF16ToWide(title_); }
21 virtual SkBitmap GetIcon() const { return SkBitmap(); } 22 virtual SkBitmap GetIcon() const { return SkBitmap(); }
22 virtual base::ProcessHandle GetProcess() const { return pid_; } 23 virtual base::ProcessHandle GetProcess() const { return pid_; }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 TaskManagerMac* bridge(new TaskManagerMac(&task_manager)); 57 TaskManagerMac* bridge(new TaskManagerMac(&task_manager));
57 TaskManagerWindowController* controller = bridge->cocoa_controller(); 58 TaskManagerWindowController* controller = bridge->cocoa_controller();
58 NSTableView* table = [controller tableView]; 59 NSTableView* table = [controller tableView];
59 ASSERT_EQ(3, [controller numberOfRowsInTableView:table]); 60 ASSERT_EQ(3, [controller numberOfRowsInTableView:table]);
60 61
61 // Test that table is sorted on title. 62 // Test that table is sorted on title.
62 NSTableColumn* title_column = [table tableColumnWithIdentifier: 63 NSTableColumn* title_column = [table tableColumnWithIdentifier:
63 [NSNumber numberWithInt:IDS_TASK_MANAGER_PAGE_COLUMN]]; 64 [NSNumber numberWithInt:IDS_TASK_MANAGER_PAGE_COLUMN]];
64 NSCell* cell; 65 NSCell* cell;
65 cell = [controller tableView:table dataCellForTableColumn:title_column row:0]; 66 cell = [controller tableView:table dataCellForTableColumn:title_column row:0];
66 EXPECT_TRUE([@"zzb" isEqualToString:[cell title]]); 67 EXPECT_NSEQ(@"zzb", [cell title]);
67 cell = [controller tableView:table dataCellForTableColumn:title_column row:1]; 68 cell = [controller tableView:table dataCellForTableColumn:title_column row:1];
68 EXPECT_TRUE([@"zza" isEqualToString:[cell title]]); 69 EXPECT_NSEQ(@"zza", [cell title]);
69 cell = [controller tableView:table dataCellForTableColumn:title_column row:2]; 70 cell = [controller tableView:table dataCellForTableColumn:title_column row:2];
70 EXPECT_TRUE([@"zzz" isEqualToString:[cell title]]); 71 EXPECT_NSEQ(@"zzz", [cell title]);
71 72
72 // Releases the controller, which in turn deletes |bridge|. 73 // Releases the controller, which in turn deletes |bridge|.
73 [controller close]; 74 [controller close];
74 75
75 task_manager.RemoveResource(&resource1); 76 task_manager.RemoveResource(&resource1);
76 task_manager.RemoveResource(&resource2); 77 task_manager.RemoveResource(&resource2);
77 task_manager.RemoveResource(&resource3); 78 task_manager.RemoveResource(&resource3);
78 } 79 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698