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 13 matching lines...) Expand all Loading... |
24 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
25 #include "base/test/scoped_feature_list.h" | 25 #include "base/test/scoped_feature_list.h" |
26 #include "base/threading/thread_task_runner_handle.h" | 26 #include "base/threading/thread_task_runner_handle.h" |
27 #include "base/time/time.h" | 27 #include "base/time/time.h" |
28 #include "build/build_config.h" | 28 #include "build/build_config.h" |
29 #include "content/browser/blob_storage/chrome_blob_storage_context.h" | 29 #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
30 #include "content/browser/cache_storage/cache_storage_cache.h" | 30 #include "content/browser/cache_storage/cache_storage_cache.h" |
31 #include "content/browser/cache_storage/cache_storage_cache_handle.h" | 31 #include "content/browser/cache_storage/cache_storage_cache_handle.h" |
32 #include "content/browser/cache_storage/cache_storage_context_impl.h" | 32 #include "content/browser/cache_storage/cache_storage_context_impl.h" |
33 #include "content/browser/cache_storage/cache_storage_manager.h" | 33 #include "content/browser/cache_storage/cache_storage_manager.h" |
34 #include "content/browser/memory/memory_coordinator.h" | 34 #include "content/browser/memory/memory_coordinator_impl.h" |
35 #include "content/browser/service_worker/embedded_worker_instance.h" | 35 #include "content/browser/service_worker/embedded_worker_instance.h" |
36 #include "content/browser/service_worker/embedded_worker_registry.h" | 36 #include "content/browser/service_worker/embedded_worker_registry.h" |
37 #include "content/browser/service_worker/embedded_worker_status.h" | 37 #include "content/browser/service_worker/embedded_worker_status.h" |
38 #include "content/browser/service_worker/service_worker_context_core.h" | 38 #include "content/browser/service_worker/service_worker_context_core.h" |
39 #include "content/browser/service_worker/service_worker_context_observer.h" | 39 #include "content/browser/service_worker/service_worker_context_observer.h" |
40 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 40 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
41 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h" | 41 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h" |
42 #include "content/browser/service_worker/service_worker_registration.h" | 42 #include "content/browser/service_worker/service_worker_registration.h" |
43 #include "content/browser/service_worker/service_worker_test_utils.h" | 43 #include "content/browser/service_worker/service_worker_test_utils.h" |
44 #include "content/browser/service_worker/service_worker_version.h" | 44 #include "content/browser/service_worker/service_worker_version.h" |
(...skipping 2926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2971 // MemoryCoordinatorWithServiceWorkerTest checks if a process won't be | 2971 // MemoryCoordinatorWithServiceWorkerTest checks if a process won't be |
2972 // suspended when it has one or more shared workers or service workers. | 2972 // suspended when it has one or more shared workers or service workers. |
2973 // TODO(shimazu): Enable these tests on macos when MemoryMonitorMac is | 2973 // TODO(shimazu): Enable these tests on macos when MemoryMonitorMac is |
2974 // implemented. | 2974 // implemented. |
2975 #if !defined(OS_MACOSX) | 2975 #if !defined(OS_MACOSX) |
2976 IN_PROC_BROWSER_TEST_P(MemoryCoordinatorWithServiceWorkerTest, | 2976 IN_PROC_BROWSER_TEST_P(MemoryCoordinatorWithServiceWorkerTest, |
2977 CannotSuspendRendererWithServiceWorker) { | 2977 CannotSuspendRendererWithServiceWorker) { |
2978 StartServerAndNavigateToSetup(); | 2978 StartServerAndNavigateToSetup(); |
2979 ActivateTestHelper("/service_worker/fetch_event.js", SERVICE_WORKER_OK); | 2979 ActivateTestHelper("/service_worker/fetch_event.js", SERVICE_WORKER_OK); |
2980 | 2980 |
2981 MemoryCoordinator* memory_coordinator = MemoryCoordinator::GetInstance(); | 2981 MemoryCoordinatorImpl* memory_coordinator = |
| 2982 MemoryCoordinatorImpl::GetInstance(); |
2982 memory_coordinator->SetDelegateForTesting( | 2983 memory_coordinator->SetDelegateForTesting( |
2983 base::MakeUnique<TestMemoryCoordinatorDelegate>()); | 2984 base::MakeUnique<TestMemoryCoordinatorDelegate>()); |
2984 | 2985 |
2985 // Ensure only one process host exists. | 2986 // Ensure only one process host exists. |
2986 ASSERT_EQ(1, CountRenderProcessHosts()); | 2987 ASSERT_EQ(1, CountRenderProcessHosts()); |
2987 ASSERT_EQ(1u, memory_coordinator->children().size()); | 2988 ASSERT_EQ(1u, memory_coordinator->children().size()); |
2988 | 2989 |
2989 // Check the number of workers. | 2990 // Check the number of workers. |
2990 int render_process_id = memory_coordinator->children().begin()->first; | 2991 int render_process_id = memory_coordinator->children().begin()->first; |
2991 RenderProcessHost* rph = RenderProcessHost::FromID(render_process_id); | 2992 RenderProcessHost* rph = RenderProcessHost::FromID(render_process_id); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3029 ServiceWorkerV8CacheStrategiesNormalTest, | 3030 ServiceWorkerV8CacheStrategiesNormalTest, |
3030 ::testing::Values(true, false)); | 3031 ::testing::Values(true, false)); |
3031 INSTANTIATE_TEST_CASE_P(ServiceWorkerBrowserTest, | 3032 INSTANTIATE_TEST_CASE_P(ServiceWorkerBrowserTest, |
3032 ServiceWorkerV8CacheStrategiesAggressiveTest, | 3033 ServiceWorkerV8CacheStrategiesAggressiveTest, |
3033 ::testing::Values(true, false)); | 3034 ::testing::Values(true, false)); |
3034 INSTANTIATE_TEST_CASE_P(ServiceWorkerBrowserTest, | 3035 INSTANTIATE_TEST_CASE_P(ServiceWorkerBrowserTest, |
3035 ServiceWorkerDisableWebSecurityTest, | 3036 ServiceWorkerDisableWebSecurityTest, |
3036 ::testing::Values(true, false)); | 3037 ::testing::Values(true, false)); |
3037 | 3038 |
3038 } // namespace content | 3039 } // namespace content |
OLD | NEW |