Commit d672606e authored by fdoray's avatar fdoray Committed by Commit bot

Switch from TestBrowserThread to TestBrowserThreadBundle in components.

TestBrowserThread is deprecated. TestBrowserThreadBundle provides all
browser threads, a blocking pool and a TaskScheduler.

This CL was generated using the script posted on the bug +
git cl format +
tools/sort-headers.py +
some manual adjustments.

BUG=272091
R=gab@chromium.org
TBR=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2799253002
Cr-Commit-Position: refs/heads/master@{#462839}
parent 8ff07186
......@@ -9,7 +9,6 @@
#include <utility>
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "components/feedback/feedback_uploader.h"
#include "components/feedback/feedback_uploader_factory.h"
......@@ -18,6 +17,7 @@
#include "components/user_prefs/user_prefs.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -58,8 +58,7 @@ class FeedbackDataTest : public testing::Test {
FeedbackDataTest()
: context_(new content::TestBrowserContext()),
prefs_(new TestingPrefServiceSimple()),
data_(new FeedbackData()),
ui_thread_(content::BrowserThread::UI, &message_loop_) {
data_(new FeedbackData()) {
user_prefs::UserPrefs::Set(context_.get(), prefs_.get());
data_->set_context(context_.get());
data_->set_send_report_callback(base::Bind(
......@@ -95,8 +94,7 @@ class FeedbackDataTest : public testing::Test {
std::unique_ptr<content::TestBrowserContext> context_;
std::unique_ptr<PrefService> prefs_;
scoped_refptr<FeedbackData> data_;
base::MessageLoop message_loop_;
content::TestBrowserThread ui_thread_;
content::TestBrowserThreadBundle test_browser_thread_bundle_;
};
TEST_F(FeedbackDataTest, ReportSending) {
......
......@@ -11,7 +11,6 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
#include "build/build_config.h"
......@@ -20,7 +19,7 @@
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "components/user_prefs/user_prefs.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -47,8 +46,7 @@ namespace feedback {
class FeedbackUploaderTest : public testing::Test {
protected:
FeedbackUploaderTest()
: ui_thread_(content::BrowserThread::UI, &message_loop_),
context_(new content::TestBrowserContext()),
: context_(new content::TestBrowserContext()),
prefs_(new sync_preferences::TestingPrefServiceSyncable()),
dispatched_reports_count_(0),
expected_reports_(0) {
......@@ -105,9 +103,8 @@ class FeedbackUploaderTest : public testing::Test {
run_loop_->Run();
}
base::MessageLoop message_loop_;
content::TestBrowserThreadBundle test_browser_thread_bundle_;
std::unique_ptr<base::RunLoop> run_loop_;
content::TestBrowserThread ui_thread_;
std::unique_ptr<content::TestBrowserContext> context_;
std::unique_ptr<PrefService> prefs_;
......
......@@ -6,15 +6,12 @@
#include <string>
#include "base/message_loop/message_loop.h"
#include "components/web_cache/browser/web_cache_manager.h"
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::Time;
using base::TimeDelta;
using content::BrowserThread;
namespace web_cache {
class WebCacheManagerTest : public testing::Test {
......@@ -28,9 +25,7 @@ class WebCacheManagerTest : public testing::Test {
static const WebCacheManager::RendererInfo kStats;
static const WebCacheManager::RendererInfo kStats2;
WebCacheManagerTest()
: ui_thread_(BrowserThread::UI, &message_loop_) {
}
WebCacheManagerTest() = default;
// Thunks to access protected members of WebCacheManager
static std::map<int, WebCacheManager::RendererInfo>& stats(
......@@ -99,8 +94,7 @@ class WebCacheManagerTest : public testing::Test {
private:
WebCacheManager manager_;
base::MessageLoop message_loop_;
content::TestBrowserThread ui_thread_;
content::TestBrowserThreadBundle test_browser_thread_bundle_;
};
// static
......
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