| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 ASSERT_EQ("chrome.tabs.create callback", result); | 648 ASSERT_EQ("chrome.tabs.create callback", result); |
| 649 EXPECT_EQ(starting_tab_count + 1, browser()->tab_strip_model()->count()); | 649 EXPECT_EQ(starting_tab_count + 1, browser()->tab_strip_model()->count()); |
| 650 | 650 |
| 651 // Check extension shutdown path. | 651 // Check extension shutdown path. |
| 652 UnloadExtension(extension->id()); | 652 UnloadExtension(extension->id()); |
| 653 EXPECT_EQ(starting_tab_count, browser()->tab_strip_model()->count()); | 653 EXPECT_EQ(starting_tab_count, browser()->tab_strip_model()->count()); |
| 654 } | 654 } |
| 655 | 655 |
| 656 // Tests that worker ref count increments while extension API function is | 656 // Tests that worker ref count increments while extension API function is |
| 657 // active. | 657 // active. |
| 658 IN_PROC_BROWSER_TEST_F(ServiceWorkerTest, WorkerRefCount) { | 658 |
| 659 // Flaky on Linux and ChromeOS, https://crbug.com/702126 |
| 660 #if defined(OS_LINUX) |
| 661 #define MAYBE_WorkerRefCount DISABLED_WorkerRefCount |
| 662 #else |
| 663 #define MAYBE_WorkerRefCount WorkerRefCount |
| 664 #endif |
| 665 IN_PROC_BROWSER_TEST_F(ServiceWorkerTest, MAYBE_WorkerRefCount) { |
| 659 // Extensions APIs from SW are only enabled on trunk. | 666 // Extensions APIs from SW are only enabled on trunk. |
| 660 ScopedCurrentChannel current_channel_override(version_info::Channel::UNKNOWN); | 667 ScopedCurrentChannel current_channel_override(version_info::Channel::UNKNOWN); |
| 661 const Extension* extension = LoadExtensionWithFlags( | 668 const Extension* extension = LoadExtensionWithFlags( |
| 662 test_data_dir_.AppendASCII("service_worker/api_worker_ref_count"), | 669 test_data_dir_.AppendASCII("service_worker/api_worker_ref_count"), |
| 663 kFlagNone); | 670 kFlagNone); |
| 664 ASSERT_TRUE(extension); | 671 ASSERT_TRUE(extension); |
| 665 ui_test_utils::NavigateToURL(browser(), | 672 ui_test_utils::NavigateToURL(browser(), |
| 666 extension->GetResourceURL("page.html")); | 673 extension->GetResourceURL("page.html")); |
| 667 content::WebContents* web_contents = | 674 content::WebContents* web_contents = |
| 668 browser()->tab_strip_model()->GetActiveWebContents(); | 675 browser()->tab_strip_model()->GetActiveWebContents(); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 message.sender_id = "1234567890"; | 870 message.sender_id = "1234567890"; |
| 864 message.raw_data = "testdata"; | 871 message.raw_data = "testdata"; |
| 865 message.decrypted = true; | 872 message.decrypted = true; |
| 866 push_service()->SetMessageCallbackForTesting(run_loop.QuitClosure()); | 873 push_service()->SetMessageCallbackForTesting(run_loop.QuitClosure()); |
| 867 push_service()->OnMessage(app_identifier.app_id(), message); | 874 push_service()->OnMessage(app_identifier.app_id(), message); |
| 868 EXPECT_TRUE(push_message_listener.WaitUntilSatisfied()); | 875 EXPECT_TRUE(push_message_listener.WaitUntilSatisfied()); |
| 869 run_loop.Run(); // Wait until the message is handled by push service. | 876 run_loop.Run(); // Wait until the message is handled by push service. |
| 870 } | 877 } |
| 871 | 878 |
| 872 } // namespace extensions | 879 } // namespace extensions |
| OLD | NEW |