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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 WaitForLoaded wait_for_load(load_run_loop.QuitClosure()); | 972 WaitForLoaded wait_for_load(load_run_loop.QuitClosure()); |
973 version_->embedded_worker()->AddListener(&wait_for_load); | 973 version_->embedded_worker()->AddListener(&wait_for_load); |
974 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 974 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
975 base::Bind(&self::StartOnIOThread, this, | 975 base::Bind(&self::StartOnIOThread, this, |
976 start_run_loop.QuitClosure(), &status)); | 976 start_run_loop.QuitClosure(), &status)); |
977 load_run_loop.Run(); | 977 load_run_loop.Run(); |
978 version_->embedded_worker()->RemoveListener(&wait_for_load); | 978 version_->embedded_worker()->RemoveListener(&wait_for_load); |
979 | 979 |
980 // The script has loaded but start has not completed yet. | 980 // The script has loaded but start has not completed yet. |
981 ASSERT_EQ(SERVICE_WORKER_ERROR_FAILED, status); | 981 ASSERT_EQ(SERVICE_WORKER_ERROR_FAILED, status); |
982 EXPECT_EQ(ServiceWorkerVersion::STARTING, version_->running_status()); | 982 EXPECT_EQ(ServiceWorkerVersion::RunningStatus::STARTING, |
| 983 version_->running_status()); |
983 | 984 |
984 // Simulate execution timeout. Use a delay to prevent killing the worker | 985 // Simulate execution timeout. Use a delay to prevent killing the worker |
985 // before it's started execution. | 986 // before it's started execution. |
986 EXPECT_TRUE(version_->timeout_timer_.IsRunning()); | 987 EXPECT_TRUE(version_->timeout_timer_.IsRunning()); |
987 RunOnIOThreadWithDelay(base::Bind(&self::TimeoutWorkerOnIOThread, this), | 988 RunOnIOThreadWithDelay(base::Bind(&self::TimeoutWorkerOnIOThread, this), |
988 base::TimeDelta::FromMilliseconds(100)); | 989 base::TimeDelta::FromMilliseconds(100)); |
989 start_run_loop.Run(); | 990 start_run_loop.Run(); |
990 | 991 |
991 EXPECT_EQ(SERVICE_WORKER_ERROR_TIMEOUT, status); | 992 EXPECT_EQ(SERVICE_WORKER_ERROR_TIMEOUT, status); |
992 } | 993 } |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1865 NavigateToTestPage(); | 1866 NavigateToTestPage(); |
1866 // The V8 code cache must be stored to the CacheStorage which must be bigger | 1867 // The V8 code cache must be stored to the CacheStorage which must be bigger |
1867 // than 12 byte. | 1868 // than 12 byte. |
1868 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize); | 1869 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize); |
1869 | 1870 |
1870 NavigateToTestPage(); | 1871 NavigateToTestPage(); |
1871 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize); | 1872 EXPECT_GT(GetSideDataSize(), kV8CacheTimeStampDataSize); |
1872 } | 1873 } |
1873 | 1874 |
1874 } // namespace content | 1875 } // namespace content |
OLD | NEW |