Commit fbf6c023 authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Use ScopedTaskEnvironment instead of MessageLoopForUI in /ios/chrome

MessageLoopForUI will go away, eventually.

ScopedTaskEnvironment will per default start a ThreadPool, which should
be fine in most of the cases. If you believe your test needs to make sure
that no ThreadPool runs let me know and I will update the patch.

BUG=891670
This CL was uploaded by git cl split.

R=droger@chromium.org

Change-Id: Ieb7595218c6176d258dfbd7d83272a4b9d3704e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1717291
Auto-Submit: Carlos Caballero <carlscab@google.com>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#683110}
parent 1409db99
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
// found in the LICENSE file. // found in the LICENSE file.
#import "ios/chrome/browser/installation_notifier.h" #import "ios/chrome/browser/installation_notifier.h"
#include "base/message_loop/message_loop_current.h"
#include <stdint.h> #include <stdint.h>
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#include "base/ios/block_types.h" #include "base/ios/block_types.h"
#include "base/message_loop/message_loop.h" #include "ios/web/public/test/test_web_thread_bundle.h"
#include "ios/web/public/test/test_web_thread.h"
#include "net/base/backoff_entry.h" #include "net/base/backoff_entry.h"
#include "testing/platform_test.h" #include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h" #import "third_party/ocmock/OCMock/OCMock.h"
...@@ -92,9 +92,6 @@ ...@@ -92,9 +92,6 @@
namespace { namespace {
class InstallationNotifierTest : public PlatformTest { class InstallationNotifierTest : public PlatformTest {
public:
InstallationNotifierTest() : ui_thread_(web::WebThread::UI, &message_loop_) {}
protected: protected:
void SetUp() override { void SetUp() override {
installationNotifier_ = [InstallationNotifier sharedInstance]; installationNotifier_ = [InstallationNotifier sharedInstance];
...@@ -125,8 +122,7 @@ class InstallationNotifierTest : public PlatformTest { ...@@ -125,8 +122,7 @@ class InstallationNotifierTest : public PlatformTest {
50 + jitter * expectedDelayInMSec); 50 + jitter * expectedDelayInMSec);
} }
base::MessageLoopForUI message_loop_; web::TestWebThreadBundle thread_bundle_;
web::TestWebThread ui_thread_;
__weak InstallationNotifier* installationNotifier_; __weak InstallationNotifier* installationNotifier_;
__weak FakeDispatcher* dispatcher_; __weak FakeDispatcher* dispatcher_;
MockNotificationReceiver* notificationReceiver1_; MockNotificationReceiver* notificationReceiver1_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment