summaryrefslogtreecommitdiff
path: root/chromium/dbus
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-08-30 10:22:43 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-08-30 12:36:28 +0000
commit271a6c3487a14599023a9106329505597638d793 (patch)
treee040d58ffc86c1480b79ca8528020ca9ec919bf8 /chromium/dbus
parent7b2ffa587235a47d4094787d72f38102089f402a (diff)
downloadqtwebengine-chromium-271a6c3487a14599023a9106329505597638d793.tar.gz
BASELINE: Update Chromium to 77.0.3865.59
Change-Id: I1e89a5f3b009a9519a6705102ad65c92fe736f21 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/dbus')
-rw-r--r--chromium/dbus/bus.cc4
-rw-r--r--chromium/dbus/bus_unittest.cc5
-rw-r--r--chromium/dbus/end_to_end_async_unittest.cc10
-rw-r--r--chromium/dbus/mock_unittest.cc10
-rw-r--r--chromium/dbus/object_manager_unittest.cc6
-rw-r--r--chromium/dbus/property_unittest.cc4
-rw-r--r--chromium/dbus/signal_sender_verification_unittest.cc8
7 files changed, 23 insertions, 24 deletions
diff --git a/chromium/dbus/bus.cc b/chromium/dbus/bus.cc
index d16bdc35187..858fb04c999 100644
--- a/chromium/dbus/bus.cc
+++ b/chromium/dbus/bus.cc
@@ -976,7 +976,7 @@ void Bus::ListenForServiceOwnerChangeInternal(
// Check if the callback has already been added.
std::vector<GetServiceOwnerCallback>& callbacks = it->second;
for (size_t i = 0; i < callbacks.size(); ++i) {
- if (callbacks[i].Equals(callback))
+ if (callbacks[i] == callback)
return;
}
callbacks.push_back(callback);
@@ -1008,7 +1008,7 @@ void Bus::UnlistenForServiceOwnerChangeInternal(
std::vector<GetServiceOwnerCallback>& callbacks = it->second;
for (size_t i = 0; i < callbacks.size(); ++i) {
- if (callbacks[i].Equals(callback)) {
+ if (callbacks[i] == callback) {
callbacks.erase(callbacks.begin() + i);
break; // There can be only one.
}
diff --git a/chromium/dbus/bus_unittest.cc b/chromium/dbus/bus_unittest.cc
index 738c64ccd0a..559bfd7023d 100644
--- a/chromium/dbus/bus_unittest.cc
+++ b/chromium/dbus/bus_unittest.cc
@@ -9,8 +9,8 @@
#include "base/files/file_descriptor_watcher_posix.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/test/scoped_task_environment.h"
#include "base/threading/thread.h"
#include "dbus/exported_object.h"
#include "dbus/object_path.h"
@@ -129,8 +129,7 @@ TEST(BusTest, GetObjectProxyIgnoreUnknownService) {
}
TEST(BusTest, RemoveObjectProxy) {
- // Setup the current thread's MessageLoop.
- base::MessageLoop message_loop;
+ base::test::ScopedTaskEnvironment scoped_task_environment;
// Start the D-Bus thread.
base::Thread::Options thread_options;
diff --git a/chromium/dbus/end_to_end_async_unittest.cc b/chromium/dbus/end_to_end_async_unittest.cc
index 2df62ed156e..f90c443b5ac 100644
--- a/chromium/dbus/end_to_end_async_unittest.cc
+++ b/chromium/dbus/end_to_end_async_unittest.cc
@@ -11,10 +11,10 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
+#include "base/test/scoped_task_environment.h"
#include "base/test/test_timeouts.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
@@ -255,7 +255,7 @@ class EndToEndAsyncTest : public testing::Test {
run_loop_->Run();
}
- base::MessageLoop message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
std::unique_ptr<base::RunLoop> run_loop_;
std::vector<std::string> response_strings_;
std::vector<std::string> error_names_;
@@ -442,7 +442,7 @@ TEST_F(EndToEndAsyncTest, CancelPendingCalls) {
// We shouldn't receive any responses. Wait for a while just to make sure.
run_loop_.reset(new base::RunLoop);
- message_loop_.task_runner()->PostDelayedTask(
+ scoped_task_environment_.GetMainThreadTaskRunner()->PostDelayedTask(
FROM_HERE, run_loop_->QuitClosure(), TestTimeouts::tiny_timeout());
run_loop_->Run();
EXPECT_TRUE(response_strings_.empty());
@@ -542,9 +542,9 @@ TEST_F(EndToEndAsyncTest, EmptyResponseCallback) {
// Call the method with an empty callback.
const int timeout_ms = ObjectProxy::TIMEOUT_USE_DEFAULT;
object_proxy_->CallMethod(&method_call, timeout_ms, base::DoNothing());
- // Post a delayed task to quit the message loop.
+ // Post a delayed task to quit the RunLoop.
run_loop_.reset(new base::RunLoop);
- message_loop_.task_runner()->PostDelayedTask(
+ scoped_task_environment_.GetMainThreadTaskRunner()->PostDelayedTask(
FROM_HERE, run_loop_->QuitClosure(), TestTimeouts::tiny_timeout());
run_loop_->Run();
// We cannot tell if the empty callback is called, but at least we can
diff --git a/chromium/dbus/mock_unittest.cc b/chromium/dbus/mock_unittest.cc
index 938d2cf181d..548bf970cbc 100644
--- a/chromium/dbus/mock_unittest.cc
+++ b/chromium/dbus/mock_unittest.cc
@@ -7,9 +7,9 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/test/scoped_task_environment.h"
#include "dbus/message.h"
#include "dbus/mock_bus.h"
#include "dbus/mock_exported_object.h"
@@ -83,7 +83,7 @@ class MockTest : public testing::Test {
protected:
std::string response_string_;
- base::MessageLoop message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
std::unique_ptr<base::RunLoop> run_loop_;
scoped_refptr<MockBus> mock_bus_;
scoped_refptr<MockObjectProxy> mock_proxy_;
@@ -115,15 +115,15 @@ class MockTest : public testing::Test {
return nullptr;
}
- // Creates a response and runs the given response callback in the
- // message loop with the response. Used to implement for |mock_proxy_|.
+ // Creates a response and posts the given response callback with the
+ // response. Used to implement for |mock_proxy_|.
void HandleMockProxyResponseWithMessageLoop(
MethodCall* method_call,
int timeout_ms,
ObjectProxy::ResponseCallback* response_callback) {
std::unique_ptr<Response> response =
CreateMockProxyResponse(method_call, timeout_ms);
- message_loop_.task_runner()->PostTask(
+ scoped_task_environment_.GetMainThreadTaskRunner()->PostTask(
FROM_HERE,
base::BindOnce(&MockTest::RunResponseCallback, base::Unretained(this),
std::move(*response_callback), std::move(response)));
diff --git a/chromium/dbus/object_manager_unittest.cc b/chromium/dbus/object_manager_unittest.cc
index 3f90734b0de..5654fa079b3 100644
--- a/chromium/dbus/object_manager_unittest.cc
+++ b/chromium/dbus/object_manager_unittest.cc
@@ -11,9 +11,9 @@
#include <vector>
#include "base/bind.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/test/scoped_task_environment.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "dbus/bus.h"
@@ -205,7 +205,7 @@ class ObjectManagerTest
WaitForMethodCallback();
}
- base::MessageLoop message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
std::unique_ptr<base::RunLoop> run_loop_;
std::unique_ptr<base::Thread> dbus_thread_;
scoped_refptr<Bus> bus_;
@@ -405,7 +405,7 @@ TEST_F(ObjectManagerTest, PropertiesChangedAsObjectsReceived) {
// after setting up the match rule for PropertiesChanged. We should process
// the PropertiesChanged event right after that. If we don't receive it within
// 2 seconds, then fail the test.
- message_loop_.task_runner()->PostDelayedTask(
+ scoped_task_environment_.GetMainThreadTaskRunner()->PostDelayedTask(
FROM_HERE,
base::BindOnce(&ObjectManagerTest::PropertiesChangedTestTimeout,
base::Unretained(this)),
diff --git a/chromium/dbus/property_unittest.cc b/chromium/dbus/property_unittest.cc
index 484632895e8..f3d4e8ffb82 100644
--- a/chromium/dbus/property_unittest.cc
+++ b/chromium/dbus/property_unittest.cc
@@ -13,10 +13,10 @@
#include "base/bind.h"
#include "base/logging.h"
-#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
+#include "base/test/scoped_task_environment.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "dbus/bus.h"
@@ -158,7 +158,7 @@ class PropertyTest : public testing::Test {
}
}
- base::MessageLoop message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
std::unique_ptr<base::RunLoop> run_loop_;
std::unique_ptr<base::Thread> dbus_thread_;
scoped_refptr<Bus> bus_;
diff --git a/chromium/dbus/signal_sender_verification_unittest.cc b/chromium/dbus/signal_sender_verification_unittest.cc
index 8c6ca57819a..92fe63aefd0 100644
--- a/chromium/dbus/signal_sender_verification_unittest.cc
+++ b/chromium/dbus/signal_sender_verification_unittest.cc
@@ -5,11 +5,11 @@
#include <memory>
#include "base/bind.h"
-#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/histogram_samples.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/test/scoped_task_environment.h"
#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread_restrictions.h"
@@ -114,8 +114,8 @@ class SignalSenderVerificationTest : public testing::Test {
void OnOwnership(bool expected, bool success) {
ASSERT_EQ(expected, success);
- // PostTask to quit the MessageLoop as this is called from D-Bus thread.
- message_loop_.task_runner()->PostTask(
+ // PostTask to quit the RunLoop as this is called from D-Bus thread.
+ scoped_task_environment_.GetMainThreadTaskRunner()->PostTask(
FROM_HERE,
base::BindOnce(&SignalSenderVerificationTest::OnOwnershipInternal,
base::Unretained(this)));
@@ -166,7 +166,7 @@ class SignalSenderVerificationTest : public testing::Test {
base::ThreadRestrictions::SetIOAllowed(false);
}
- base::MessageLoop message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
std::unique_ptr<base::RunLoop> run_loop_;
std::unique_ptr<base::Thread> dbus_thread_;
scoped_refptr<Bus> bus_;