| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
| 7 #include "chrome/app/chrome_dll_resource.h" | 7 #include "chrome/app/chrome_dll_resource.h" |
| 8 #include "chrome/browser/worker_host/worker_service.h" | 8 #include "chrome/browser/worker_host/worker_service.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/test/automation/browser_proxy.h" | 10 #include "chrome/test/automation/browser_proxy.h" |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 | 571 |
| 572 scoped_refptr<TabProxy> tab(GetActiveTab()); | 572 scoped_refptr<TabProxy> tab(GetActiveTab()); |
| 573 ASSERT_TRUE(tab.get()); | 573 ASSERT_TRUE(tab.get()); |
| 574 ASSERT_TRUE(tab->NavigateToURL(url)); | 574 ASSERT_TRUE(tab->NavigateToURL(url)); |
| 575 std::string value = WaitUntilCookieNonEmpty(tab.get(), url, | 575 std::string value = WaitUntilCookieNonEmpty(tab.get(), url, |
| 576 kTestCompleteCookie, action_max_timeout_ms()); | 576 kTestCompleteCookie, action_max_timeout_ms()); |
| 577 ASSERT_STREQ(kTestCompleteSuccess, value.c_str()); | 577 ASSERT_STREQ(kTestCompleteSuccess, value.c_str()); |
| 578 ASSERT_TRUE(WaitForProcessCountToBe(1, max_workers_per_tab)); | 578 ASSERT_TRUE(WaitForProcessCountToBe(1, max_workers_per_tab)); |
| 579 } | 579 } |
| 580 | 580 |
| 581 TEST_F(WorkerTest, MultipleTabsQueuedSharedWorker) { | 581 // Flaky, http://crbug.com/35221. |
| 582 TEST_F(WorkerTest, FLAKY_MultipleTabsQueuedSharedWorker) { |
| 582 // Tests to make sure that only one instance of queued shared workers are | 583 // Tests to make sure that only one instance of queued shared workers are |
| 583 // started up even when those instances are on multiple tabs. | 584 // started up even when those instances are on multiple tabs. |
| 584 int max_workers_per_tab = WorkerService::kMaxWorkersPerTabWhenSeparate; | 585 int max_workers_per_tab = WorkerService::kMaxWorkersPerTabWhenSeparate; |
| 585 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), | 586 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), |
| 586 FilePath(kManySharedWorkersFile)); | 587 FilePath(kManySharedWorkersFile)); |
| 587 url = GURL(url.spec() + StringPrintf("?count=%d", max_workers_per_tab+1)); | 588 url = GURL(url.spec() + StringPrintf("?count=%d", max_workers_per_tab+1)); |
| 588 | 589 |
| 589 scoped_refptr<TabProxy> tab(GetActiveTab()); | 590 scoped_refptr<TabProxy> tab(GetActiveTab()); |
| 590 ASSERT_TRUE(tab.get()); | 591 ASSERT_TRUE(tab.get()); |
| 591 ASSERT_TRUE(tab->NavigateToURL(url)); | 592 ASSERT_TRUE(tab->NavigateToURL(url)); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 GURL url2 = ui_test_utils::GetTestUrl(FilePath(kTestDir), | 633 GURL url2 = ui_test_utils::GetTestUrl(FilePath(kTestDir), |
| 633 FilePath(kSingleSharedWorkersFile)); | 634 FilePath(kSingleSharedWorkersFile)); |
| 634 url2 = GURL(url2.spec() + StringPrintf("?id=%d", max_workers_per_tab)); | 635 url2 = GURL(url2.spec() + StringPrintf("?id=%d", max_workers_per_tab)); |
| 635 ASSERT_TRUE(window->AppendTab(url2)); | 636 ASSERT_TRUE(window->AppendTab(url2)); |
| 636 | 637 |
| 637 std::string value = WaitUntilCookieNonEmpty(tab.get(), url, | 638 std::string value = WaitUntilCookieNonEmpty(tab.get(), url, |
| 638 kTestCompleteCookie, action_max_timeout_ms()); | 639 kTestCompleteCookie, action_max_timeout_ms()); |
| 639 ASSERT_STREQ(kTestCompleteSuccess, value.c_str()); | 640 ASSERT_STREQ(kTestCompleteSuccess, value.c_str()); |
| 640 ASSERT_TRUE(WaitForProcessCountToBe(2, max_workers_per_tab+1)); | 641 ASSERT_TRUE(WaitForProcessCountToBe(2, max_workers_per_tab+1)); |
| 641 } | 642 } |
| OLD | NEW |