Commit a8dc59ee authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate MessageLoop::current() to MessageLoopCurrent in...

Migrate MessageLoop::current() to MessageLoopCurrent in /chrome/browser/ui/webui/sync_internals_ui_unittest.cc

These changes were scripted as part of the effort to restrict exposure of the
raw MessageLoop*.

Note that many static methods exposed on MessageLoopCurrent are also deprecated
so it is very well possible that this is migrating to an already deprecated
method.

The goal of this pass is to reduce usage of MessageLoop::current() (and
ultimately make it impossible to obtain the MessageLoop* statically).

As such I will not edit this CL unless the script did something logically wrong.
I defer to owners to fix highlighted usage of already deprecated APIs.

Possible script screw ups / things to look out for in this review:
 - Storing MessageLoopCurrent in a MessageLoop* variable or comparing it against
   one (I will go over that in a separate pass).

Includes should have been stripped if that was the last usage of message_loop.h
in that file.

Please CQ if LGTY

This CL was uploaded by git cl split.

R=pavely@chromium.org

Bug: 825327
Change-Id: Ic0b91000c8cd7fb5a08d97cf374d2fec8453038e
Reviewed-on: https://chromium-review.googlesource.com/1024396Reviewed-by: default avatarPavel Yatsuk <pavely@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553272}
parent a02a568d
......@@ -7,7 +7,7 @@
#include <cstddef>
#include <string>
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_current.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
......@@ -75,17 +75,11 @@ class SyncInternalsUITestWithService : public ChromeRenderViewHostTestHarness {
EXPECT_CALL(mock_js_controller_, AddJsEventHandler(_));
{
// Needed by |sync_internals_ui_|'s constructor. The
// message loop is provided by ChromeRenderViewHostTestHarness.
content::TestBrowserThread ui_thread_(BrowserThread::UI,
base::MessageLoopForUI::current());
// |sync_internals_ui_|'s constructor triggers all the
// expectations above.
web_ui_.reset(new TestSyncWebUI(web_contents()));
sync_internals_ui_ = new SyncInternalsUI(web_ui_.get());
web_ui_->SetController(sync_internals_ui_);
}
// |sync_internals_ui_|'s constructor triggers all the
// expectations above.
web_ui_.reset(new TestSyncWebUI(web_contents()));
sync_internals_ui_ = new SyncInternalsUI(web_ui_.get());
web_ui_->SetController(sync_internals_ui_);
Mock::VerifyAndClearExpectations(profile_mock);
Mock::VerifyAndClearExpectations(&mock_js_controller_);
......@@ -155,17 +149,11 @@ class SyncInternalsUITestWithoutService
ChromeRenderViewHostTestHarness::SetUp();
{
// Needed by |sync_internals_ui_|'s constructor. The
// message loop is provided by ChromeRenderViewHostTestHarness.
content::TestBrowserThread ui_thread_(BrowserThread::UI,
base::MessageLoopForUI::current());
// |sync_internals_ui_|'s constructor triggers all the
// expectations above.
web_ui_.reset(new TestSyncWebUI(web_contents()));
sync_internals_ui_ = new SyncInternalsUI(web_ui_.get());
web_ui_->SetController(sync_internals_ui_);
}
// |sync_internals_ui_|'s constructor triggers all the
// expectations above.
web_ui_.reset(new TestSyncWebUI(web_contents()));
sync_internals_ui_ = new SyncInternalsUI(web_ui_.get());
web_ui_->SetController(sync_internals_ui_);
Mock::VerifyAndClearExpectations(profile_mock);
}
......
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