Chromium Code Reviews| Index: content/browser/service_worker/service_worker_browsertest.cc |
| diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc |
| index 605daad6df34c47a423036d784d24f00019b0118..1c0ba698184a3b77215dc09bdfc30f7fa4205ca9 100644 |
| --- a/content/browser/service_worker/service_worker_browsertest.cc |
| +++ b/content/browser/service_worker/service_worker_browsertest.cc |
| @@ -1171,9 +1171,13 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, TimeoutStartingWorker) { |
| // Simulate execution timeout. Use a delay to prevent killing the worker |
| // before it's started execution. |
| - EXPECT_TRUE(version_->timeout_timer_.IsRunning()); |
| RunOnIOThreadWithDelay( |
|
horo
2017/04/27 02:33:12
Keep this as is, and call "version_->timeout_timer
gab
2017/04/27 14:56:04
RunOnIOThreadWithDelay is an anonymous method, it
horo
2017/04/27 15:49:52
TimeoutWorkerOnIOThread() have access to |version_
gab
2017/05/26 04:26:57
Done.
|
| - base::Bind(&self::TimeoutWorkerOnIOThread, base::Unretained(this)), |
| + base::Bind( |
| + [](const base::Timer* timeout_timer, self* self) { |
| + EXPECT_TRUE(timeout_timer->IsRunning()); |
| + self->TimeoutWorkerOnIOThread(); |
| + }, |
| + base::Unretained(&version_->timeout_timer_), base::Unretained(this)), |
| base::TimeDelta::FromMilliseconds(100)); |
| start_run_loop.Run(); |
| @@ -1205,9 +1209,13 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, TimeoutWorkerInEvent) { |
| // Simulate execution timeout. Use a delay to prevent killing the worker |
| // before it's started execution. |
| - EXPECT_TRUE(version_->timeout_timer_.IsRunning()); |
| RunOnIOThreadWithDelay( |
| - base::Bind(&self::TimeoutWorkerOnIOThread, base::Unretained(this)), |
| + base::Bind( |
| + [](const base::Timer* timeout_timer, self* self) { |
| + EXPECT_TRUE(timeout_timer->IsRunning()); |
| + self->TimeoutWorkerOnIOThread(); |
| + }, |
| + base::Unretained(&version_->timeout_timer_), base::Unretained(this)), |
| base::TimeDelta::FromMilliseconds(100)); |
| install_run_loop.Run(); |