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/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 FilePath(kShutdownSharedWorkerFile)); | 630 FilePath(kShutdownSharedWorkerFile)); |
631 url2 = GURL(url2.spec() + "?id=0"); | 631 url2 = GURL(url2.spec() + "?id=0"); |
632 ASSERT_TRUE(window->AppendTab(url2)); | 632 ASSERT_TRUE(window->AppendTab(url2)); |
633 | 633 |
634 std::string value = WaitUntilCookieNonEmpty(tab.get(), url, | 634 std::string value = WaitUntilCookieNonEmpty(tab.get(), url, |
635 kTestCompleteCookie, action_max_timeout_ms()); | 635 kTestCompleteCookie, action_max_timeout_ms()); |
636 ASSERT_STREQ(kTestCompleteSuccess, value.c_str()); | 636 ASSERT_STREQ(kTestCompleteSuccess, value.c_str()); |
637 ASSERT_TRUE(WaitForProcessCountToBe(3, max_workers_per_tab)); | 637 ASSERT_TRUE(WaitForProcessCountToBe(3, max_workers_per_tab)); |
638 } | 638 } |
639 | 639 |
640 TEST_F(WorkerTest, QueuedSharedWorkerStartedFromOtherTab) { | 640 // Only flaky on Mac http://crbug.com/48148 |
| 641 #if defined(OS_MACOSX) |
| 642 #define MAYBE_QueuedSharedWorkerStartedFromOtherTab \ |
| 643 FLAKY_QueuedSharedWorkerStartedFromOtherTab |
| 644 #else |
| 645 #define MAYBE_QueuedSharedWorkerStartedFromOtherTab \ |
| 646 QueuedSharedWorkerStartedFromOtherTab |
| 647 #endif |
| 648 TEST_F(WorkerTest, MAYBE_QueuedSharedWorkerStartedFromOtherTab) { |
641 // Tests to make sure that queued shared workers are started up when | 649 // Tests to make sure that queued shared workers are started up when |
642 // an instance is launched from another tab. | 650 // an instance is launched from another tab. |
643 int max_workers_per_tab = WorkerService::kMaxWorkersPerTabWhenSeparate; | 651 int max_workers_per_tab = WorkerService::kMaxWorkersPerTabWhenSeparate; |
644 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), | 652 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), |
645 FilePath(kManySharedWorkersFile)); | 653 FilePath(kManySharedWorkersFile)); |
646 url = GURL(url.spec() + StringPrintf("?count=%d", max_workers_per_tab+1)); | 654 url = GURL(url.spec() + StringPrintf("?count=%d", max_workers_per_tab+1)); |
647 | 655 |
648 scoped_refptr<TabProxy> tab(GetActiveTab()); | 656 scoped_refptr<TabProxy> tab(GetActiveTab()); |
649 ASSERT_TRUE(tab.get()); | 657 ASSERT_TRUE(tab.get()); |
650 ASSERT_TRUE(tab->NavigateToURL(url)); | 658 ASSERT_TRUE(tab->NavigateToURL(url)); |
(...skipping 10 matching lines...) Expand all Loading... |
661 | 669 |
662 std::string value = WaitUntilCookieNonEmpty(tab.get(), url, | 670 std::string value = WaitUntilCookieNonEmpty(tab.get(), url, |
663 kTestCompleteCookie, action_max_timeout_ms()); | 671 kTestCompleteCookie, action_max_timeout_ms()); |
664 ASSERT_STREQ(kTestCompleteSuccess, value.c_str()); | 672 ASSERT_STREQ(kTestCompleteSuccess, value.c_str()); |
665 ASSERT_TRUE(WaitForProcessCountToBe(2, max_workers_per_tab+1)); | 673 ASSERT_TRUE(WaitForProcessCountToBe(2, max_workers_per_tab+1)); |
666 } | 674 } |
667 | 675 |
668 TEST_F(WorkerTest, OpenDatabaseSyncInputs) { | 676 TEST_F(WorkerTest, OpenDatabaseSyncInputs) { |
669 RunWorkerStorageLayoutTest("open-database-sync-inputs.html"); | 677 RunWorkerStorageLayoutTest("open-database-sync-inputs.html"); |
670 } | 678 } |
OLD | NEW |