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

Unified Diff: ios/chrome/app/application_delegate/memory_warning_helper_unittest.mm

Issue 2357913003: Remove calls to MessageLoop::Run/RunUntilIdle from ios/. (Closed)
Patch Set: add missing include Created 4 years, 3 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 | « no previous file | ios/chrome/browser/web_resource/web_resource_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/app/application_delegate/memory_warning_helper_unittest.mm
diff --git a/ios/chrome/app/application_delegate/memory_warning_helper_unittest.mm b/ios/chrome/app/application_delegate/memory_warning_helper_unittest.mm
index 97d76c24c8bf8eb13038a2e512e99c10135d8f6c..8052c0138de9ffc4d485b9e7cb66e02b98bbd055 100644
--- a/ios/chrome/app/application_delegate/memory_warning_helper_unittest.mm
+++ b/ios/chrome/app/application_delegate/memory_warning_helper_unittest.mm
@@ -7,6 +7,8 @@
#include "base/mac/bind_objc_block.h"
#import "base/mac/scoped_nsobject.h"
#include "base/memory/memory_pressure_listener.h"
+#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "base/threading/thread.h"
#import "ios/chrome/browser/metrics/previous_session_info.h"
#include "testing/platform_test.h"
@@ -41,13 +43,14 @@ class MemoryWarningHelperTest : public PlatformTest {
void OnMemoryPressure(
base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) {
memory_pressure_level_ = memory_pressure_level;
- message_loop_.QuitWhenIdle();
+ run_loop_.QuitWhenIdle();
}
- base::MessageLoop& message_loop() { return message_loop_; }
+ void RunMessageLoop() { run_loop_.Run(); }
private:
base::MessageLoop message_loop_;
+ base::RunLoop run_loop_;
base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level_;
std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
base::scoped_nsobject<MemoryWarningHelper> memory_helper_;
@@ -73,7 +76,7 @@ TEST_F(MemoryWarningHelperTest, VerifyForegroundMemoryWarningCountReset) {
// callback (i.e. MainControllerTest::OnMemoryPressure) is invoked.
TEST_F(MemoryWarningHelperTest, VerifyApplicationDidReceiveMemoryWarning) {
[GetMemoryHelper() handleMemoryPressure];
- message_loop().Run();
+ RunMessageLoop();
EXPECT_EQ(base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
GetMemoryPressureLevel());
}
« no previous file with comments | « no previous file | ios/chrome/browser/web_resource/web_resource_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698