Commit 1275123b authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Backport some tests in /services/shape_detection to SingleThreadTaskEnvironment

These tests were previously migrated from single-threaded MessageLoop to
a multi-threaded TaskEnvironment (then named ScopedTaskEnvironment) as
part of crbug.com/891670.

//base OWNERS decided in retrospect that it was better to keep a
single-threaded option for TaskEnvironment and introduced
SingleThreadTaskEnvironment. This CL retrofits that decision for
/services/shape_detection.

This CL is a no-op if it passes CQ.

This CL was uploaded by git cl split.

R=mcasas@chromium.org

Bug: 891670
Change-Id: Ic6a5245d25a2a75218813cbb33670842a1140ac2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1786681
Auto-Submit: Gabriel Charette <gab@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695792}
parent f071fd4c
...@@ -120,7 +120,7 @@ class BarcodeDetectionImplMacTest : public TestWithParam<struct TestParams> { ...@@ -120,7 +120,7 @@ class BarcodeDetectionImplMacTest : public TestWithParam<struct TestParams> {
MOCK_METHOD0(Detection, void(void)); MOCK_METHOD0(Detection, void(void));
std::unique_ptr<mojom::BarcodeDetection> impl_; std::unique_ptr<mojom::BarcodeDetection> impl_;
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
void* vision_framework_ = nullptr; void* vision_framework_ = nullptr;
}; };
......
...@@ -125,7 +125,7 @@ class BarcodeDetectionProviderMacTest ...@@ -125,7 +125,7 @@ class BarcodeDetectionProviderMacTest
MOCK_METHOD0(OnEnumerateSupportedFormats, void(void)); MOCK_METHOD0(OnEnumerateSupportedFormats, void(void));
std::unique_ptr<mojom::BarcodeDetectionProvider> provider_; std::unique_ptr<mojom::BarcodeDetectionProvider> provider_;
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
void* vision_framework_ = nullptr; void* vision_framework_ = nullptr;
bool is_vision_available_ = false; bool is_vision_available_ = false;
}; };
......
...@@ -137,7 +137,7 @@ class FaceDetectionImplMacTest : public TestWithParam<struct TestParams> { ...@@ -137,7 +137,7 @@ class FaceDetectionImplMacTest : public TestWithParam<struct TestParams> {
MOCK_METHOD0(Detection, void(void)); MOCK_METHOD0(Detection, void(void));
std::unique_ptr<mojom::FaceDetection> impl_; std::unique_ptr<mojom::FaceDetection> impl_;
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
void* vision_framework_; void* vision_framework_;
}; };
......
...@@ -34,7 +34,7 @@ class TextDetectionImplMacTest : public ::testing::Test { ...@@ -34,7 +34,7 @@ class TextDetectionImplMacTest : public ::testing::Test {
MOCK_METHOD1(Detection, void(size_t)); MOCK_METHOD1(Detection, void(size_t));
API_AVAILABLE(macosx(10.11)) std::unique_ptr<TextDetectionImplMac> impl_; API_AVAILABLE(macosx(10.11)) std::unique_ptr<TextDetectionImplMac> impl_;
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
}; };
TEST_F(TextDetectionImplMacTest, CreateAndDestroy) {} TEST_F(TextDetectionImplMacTest, CreateAndDestroy) {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment