| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 NavigateAndWaitForAuth(url); | 141 NavigateAndWaitForAuth(url); |
| 142 } | 142 } |
| 143 | 143 |
| 144 #if defined(OS_LINUX) | 144 #if defined(OS_LINUX) |
| 145 // This test is flaky inside the Linux SUID sandbox. | 145 // This test is flaky inside the Linux SUID sandbox. |
| 146 // http://crbug.com/130116 | 146 // http://crbug.com/130116 |
| 147 IN_PROC_BROWSER_TEST_F(WorkerTest, DISABLED_LimitPerPage) { | 147 IN_PROC_BROWSER_TEST_F(WorkerTest, DISABLED_LimitPerPage) { |
| 148 #else | 148 #else |
| 149 IN_PROC_BROWSER_TEST_F(WorkerTest, LimitPerPage) { | 149 IN_PROC_BROWSER_TEST_F(WorkerTest, LimitPerPage) { |
| 150 #endif | 150 #endif |
| 151 // There is no limitation of SharedWorker if EmbeddedSharedWorker is enabled. |
| 152 if (WorkerService::EmbeddedSharedWorkerEnabled()) |
| 153 return; |
| 151 int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerFrameWhenSeparate; | 154 int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerFrameWhenSeparate; |
| 152 std::string query = base::StringPrintf("?count=%d", max_workers_per_tab + 1); | 155 std::string query = base::StringPrintf("?count=%d", max_workers_per_tab + 1); |
| 153 | 156 |
| 154 GURL url = GetTestURL("many_shared_workers.html", query); | 157 GURL url = GetTestURL("many_shared_workers.html", query); |
| 155 NavigateToURL(shell(), url); | 158 NavigateToURL(shell(), url); |
| 156 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); | 159 ASSERT_TRUE(WaitForWorkerProcessCount(max_workers_per_tab)); |
| 157 } | 160 } |
| 158 | 161 |
| 159 | 162 |
| 160 #if defined(OS_LINUX) || defined(OS_MACOSX) | 163 #if defined(OS_LINUX) || defined(OS_MACOSX) |
| 161 // This test is flaky inside the Linux SUID sandbox: http://crbug.com/130116 | 164 // This test is flaky inside the Linux SUID sandbox: http://crbug.com/130116 |
| 162 // Also flaky on Mac: http://crbug.com/295193 | 165 // Also flaky on Mac: http://crbug.com/295193 |
| 163 IN_PROC_BROWSER_TEST_F(WorkerTest, DISABLED_LimitTotal) { | 166 IN_PROC_BROWSER_TEST_F(WorkerTest, DISABLED_LimitTotal) { |
| 164 #else | 167 #else |
| 165 // http://crbug.com/36800 | 168 // http://crbug.com/36800 |
| 166 IN_PROC_BROWSER_TEST_F(WorkerTest, LimitTotal) { | 169 IN_PROC_BROWSER_TEST_F(WorkerTest, LimitTotal) { |
| 167 #endif | 170 #endif |
| 171 // There is no limitation of SharedWorker if EmbeddedSharedWorker is enabled. |
| 172 if (WorkerService::EmbeddedSharedWorkerEnabled()) |
| 173 return; |
| 168 if (base::SysInfo::AmountOfPhysicalMemoryMB() < 8192) { | 174 if (base::SysInfo::AmountOfPhysicalMemoryMB() < 8192) { |
| 169 VLOG(0) << "WorkerTest.LimitTotal not running because it needs 8 GB RAM."; | 175 VLOG(0) << "WorkerTest.LimitTotal not running because it needs 8 GB RAM."; |
| 170 return; | 176 return; |
| 171 } | 177 } |
| 172 | 178 |
| 173 int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerFrameWhenSeparate; | 179 int max_workers_per_tab = WorkerServiceImpl::kMaxWorkersPerFrameWhenSeparate; |
| 174 int total_workers = WorkerServiceImpl::kMaxWorkersWhenSeparate; | 180 int total_workers = WorkerServiceImpl::kMaxWorkersWhenSeparate; |
| 175 | 181 |
| 176 std::string query = base::StringPrintf("?count=%d", max_workers_per_tab); | 182 std::string query = base::StringPrintf("?count=%d", max_workers_per_tab); |
| 177 GURL url = GetTestURL("many_shared_workers.html", query); | 183 GURL url = GetTestURL("many_shared_workers.html", query); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 IN_PROC_BROWSER_TEST_F(WorkerTest, PassMessagePortToSharedWorker) { | 291 IN_PROC_BROWSER_TEST_F(WorkerTest, PassMessagePortToSharedWorker) { |
| 286 RunTest("pass_messageport_to_sharedworker.html", ""); | 292 RunTest("pass_messageport_to_sharedworker.html", ""); |
| 287 } | 293 } |
| 288 | 294 |
| 289 IN_PROC_BROWSER_TEST_F(WorkerTest, | 295 IN_PROC_BROWSER_TEST_F(WorkerTest, |
| 290 PassMessagePortToSharedWorkerDontWaitForConnect) { | 296 PassMessagePortToSharedWorkerDontWaitForConnect) { |
| 291 RunTest("pass_messageport_to_sharedworker_dont_wait_for_connect.html", ""); | 297 RunTest("pass_messageport_to_sharedworker_dont_wait_for_connect.html", ""); |
| 292 } | 298 } |
| 293 | 299 |
| 294 } // namespace content | 300 } // namespace content |
| OLD | NEW |