OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 // Stop a worker and wait until OnStopped() is called. | 787 // Stop a worker and wait until OnStopped() is called. |
788 base::RunLoop stop_run_loop; | 788 base::RunLoop stop_run_loop; |
789 done_closure_ = stop_run_loop.QuitClosure(); | 789 done_closure_ = stop_run_loop.QuitClosure(); |
790 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 790 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
791 base::Bind(&self::StopOnIOThread, this)); | 791 base::Bind(&self::StopOnIOThread, this)); |
792 stop_run_loop.Run(); | 792 stop_run_loop.Run(); |
793 | 793 |
794 ASSERT_EQ(EmbeddedWorkerInstance::STOPPED, last_worker_status_); | 794 ASSERT_EQ(EmbeddedWorkerInstance::STOPPED, last_worker_status_); |
795 } | 795 } |
796 | 796 |
797 IN_PROC_BROWSER_TEST_F(EmbeddedWorkerBrowserTest, StartPaused_ThenResume) { | 797 #if defined(OS_LINUX) |
| 798 // Flaky on Linux 32-bit: http://crbug.com/498688. |
| 799 #define MAYBE_StartPaused_ThenResume DISABLED_StartPaused_ThenResume |
| 800 #else |
| 801 #define MAYBE_StartPaused_ThenResume StartPaused_ThenResume |
| 802 #endif |
| 803 IN_PROC_BROWSER_TEST_F(EmbeddedWorkerBrowserTest, |
| 804 MAYBE_StartPaused_ThenResume) { |
798 pause_mode_ = PAUSE_THEN_RESUME; | 805 pause_mode_ = PAUSE_THEN_RESUME; |
799 base::RunLoop start_run_loop; | 806 base::RunLoop start_run_loop; |
800 done_closure_ = start_run_loop.QuitClosure(); | 807 done_closure_ = start_run_loop.QuitClosure(); |
801 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 808 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
802 base::Bind(&self::StartOnIOThread, this)); | 809 base::Bind(&self::StartOnIOThread, this)); |
803 start_run_loop.Run(); | 810 start_run_loop.Run(); |
804 ASSERT_EQ(EmbeddedWorkerInstance::RUNNING, last_worker_status_); | 811 ASSERT_EQ(EmbeddedWorkerInstance::RUNNING, last_worker_status_); |
805 } | 812 } |
806 | 813 |
807 IN_PROC_BROWSER_TEST_F(EmbeddedWorkerBrowserTest, | 814 IN_PROC_BROWSER_TEST_F(EmbeddedWorkerBrowserTest, |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1485 ASSERT_EQ(SERVICE_WORKER_OK, status); | 1492 ASSERT_EQ(SERVICE_WORKER_OK, status); |
1486 // Stop the worker. | 1493 // Stop the worker. |
1487 StopWorker(SERVICE_WORKER_OK); | 1494 StopWorker(SERVICE_WORKER_OK); |
1488 // Restart the worker. | 1495 // Restart the worker. |
1489 StartWorker(SERVICE_WORKER_OK); | 1496 StartWorker(SERVICE_WORKER_OK); |
1490 // Stop the worker. | 1497 // Stop the worker. |
1491 StopWorker(SERVICE_WORKER_OK); | 1498 StopWorker(SERVICE_WORKER_OK); |
1492 } | 1499 } |
1493 | 1500 |
1494 } // namespace content | 1501 } // namespace content |
OLD | NEW |