Commit 9d32d0f2 authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa Committed by Commit Bot

Add syntax highlighting to the threading_and_tasks_testing.md examples.

Change-Id: Ib9710772ce534e49d42f51dd8c4b374d85659127
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1823852
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700318}
parent 47c47d86
...@@ -49,7 +49,7 @@ tasks. ...@@ -49,7 +49,7 @@ tasks.
Typically this will look something like this: Typically this will look something like this:
foo.h foo.h
``` ```c++
class Foo { class Foo {
public: public:
Foo() : owning_sequence_(base::SequencedTaskRunnerHandle::Get()) {} Foo() : owning_sequence_(base::SequencedTaskRunnerHandle::Get()) {}
...@@ -69,7 +69,7 @@ class Foo { ...@@ -69,7 +69,7 @@ class Foo {
``` ```
foo_unittest.cc foo_unittest.cc
``` ```c++
TEST(FooTest, DoSomething) { TEST(FooTest, DoSomething) {
base::test::SingleThreadTaskEnvironment task_environment; base::test::SingleThreadTaskEnvironment task_environment;
...@@ -101,7 +101,7 @@ seam :). ...@@ -101,7 +101,7 @@ seam :).
Typical use case: Typical use case:
foo_service.h foo_service.h
``` ```c++
class FooService { class FooService {
public: public:
FooService() FooService()
...@@ -130,7 +130,7 @@ class FooService { ...@@ -130,7 +130,7 @@ class FooService {
``` ```
foo_service_unittest.cc foo_service_unittest.cc
``` ```c++
TEST(FooServiceTest, FlushAndReply) { TEST(FooServiceTest, FlushAndReply) {
base::test::TaskEnvironment task_environment; base::test::TaskEnvironment task_environment;
...@@ -203,7 +203,7 @@ This makes it possible to test code with flush intervals, repeating timers, ...@@ -203,7 +203,7 @@ This makes it possible to test code with flush intervals, repeating timers,
timeouts, etc. without any test-specific seams in the product code, e.g.: timeouts, etc. without any test-specific seams in the product code, e.g.:
foo_storage.h foo_storage.h
``` ```c++
class FooStorage { class FooStorage {
public: public:
static constexpr base::TimeDelta::kFlushInterval = static constexpr base::TimeDelta::kFlushInterval =
...@@ -215,7 +215,7 @@ class FooStorage { ...@@ -215,7 +215,7 @@ class FooStorage {
``` ```
foo_unittest.cc foo_unittest.cc
``` ```c++
class FooStorageTest { class FooStorageTest {
public: public:
FooStorageTest() = default; FooStorageTest() = default;
...@@ -247,7 +247,7 @@ advance the clock enough that the delayed task becomes runnable, and then ...@@ -247,7 +247,7 @@ advance the clock enough that the delayed task becomes runnable, and then
`TaskEnvironment::RunUntilIdle()` would run the delayed task, signalling the `TaskEnvironment::RunUntilIdle()` would run the delayed task, signalling the
event. event.
``` ```c++
TEST(FooTest, TimeoutExceeded) TEST(FooTest, TimeoutExceeded)
{ {
base::test::TaskEnvironment task_environment{ base::test::TaskEnvironment task_environment{
...@@ -328,7 +328,7 @@ desired. ...@@ -328,7 +328,7 @@ desired.
This typically looks like this (in this case `FooTestBase` opts to enforce This typically looks like this (in this case `FooTestBase` opts to enforce
`MainThreadType::UI` and leaves other traits to be specified as desired): `MainThreadType::UI` and leaves other traits to be specified as desired):
``` ```c++
// Constructs a FooTestBase with |traits| being forwarded to its // Constructs a FooTestBase with |traits| being forwarded to its
// TaskEnvironment. MainThreadType always defaults to UI and must not be // TaskEnvironment. MainThreadType always defaults to UI and must not be
// specified. // specified.
......
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