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

Unified Diff: content/browser/device_orientation/data_fetcher_shared_memory_base_unittest.cc

Issue 23986002: Fix TSan issues for data_fetcher_shared_memory_base_unittest.cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hmm rebased once more Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/device_orientation/data_fetcher_shared_memory_base_unittest.cc
diff --git a/content/browser/device_orientation/data_fetcher_shared_memory_base_unittest.cc b/content/browser/device_orientation/data_fetcher_shared_memory_base_unittest.cc
index a25341abe5f71a2e712a99218a93245824a61451..9080e9115de578a1465b39338602c702a3da7f09 100644
--- a/content/browser/device_orientation/data_fetcher_shared_memory_base_unittest.cc
+++ b/content/browser/device_orientation/data_fetcher_shared_memory_base_unittest.cc
@@ -130,10 +130,6 @@ class FakeNonPollingDataFetcher : public FakeDataFetcher {
virtual ~FakeNonPollingDataFetcher() { }
virtual bool Start(ConsumerType consumer_type, void* buffer) OVERRIDE {
- base::SharedMemoryHandle handle = GetSharedMemoryHandleForProcess(
- consumer_type, base::GetCurrentProcessHandle());
- EXPECT_TRUE(base::SharedMemory::IsHandleValid(handle));
-
Init(consumer_type, buffer);
switch (consumer_type) {
case CONSUMER_TYPE_MOTION:
@@ -185,9 +181,6 @@ class FakePollingDataFetcher : public FakeDataFetcher {
virtual bool Start(ConsumerType consumer_type, void* buffer) OVERRIDE {
EXPECT_TRUE(base::MessageLoop::current() == GetPollingMessageLoop());
- base::SharedMemoryHandle handle = GetSharedMemoryHandleForProcess(
- consumer_type, base::GetCurrentProcessHandle());
- EXPECT_TRUE(base::SharedMemory::IsHandleValid(handle));
Init(consumer_type, buffer);
switch (consumer_type) {
@@ -304,8 +297,18 @@ TEST(DataFetcherSharedMemoryBaseTest, DoesPollMotionAndOrientation) {
EXPECT_TRUE(fake_data_fetcher.StartFetchingDeviceData(
CONSUMER_TYPE_ORIENTATION));
+ base::SharedMemoryHandle handle_orientation =
+ fake_data_fetcher.GetSharedMemoryHandleForProcess(
+ CONSUMER_TYPE_ORIENTATION, base::GetCurrentProcessHandle());
+ EXPECT_TRUE(base::SharedMemory::IsHandleValid(handle_orientation));
+
EXPECT_TRUE(fake_data_fetcher.StartFetchingDeviceData(
CONSUMER_TYPE_MOTION));
+ base::SharedMemoryHandle handle_motion =
+ fake_data_fetcher.GetSharedMemoryHandleForProcess(
+ CONSUMER_TYPE_MOTION, base::GetCurrentProcessHandle());
+ EXPECT_TRUE(base::SharedMemory::IsHandleValid(handle_motion));
+
fake_data_fetcher.WaitForStart(CONSUMER_TYPE_ORIENTATION);
fake_data_fetcher.WaitForStart(CONSUMER_TYPE_MOTION);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698