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

Unified Diff: content/browser/shared_worker/shared_worker_service_impl_unittest.cc

Issue 2725133002: Mojo: Armed Watchers (Closed)
Patch Set: . Created 3 years, 9 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
« no previous file with comments | « content/browser/loader/mojo_async_resource_handler.cc ('k') | content/child/url_response_body_consumer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/shared_worker/shared_worker_service_impl_unittest.cc
diff --git a/content/browser/shared_worker/shared_worker_service_impl_unittest.cc b/content/browser/shared_worker/shared_worker_service_impl_unittest.cc
index db5c128404b9e9d56479dd37830e975d5a7a503a..60481902f7fbeac4e4d6394bbc087dc3cf9d13c8 100644
--- a/content/browser/shared_worker/shared_worker_service_impl_unittest.cc
+++ b/content/browser/shared_worker/shared_worker_service_impl_unittest.cc
@@ -15,10 +15,10 @@
#include "base/atomic_sequence_num.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "base/run_loop.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/lock.h"
-#include "base/synchronization/waitable_event.h"
#include "content/browser/shared_worker/shared_worker_message_filter.h"
#include "content/browser/shared_worker/worker_storage_partition.h"
#include "content/common/view_messages.h"
@@ -112,11 +112,9 @@ static const unsigned long long kDocumentIDs[] = {200, 201, 202};
static const int kRenderFrameRouteIDs[] = {300, 301, 302};
void BlockingReadFromMessagePort(MessagePort port, base::string16* message) {
- base::WaitableEvent event(base::WaitableEvent::ResetPolicy::MANUAL,
- base::WaitableEvent::InitialState::NOT_SIGNALED);
- port.SetCallback(
- base::Bind(&base::WaitableEvent::Signal, base::Unretained(&event)));
- event.Wait();
+ base::RunLoop run_loop;
+ port.SetCallback(run_loop.QuitClosure());
+ run_loop.Run();
std::vector<MessagePort> should_be_empty;
EXPECT_TRUE(port.GetMessage(message, &should_be_empty));
« no previous file with comments | « content/browser/loader/mojo_async_resource_handler.cc ('k') | content/child/url_response_body_consumer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698