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" |
11 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 11 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
12 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 #import "testing/gtest_mac.h" | 14 #import "testing/gtest_mac.h" |
15 #include "testing/platform_test.h" | 15 #include "testing/platform_test.h" |
16 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 class TestResource : public TaskManager::Resource { | 20 class TestResource : public TaskManager::Resource { |
21 public: | 21 public: |
22 TestResource(const string16& title, pid_t pid) : title_(title), pid_(pid) {} | 22 TestResource(const string16& title, pid_t pid) : title_(title), pid_(pid) {} |
23 virtual string16 GetTitle() const OVERRIDE { return title_; } | 23 virtual string16 GetTitle() const OVERRIDE { return title_; } |
| 24 virtual string16 GetProfileName() const OVERRIDE { return string16(); } |
24 virtual SkBitmap GetIcon() const OVERRIDE { return SkBitmap(); } | 25 virtual SkBitmap GetIcon() const OVERRIDE { return SkBitmap(); } |
25 virtual base::ProcessHandle GetProcess() const OVERRIDE { return pid_; } | 26 virtual base::ProcessHandle GetProcess() const OVERRIDE { return pid_; } |
26 virtual Type GetType() const OVERRIDE { return RENDERER; } | 27 virtual Type GetType() const OVERRIDE { return RENDERER; } |
27 virtual bool SupportNetworkUsage() const OVERRIDE { return false; } | 28 virtual bool SupportNetworkUsage() const OVERRIDE { return false; } |
28 virtual void SetSupportNetworkUsage() OVERRIDE { NOTREACHED(); } | 29 virtual void SetSupportNetworkUsage() OVERRIDE { NOTREACHED(); } |
29 virtual void Refresh() OVERRIDE {} | 30 virtual void Refresh() OVERRIDE {} |
30 string16 title_; | 31 string16 title_; |
| 32 string16 profile_name_; |
31 pid_t pid_; | 33 pid_t pid_; |
32 }; | 34 }; |
33 | 35 |
34 } // namespace | 36 } // namespace |
35 | 37 |
36 class TaskManagerWindowControllerTest : public CocoaTest { | 38 class TaskManagerWindowControllerTest : public CocoaTest { |
37 }; | 39 }; |
38 | 40 |
39 // Test creation, to ensure nothing leaks or crashes. | 41 // Test creation, to ensure nothing leaks or crashes. |
40 TEST_F(TaskManagerWindowControllerTest, Init) { | 42 TEST_F(TaskManagerWindowControllerTest, Init) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 NSIndexSet* selection = [table selectedRowIndexes]; | 109 NSIndexSet* selection = [table selectedRowIndexes]; |
108 ASSERT_EQ(1u, [selection count]); | 110 ASSERT_EQ(1u, [selection count]); |
109 EXPECT_EQ(1u, [selection firstIndex]); | 111 EXPECT_EQ(1u, [selection firstIndex]); |
110 | 112 |
111 // Releases the controller, which in turn deletes |bridge|. | 113 // Releases the controller, which in turn deletes |bridge|. |
112 [controller close]; | 114 [controller close]; |
113 | 115 |
114 task_manager.RemoveResource(&resource1); | 116 task_manager.RemoveResource(&resource1); |
115 task_manager.RemoveResource(&resource2); | 117 task_manager.RemoveResource(&resource2); |
116 } | 118 } |
OLD | NEW |