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

Unified Diff: content/browser/memory/memory_coordinator.h

Issue 2552603002: Add tests for MemoryCoordinator::Can{Throttle,Suspend}Renderer() (Closed)
Patch Set: Fix unittests Created 4 years 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 | « no previous file | content/browser/memory/memory_coordinator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/memory/memory_coordinator.h
diff --git a/content/browser/memory/memory_coordinator.h b/content/browser/memory/memory_coordinator.h
index 8ed1951b1ef30a9f663cf27580c1380ef6c07b7d..2f169ee02a9c6cbf3ac7338f078ae13384e2ea81 100644
--- a/content/browser/memory/memory_coordinator.h
+++ b/content/browser/memory/memory_coordinator.h
@@ -38,9 +38,6 @@ class CONTENT_EXPORT MemoryCoordinator {
void CreateHandle(int render_process_id,
mojom::MemoryCoordinatorHandleRequest request);
- // Returns number of children. Only used for testing.
- size_t NumChildrenForTesting();
-
// Dispatches a memory state change to the provided process. Returns true if
// the process is tracked by this coordinator and successfully dispatches,
// returns false otherwise.
@@ -106,6 +103,17 @@ class CONTENT_EXPORT MemoryCoordinator {
ChildInfoMap& children() { return children_; }
private:
+#if !defined(OS_MACOSX)
+ FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorTest, HandleAdded);
+ FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorTest, CanSuspendRenderer);
+ FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorTest, CanThrottleRenderer);
+#endif
+ FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorTest,
+ ChildRemovedOnConnectionError);
+
+ void SetDelegateForTesting(
+ std::unique_ptr<MemoryCoordinatorDelegate> delegate);
+
// Helper function of CreateHandle and AddChildForTesting.
void CreateChildInfoMapEntry(
int render_process_id,
« no previous file with comments | « no previous file | content/browser/memory/memory_coordinator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698