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

Side by Side Diff: chrome/browser/task_manager/task_manager_unittest.cc

Issue 3801008: Expands the chrome.experimental.processes extension API. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/task_manager/task_manager.h" 5 #include "chrome/browser/task_manager/task_manager.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 17 matching lines...) Expand all
28 28
29 class TestResource : public TaskManager::Resource { 29 class TestResource : public TaskManager::Resource {
30 public: 30 public:
31 TestResource() : refresh_called_(false) {} 31 TestResource() : refresh_called_(false) {}
32 32
33 virtual std::wstring GetTitle() const { return L"test title"; } 33 virtual std::wstring GetTitle() const { return L"test title"; }
34 virtual SkBitmap GetIcon() const { return SkBitmap(); } 34 virtual SkBitmap GetIcon() const { return SkBitmap(); }
35 virtual base::ProcessHandle GetProcess() const { 35 virtual base::ProcessHandle GetProcess() const {
36 return base::GetCurrentProcessHandle(); 36 return base::GetCurrentProcessHandle();
37 } 37 }
38 virtual Type GetType() const { return RENDERER; }
38 virtual bool SupportNetworkUsage() const { return false; } 39 virtual bool SupportNetworkUsage() const { return false; }
39 virtual void SetSupportNetworkUsage() { NOTREACHED(); } 40 virtual void SetSupportNetworkUsage() { NOTREACHED(); }
40 virtual void Refresh() { refresh_called_ = true; } 41 virtual void Refresh() { refresh_called_ = true; }
41 bool refresh_called() const { return refresh_called_; } 42 bool refresh_called() const { return refresh_called_; }
42 void set_refresh_called(bool refresh_called) { 43 void set_refresh_called(bool refresh_called) {
43 refresh_called_ = refresh_called; 44 refresh_called_ = refresh_called;
44 } 45 }
45 46
46 private: 47 private:
47 bool refresh_called_; 48 bool refresh_called_;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 TaskManagerModel* model = task_manager.model_; 102 TaskManagerModel* model = task_manager.model_;
102 TestResource resource; 103 TestResource resource;
103 104
104 task_manager.AddResource(&resource); 105 task_manager.AddResource(&resource);
105 ASSERT_FALSE(resource.refresh_called()); 106 ASSERT_FALSE(resource.refresh_called());
106 model->update_state_ = TaskManagerModel::TASK_PENDING; 107 model->update_state_ = TaskManagerModel::TASK_PENDING;
107 model->Refresh(); 108 model->Refresh();
108 ASSERT_TRUE(resource.refresh_called()); 109 ASSERT_TRUE(resource.refresh_called());
109 task_manager.RemoveResource(&resource); 110 task_manager.RemoveResource(&resource);
110 } 111 }
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/task_manager_resource_providers.cc ('k') | chrome/common/extensions/api/extension_api.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698