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

Unified Diff: chrome/browser/conflicts/module_event_sink_impl_win_unittest.cc

Issue 2721503003: Add ModuleInspector (Closed)
Patch Set: merge 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
Index: chrome/browser/conflicts/module_event_sink_impl_win_unittest.cc
diff --git a/chrome/browser/conflicts/module_event_sink_impl_win_unittest.cc b/chrome/browser/conflicts/module_event_sink_impl_win_unittest.cc
index 8b88fceabe00cc67215c2bd1e192c4448972e2ef..d6c8b18b61cf85ddeb1095f82ff16acffd2486a4 100644
--- a/chrome/browser/conflicts/module_event_sink_impl_win_unittest.cc
+++ b/chrome/browser/conflicts/module_event_sink_impl_win_unittest.cc
@@ -7,7 +7,8 @@
#include <memory>
#include "base/memory/ptr_util.h"
-#include "base/message_loop/message_loop.h"
+#include "base/test/scoped_task_scheduler.h"
+#include "base/threading/sequenced_task_runner_handle.h"
#include "chrome/browser/conflicts/module_database_win.h"
#include "chrome/common/conflicts/module_watcher_win.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -26,9 +27,8 @@ const uint64_t kInvalidLoadAddress = 0xDEADBEEF;
class ModuleEventSinkImplTest : public testing::Test {
protected:
ModuleEventSinkImplTest()
- : message_loop_(base::MakeUnique<base::MessageLoop>()),
- module_database_(
- base::MakeUnique<ModuleDatabase>(message_loop_->task_runner())) {}
+ : module_database_(base::MakeUnique<ModuleDatabase>(
+ base::SequencedTaskRunnerHandle::Get())) {}
void CreateModuleSinkImpl() {
module_event_sink_impl_ = base::MakeUnique<ModuleEventSinkImpl>(
@@ -36,10 +36,6 @@ class ModuleEventSinkImplTest : public testing::Test {
module_database_.get());
}
- ModuleDatabase* module_database() {
- return module_event_sink_impl_->module_database_;
- }
-
const ModuleDatabase::ModuleMap& modules() {
return module_database_->modules_;
}
@@ -50,7 +46,8 @@ class ModuleEventSinkImplTest : public testing::Test {
uint32_t process_id() { return module_event_sink_impl_->process_id_; }
- std::unique_ptr<base::MessageLoop> message_loop_;
+ // Must be before |module_database_|.
+ base::test::ScopedTaskScheduler scoped_task_scheduler_;
std::unique_ptr<ModuleDatabase> module_database_;
std::unique_ptr<ModuleEventSinkImpl> module_event_sink_impl_;
@@ -67,7 +64,6 @@ TEST_F(ModuleEventSinkImplTest, CallsForwardedAsExpected) {
// Construction should immediately fire off a call to OnProcessStarted and
// create a process entry in the module database.
CreateModuleSinkImpl();
- EXPECT_EQ(module_database_.get(), module_database());
EXPECT_EQ(::GetCurrentProcessId(), process_id());
EXPECT_EQ(0u, modules().size());
EXPECT_EQ(1u, processes().size());
« no previous file with comments | « chrome/browser/conflicts/module_database_win_unittest.cc ('k') | chrome/browser/conflicts/module_info_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698