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

Unified Diff: chrome/browser/extensions/api/web_request/web_request_api_unittest.cc

Issue 2132593002: Remove remaining calls to deprecated MessageLoop methods on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: h264_vt_encoder_unittest.cc Created 4 years, 5 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
Index: chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
diff --git a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
index 861094c015cd5005b90f4bf707cc834dfae5335e..39223187ad38bafd900b9c5db8c52bb5bdbc6175 100644
--- a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc
@@ -11,16 +11,15 @@
#include <tuple>
#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/files/file_path.h"
#include "base/json/json_reader.h"
#include "base/json/json_string_value_serializer.h"
-#include "base/location.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
-#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
@@ -464,16 +463,18 @@ TEST_F(ExtensionWebRequestTest, SimulateChancelWhileBlocked) {
&profile_, extension_id, kEventName, kEventName + "/1",
request->identifier(), response));
+ base::RunLoop run_loop;
+
// Extension response for OnErrorOccurred: Terminate the message loop.
ipc_sender_.PushTask(
- base::Bind(&base::MessageLoop::PostTask,
- base::Unretained(base::MessageLoop::current()), FROM_HERE,
- base::MessageLoop::QuitWhenIdleClosure()));
+ base::Bind(base::IgnoreResult(&base::SingleThreadTaskRunner::PostTask),
+ base::ThreadTaskRunnerHandle::Get(), FROM_HERE,
+ run_loop.QuitWhenIdleClosure()));
request->Start();
// request->Start() will have submitted OnBeforeRequest by the time we cancel.
request->Cancel();
- base::RunLoop().Run();
+ run_loop.Run();
EXPECT_TRUE(!request->is_pending());
EXPECT_EQ(net::URLRequestStatus::CANCELED, request->status().status());
« no previous file with comments | « chrome/browser/devtools/device/port_forwarding_browsertest.cc ('k') | chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698