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

Unified Diff: chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc

Issue 2247433002: TabManager: Set OOM scores via a new debugd interface on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unittest Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/memory/tab_manager_delegate_chromeos.cc ('k') | chromeos/dbus/debug_daemon_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc
diff --git a/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc b/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc
index e064d196e4982eccbe0f2e273adb17f95152b2ea..036c16001078f1bc972c73acff869faaa390c0c5 100644
--- a/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc
+++ b/chrome/browser/memory/tab_manager_delegate_chromeos_unittest.cc
@@ -13,11 +13,13 @@
#include "ash/test/ash_test_base.h"
#include "base/logging.h"
#include "base/memory/weak_ptr.h"
+#include "base/message_loop/message_loop.h"
#include "base/process/process_handle.h"
#include "chrome/browser/chromeos/arc/arc_process.h"
#include "chrome/browser/memory/tab_manager.h"
#include "chrome/browser/memory/tab_stats.h"
#include "chrome/common/url_constants.h"
+#include "chromeos/dbus/fake_debug_daemon_client.h"
#include "components/arc/common/process.mojom.h"
#include "components/arc/test/fake_arc_bridge_service.h"
#include "components/exo/shell_surface.h"
@@ -118,11 +120,6 @@ class MockTabManagerDelegate : public TabManagerDelegate {
}
protected:
- // Nullify the operation for unit test.
- void SetOomScoreAdjForTabs(
- const std::vector<std::pair<base::ProcessHandle, int>>& entries)
- override {}
-
bool KillArcProcess(const int nspid) override {
killed_arc_processes_.push_back(nspid);
return true;
@@ -133,7 +130,12 @@ class MockTabManagerDelegate : public TabManagerDelegate {
return true;
}
+ chromeos::DebugDaemonClient* GetDebugDaemonClient() override {
+ return &debugd_client_;
+ }
+
private:
+ chromeos::FakeDebugDaemonClient debugd_client_;
std::vector<int> killed_arc_processes_;
std::vector<int64_t> killed_tabs_;
};
@@ -167,6 +169,7 @@ class MockMemoryStat : public TabManagerDelegate::MemoryStat {
};
TEST_F(TabManagerDelegateTest, SetOomScoreAdj) {
+ base::MessageLoop message_loop;
arc::FakeArcBridgeService fake_arc_bridge_service;
MockTabManagerDelegate tab_manager_delegate;
« no previous file with comments | « chrome/browser/memory/tab_manager_delegate_chromeos.cc ('k') | chromeos/dbus/debug_daemon_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698