Skip to content

Commit

Permalink
Reland "shared worker: Add tests for Chrome extensions."
Browse files Browse the repository at this point in the history
This reverts commit 4796a2a.

Reason for revert: The test failure is a flake. I should have checked before. :(

Original change's description:
> Revert "shared worker: Add tests for Chrome extensions."
> 
> This reverts commit 62628bf.
> 
> Reason for revert: Speculative revert due to Linux ChromiumOS MSan Tests failures:
> 
> https://ci.chromium.org/buildbot/chromium.memory/Linux%20ChromiumOS%20MSan%20Tests/7363
> 
>  [ RUN      ] ExtensionWebRequestApiTest.WebRequestAuthRequired
> [14149:14149:0529/223016.256914:WARNING:user_session_manager.cc(1091)] Attempting to save user password for non enterprise user.
> ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
> ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
> ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
> ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
> ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
> [14149:14299:0529/223016.655436:WARNING:alsa_util.cc(24)] PcmOpen: default,No such file or directory
> ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
> ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
> ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
> ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
> ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
> [14149:14299:0529/223016.656150:WARNING:alsa_util.cc(24)] PcmOpen: plug:default,No such file or directory
> [14149:14149:0529/223023.245267:ERROR:textfield.cc(1754)] Not implemented reached in virtual bool views::Textfield::ShouldDoLearning()
> [14149:14372:0529/223023.626405:WARNING:embedded_test_server.cc(229)] Request not handled. Returning 404: /favicon.ico
> [14149:14149:0529/223024.849020:INFO:CONSOLE(0)] "[SUCCESS] authRequiredNonBlocking", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [14149:14149:0529/223027.955574:INFO:CONSOLE(0)] "[SUCCESS] authRequiredSyncNoAction", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [14149:14149:0529/223031.378924:INFO:CONSOLE(0)] "[SUCCESS] authRequiredSyncCancelAuth", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [14149:14149:0529/223034.498789:INFO:CONSOLE(0)] "[SUCCESS] authRequiredSyncSetAuth", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [14149:14149:0529/223216.859287:INFO:CONSOLE(0)] "[SUCCESS] authRequiredAsyncNoAction", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> BrowserTestBase received signal: Terminated. Backtrace:
>     #0 0x000000a8dfe1 in __interceptor_backtrace /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:3980:13
>     #1 0x00001350f30f in base::debug::StackTrace::StackTrace(unsigned long) ./../../base/debug/stack_trace_posix.cc:808:41
>     #2 0x000014f9f062 in content::(anonymous namespace)::DumpStackTraceSignalHandler(int) ./../../content/public/test/browser_test_base.cc:87:5
>     #3 0x000000ab5989 in SignalHandler(int) /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/msan_interceptors.cc:995:3
>     #4 0x7fe3e82dacb0 in killpg ??:?
>     #5 0x7fe3e82dacb0 in ?? ??:0
>     #6 0x7fe3e83a26d3 in epoll_wait /build/eglibc-ripdx6/eglibc-2.19/misc/../sysdeps/unix/syscall-template.S:81:0
>     #7 0x000000a770a4 in __interceptor_epoll_wait /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/msan_interceptors.cc:862:13
>     #8 0x00001704b89b in epoll_dispatch ./../../base/third_party/libevent/epoll.c:198:8
>     #9 0x00001703ec8b in event_base_loop ./../../base/third_party/libevent/event.c:512:9
>     #10 0x00001355a138 in base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) ./../../base/message_loop/message_pump_libevent.cc:247:9
>     #11 0x00001336b330 in base::RunLoop::Run() ./../../base/run_loop.cc:102:14
>     #12 0x000015058275 in content::RunThisRunLoop(base::RunLoop*) ./../../content/public/test/test_utils.cc:128:13
>     #13 0x00002b95647d in extensions::ResultCatcher::GetNextResult() ./../../extensions/test/result_catcher.cc:35:5
>     #14 0x000004dfa6f2 in extensions::ExtensionApiTest::RunExtensionTestImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*, int) ./../../chrome/browser/extensions/extension_apitest.cc:392:16
>     #15 0x0000049ace7e in extensions::ExtensionWebRequestApiTest_WebRequestAuthRequired_Test::RunTestOnMainThread() ./../../chrome/browser/extensions/api/web_request/web_request_apitest.cc:445:3
>     #16 0x000014f9e3f2 in content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() ./../../content/public/test/browser_test_base.cc:385:5
>     #17 0x00001387fbe5 in Run ./../../base/callback.h:125:12
>     #18 0x00001387fbe5 in ChromeBrowserMainParts::PreMainMessageLoopRunImpl() ./../../chrome/browser/chrome_browser_main.cc:2098:0
>     #19 0x00001387b5c0 in ChromeBrowserMainParts::PreMainMessageLoopRun() ./../../chrome/browser/chrome_browser_main.cc:1492:18
>     #20 0x000007604b81 in chromeos::ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() ./../../chrome/browser/chromeos/chrome_browser_main_chromeos.cc:684:32
>     #21 0x00000bd8f78b in content::BrowserMainLoop::PreMainMessageLoopRun() ./../../content/browser/browser_main_loop.cc:962:13
>     #22 0x00000d34ab21 in Run ./../../base/callback.h:125:12
>     #23 0x00000d34ab21 in content::StartupTaskRunner::RunAllTasksNow() ./../../content/browser/startup_task_runner.cc:44:0
>     #24 0x00000bd875e8 in content::BrowserMainLoop::CreateStartupTasks() ./../../content/browser/browser_main_loop.cc:873:25
>     #25 0x00000bd9b176 in content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) ./../../content/browser/browser_main_runner_impl.cc:148:15
>     #26 0x00000bd7c28c in content::BrowserMain(content::MainFunctionParams const&, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) ./../../content/browser/browser_main.cc:47:20
>     #27 0x000012ff6795 in content::RunBrowserProcessMain(content::MainFunctionParams const&, content::ContentMainDelegate*, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) ./../../content/app/content_main_runner_impl.cc:620:10
>     #28 0x000012ffa9aa in content::ContentMainRunnerImpl::Run() ./../../content/app/content_main_runner_impl.cc:964:12
>     #29 0x00001c607013 in service_manager::Main(service_manager::MainParams const&) ./../../services/service_manager/embedder/main.cc:459:29
>     #30 0x000012ff0d18 in content::ContentMain(content::ContentMainParams const&) ./../../content/app/content_main.cc:19:10
>     #31 0x000014f9c8c0 in content::BrowserTestBase::SetUp() ./../../content/public/test/browser_test_base.cc:323:3
>     #32 0x00001372d0cf in InProcessBrowserTest::SetUp() ./../../chrome/test/base/in_process_browser_test.cc:244:20
>     #33 0x000008b46826 in testing::Test::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
>     #34 0x000008b4a8bc in testing::TestInfo::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2667:11
>     #35 0x000008b4c34a in testing::TestCase::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2785:28
>     #36 0x000008b82a55 in testing::internal::UnitTestImpl::RunAllTests() ./../../third_party/googletest/src/googletest/src/gtest.cc:5047:43
>     #37 0x000008b81328 in testing::UnitTest::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
>     #38 0x0000137959f1 in RUN_ALL_TESTS ./../../third_party/googletest/src/googletest/include/gtest/gtest.h:2329:46
>     #39 0x0000137959f1 in base::TestSuite::Run() ./../../base/test/test_suite.cc:275:0
>     #40 0x0000131f45a4 in ChromeTestSuiteRunner::RunTestSuite(int, char**) ./../../chrome/test/base/chrome_test_launcher.cc:65:38
>     #41 0x000015048025 in content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) ./../../content/public/test/test_launcher.cc:625:31
>     #42 0x0000131f5d07 in LaunchChromeTests(unsigned long, content::TestLauncherDelegate*, int, char**) ./../../chrome/test/base/chrome_test_launcher.cc:170:10
>     #43 0x0000131f4390 in main ./../../chrome/test/base/browser_tests_main_chromeos.cc:21:10
>     #44 0x7fe3e82c5f45 in __libc_start_main /build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:287:0
>     #45 0x000000a511ba in _start ??:0:0
> [ RUN      ] ExtensionWebRequestApiTest.WebRequestAuthRequired
> [9681:9681:0529/225648.292655:WARNING:user_session_manager.cc(1091)] Attempting to save user password for non enterprise user.
> ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
> ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
> ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
> ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
> ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
> [9681:9709:0529/225648.491081:WARNING:alsa_util.cc(24)] PcmOpen: default,No such file or directory
> ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
> ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
> ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
> ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
> ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
> [9681:9709:0529/225648.491704:WARNING:alsa_util.cc(24)] PcmOpen: plug:default,No such file or directory
> [9681:9681:0529/225653.563139:ERROR:textfield.cc(1754)] Not implemented reached in virtual bool views::Textfield::ShouldDoLearning()
> [9681:9764:0529/225653.719267:WARNING:embedded_test_server.cc(229)] Request not handled. Returning 404: /favicon.ico
> [9681:9681:0529/225654.670750:INFO:CONSOLE(0)] "[SUCCESS] authRequiredNonBlocking", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [9681:9681:0529/225657.293016:INFO:CONSOLE(0)] "[SUCCESS] authRequiredSyncNoAction", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [9681:9681:0529/225700.335612:INFO:CONSOLE(0)] "[SUCCESS] authRequiredSyncCancelAuth", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [9681:9681:0529/225703.324806:INFO:CONSOLE(0)] "[SUCCESS] authRequiredSyncSetAuth", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [9681:9681:0529/225804.664156:INFO:CONSOLE(0)] "[SUCCESS] authRequiredAsyncNoAction", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [9681:9681:0529/225928.685288:INFO:CONSOLE(0)] "[SUCCESS] authRequiredAsyncCancelAuth", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> BrowserTestBase received signal: Terminated. Backtrace:
>     #0 0x000000a8dfe1 in __interceptor_backtrace /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:3980:13
>     #1 0x00001350f30f in base::debug::StackTrace::StackTrace(unsigned long) ./../../base/debug/stack_trace_posix.cc:808:41
>     #2 0x000014f9f062 in content::(anonymous namespace)::DumpStackTraceSignalHandler(int) ./../../content/public/test/browser_test_base.cc:87:5
>     #3 0x000000ab5989 in SignalHandler(int) /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/msan_interceptors.cc:995:3
>     #4 0x7f6d3333fcb0 in killpg ??:?
>     #5 0x7f6d3333fcb0 in ?? ??:0
>     #6 0x7f6d334076d3 in epoll_wait /build/eglibc-ripdx6/eglibc-2.19/misc/../sysdeps/unix/syscall-template.S:81:0
>     #7 0x000000a770a4 in __interceptor_epoll_wait /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/msan_interceptors.cc:862:13
>     #8 0x00001704b89b in epoll_dispatch ./../../base/third_party/libevent/epoll.c:198:8
>     #9 0x00001703ec8b in event_base_loop ./../../base/third_party/libevent/event.c:512:9
>     #10 0x00001355a138 in base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) ./../../base/message_loop/message_pump_libevent.cc:247:9
>     #11 0x00001336b330 in base::RunLoop::Run() ./../../base/run_loop.cc:102:14
>     #12 0x000015058275 in content::RunThisRunLoop(base::RunLoop*) ./../../content/public/test/test_utils.cc:128:13
>     #13 0x00002b95647d in extensions::ResultCatcher::GetNextResult() ./../../extensions/test/result_catcher.cc:35:5
>     #14 0x000004dfa6f2 in extensions::ExtensionApiTest::RunExtensionTestImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*, int) ./../../chrome/browser/extensions/extension_apitest.cc:392:16
>     #15 0x0000049ace7e in extensions::ExtensionWebRequestApiTest_WebRequestAuthRequired_Test::RunTestOnMainThread() ./../../chrome/browser/extensions/api/web_request/web_request_apitest.cc:445:3
>     #16 0x000014f9e3f2 in content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() ./../../content/public/test/browser_test_base.cc:385:5
>     #17 0x00001387fbe5 in Run ./../../base/callback.h:125:12
>     #18 0x00001387fbe5 in ChromeBrowserMainParts::PreMainMessageLoopRunImpl() ./../../chrome/browser/chrome_browser_main.cc:2098:0
>     #19 0x00001387b5c0 in ChromeBrowserMainParts::PreMainMessageLoopRun() ./../../chrome/browser/chrome_browser_main.cc:1492:18
>     #20 0x000007604b81 in chromeos::ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() ./../../chrome/browser/chromeos/chrome_browser_main_chromeos.cc:684:32
>     #21 0x00000bd8f78b in content::BrowserMainLoop::PreMainMessageLoopRun() ./../../content/browser/browser_main_loop.cc:962:13
>     #22 0x00000d34ab21 in Run ./../../base/callback.h:125:12
>     #23 0x00000d34ab21 in content::StartupTaskRunner::RunAllTasksNow() ./../../content/browser/startup_task_runner.cc:44:0
>     #24 0x00000bd875e8 in content::BrowserMainLoop::CreateStartupTasks() ./../../content/browser/browser_main_loop.cc:873:25
>     #25 0x00000bd9b176 in content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) ./../../content/browser/browser_main_runner_impl.cc:148:15
>     #26 0x00000bd7c28c in content::BrowserMain(content::MainFunctionParams const&, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) ./../../content/browser/browser_main.cc:47:20
>     #27 0x000012ff6795 in content::RunBrowserProcessMain(content::MainFunctionParams const&, content::ContentMainDelegate*, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) ./../../content/app/content_main_runner_impl.cc:620:10
>     #28 0x000012ffa9aa in content::ContentMainRunnerImpl::Run() ./../../content/app/content_main_runner_impl.cc:964:12
>     #29 0x00001c607013 in service_manager::Main(service_manager::MainParams const&) ./../../services/service_manager/embedder/main.cc:459:29
>     #30 0x000012ff0d18 in content::ContentMain(content::ContentMainParams const&) ./../../content/app/content_main.cc:19:10
>     #31 0x000014f9c8c0 in content::BrowserTestBase::SetUp() ./../../content/public/test/browser_test_base.cc:323:3
>     #32 0x00001372d0cf in InProcessBrowserTest::SetUp() ./../../chrome/test/base/in_process_browser_test.cc:244:20
>     #33 0x000008b46826 in testing::Test::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
>     #34 0x000008b4a8bc in testing::TestInfo::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2667:11
>     #35 0x000008b4c34a in testing::TestCase::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2785:28
>     #36 0x000008b82a55 in testing::internal::UnitTestImpl::RunAllTests() ./../../third_party/googletest/src/googletest/src/gtest.cc:5047:43
>     #37 0x000008b81328 in testing::UnitTest::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
>     #38 0x0000137959f1 in RUN_ALL_TESTS ./../../third_party/googletest/src/googletest/include/gtest/gtest.h:2329:46
>     #39 0x0000137959f1 in base::TestSuite::Run() ./../../base/test/test_suite.cc:275:0
>     #40 0x0000131f45a4 in ChromeTestSuiteRunner::RunTestSuite(int, char**) ./../../chrome/test/base/chrome_test_launcher.cc:65:38
>     #41 0x000015048025 in content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) ./../../content/public/test/test_launcher.cc:625:31
>     #42 0x0000131f5d07 in LaunchChromeTests(unsigned long, content::TestLauncherDelegate*, int, char**) ./../../chrome/test/base/chrome_test_launcher.cc:170:10
>     #43 0x0000131f4390 in main ./../../chrome/test/base/browser_tests_main_chromeos.cc:21:10
>     #44 0x7f6d3332af45 in __libc_start_main /build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:287:0
>     #45 0x000000a511ba in _start ??:0:0
> [ RUN      ] ExtensionWebRequestApiTest.WebRequestAuthRequired
> [9971:9971:0529/225953.241021:WARNING:user_session_manager.cc(1091)] Attempting to save user password for non enterprise user.
> ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
> ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
> ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
> ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
> ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
> [9971:9999:0529/225953.449328:WARNING:alsa_util.cc(24)] PcmOpen: default,No such file or directory
> ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
> ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
> ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
> ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
> ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
> [9971:9999:0529/225953.449892:WARNING:alsa_util.cc(24)] PcmOpen: plug:default,No such file or directory
> [9971:9971:0529/225958.400556:ERROR:textfield.cc(1754)] Not implemented reached in virtual bool views::Textfield::ShouldDoLearning()
> [9971:10053:0529/225958.532493:WARNING:embedded_test_server.cc(229)] Request not handled. Returning 404: /favicon.ico
> [9971:9971:0529/225959.377349:INFO:CONSOLE(0)] "[SUCCESS] authRequiredNonBlocking", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [9971:9971:0529/230002.227064:INFO:CONSOLE(0)] "[SUCCESS] authRequiredSyncNoAction", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [9971:9971:0529/230005.286414:INFO:CONSOLE(0)] "[SUCCESS] authRequiredSyncCancelAuth", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [9971:9971:0529/230008.209328:INFO:CONSOLE(0)] "[SUCCESS] authRequiredSyncSetAuth", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [9971:9971:0529/230103.646916:INFO:CONSOLE(0)] "[SUCCESS] authRequiredAsyncNoAction", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [9971:9971:0529/230224.632095:INFO:CONSOLE(0)] "[SUCCESS] authRequiredAsyncCancelAuth", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> BrowserTestBase received signal: Terminated. Backtrace:
>     #0 0x000000a8dfe1 in __interceptor_backtrace /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:3980:13
>     #1 0x00001350f30f in base::debug::StackTrace::StackTrace(unsigned long) ./../../base/debug/stack_trace_posix.cc:808:41
>     #2 0x000014f9f062 in content::(anonymous namespace)::DumpStackTraceSignalHandler(int) ./../../content/public/test/browser_test_base.cc:87:5
>     #3 0x000000ab5989 in SignalHandler(int) /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/msan_interceptors.cc:995:3
>     #4 0x7f12d1488cb0 in killpg ??:?
>     #5 0x7f12d1488cb0 in ?? ??:0
>     #6 0x7f12d15506d3 in epoll_wait /build/eglibc-ripdx6/eglibc-2.19/misc/../sysdeps/unix/syscall-template.S:81:0
>     #7 0x000000a770a4 in __interceptor_epoll_wait /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/msan_interceptors.cc:862:13
>     #8 0x00001704b89b in epoll_dispatch ./../../base/third_party/libevent/epoll.c:198:8
>     #9 0x00001703ec8b in event_base_loop ./../../base/third_party/libevent/event.c:512:9
>     #10 0x00001355a138 in base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) ./../../base/message_loop/message_pump_libevent.cc:247:9
>     #11 0x00001336b330 in base::RunLoop::Run() ./../../base/run_loop.cc:102:14
>     #12 0x000015058275 in content::RunThisRunLoop(base::RunLoop*) ./../../content/public/test/test_utils.cc:128:13
>     #13 0x00002b95647d in extensions::ResultCatcher::GetNextResult() ./../../extensions/test/result_catcher.cc:35:5
>     #14 0x000004dfa6f2 in extensions::ExtensionApiTest::RunExtensionTestImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*, int) ./../../chrome/browser/extensions/extension_apitest.cc:392:16
>     #15 0x0000049ace7e in extensions::ExtensionWebRequestApiTest_WebRequestAuthRequired_Test::RunTestOnMainThread() ./../../chrome/browser/extensions/api/web_request/web_request_apitest.cc:445:3
>     #16 0x000014f9e3f2 in content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() ./../../content/public/test/browser_test_base.cc:385:5
>     #17 0x00001387fbe5 in Run ./../../base/callback.h:125:12
>     #18 0x00001387fbe5 in ChromeBrowserMainParts::PreMainMessageLoopRunImpl() ./../../chrome/browser/chrome_browser_main.cc:2098:0
>     #19 0x00001387b5c0 in ChromeBrowserMainParts::PreMainMessageLoopRun() ./../../chrome/browser/chrome_browser_main.cc:1492:18
>     #20 0x000007604b81 in chromeos::ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() ./../../chrome/browser/chromeos/chrome_browser_main_chromeos.cc:684:32
>     #21 0x00000bd8f78b in content::BrowserMainLoop::PreMainMessageLoopRun() ./../../content/browser/browser_main_loop.cc:962:13
>     #22 0x00000d34ab21 in Run ./../../base/callback.h:125:12
>     #23 0x00000d34ab21 in content::StartupTaskRunner::RunAllTasksNow() ./../../content/browser/startup_task_runner.cc:44:0
>     #24 0x00000bd875e8 in content::BrowserMainLoop::CreateStartupTasks() ./../../content/browser/browser_main_loop.cc:873:25
>     #25 0x00000bd9b176 in content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) ./../../content/browser/browser_main_runner_impl.cc:148:15
>     #26 0x00000bd7c28c in content::BrowserMain(content::MainFunctionParams const&, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) ./../../content/browser/browser_main.cc:47:20
>     #27 0x000012ff6795 in content::RunBrowserProcessMain(content::MainFunctionParams const&, content::ContentMainDelegate*, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) ./../../content/app/content_main_runner_impl.cc:620:10
>     #28 0x000012ffa9aa in content::ContentMainRunnerImpl::Run() ./../../content/app/content_main_runner_impl.cc:964:12
>     #29 0x00001c607013 in service_manager::Main(service_manager::MainParams const&) ./../../services/service_manager/embedder/main.cc:459:29
>     #30 0x000012ff0d18 in content::ContentMain(content::ContentMainParams const&) ./../../content/app/content_main.cc:19:10
>     #31 0x000014f9c8c0 in content::BrowserTestBase::SetUp() ./../../content/public/test/browser_test_base.cc:323:3
>     #32 0x00001372d0cf in InProcessBrowserTest::SetUp() ./../../chrome/test/base/in_process_browser_test.cc:244:20
>     #33 0x000008b46826 in testing::Test::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
>     #34 0x000008b4a8bc in testing::TestInfo::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2667:11
>     #35 0x000008b4c34a in testing::TestCase::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2785:28
>     #36 0x000008b82a55 in testing::internal::UnitTestImpl::RunAllTests() ./../../third_party/googletest/src/googletest/src/gtest.cc:5047:43
>     #37 0x000008b81328 in testing::UnitTest::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
>     #38 0x0000137959f1 in RUN_ALL_TESTS ./../../third_party/googletest/src/googletest/include/gtest/gtest.h:2329:46
>     #39 0x0000137959f1 in base::TestSuite::Run() ./../../base/test/test_suite.cc:275:0
>     #40 0x0000131f45a4 in ChromeTestSuiteRunner::RunTestSuite(int, char**) ./../../chrome/test/base/chrome_test_launcher.cc:65:38
>     #41 0x000015048025 in content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) ./../../content/public/test/test_launcher.cc:625:31
>     #42 0x0000131f5d07 in LaunchChromeTests(unsigned long, content::TestLauncherDelegate*, int, char**) ./../../chrome/test/base/chrome_test_launcher.cc:170:10
>     #43 0x0000131f4390 in main ./../../chrome/test/base/browser_tests_main_chromeos.cc:21:10
>     #44 0x7f12d1473f45 in __libc_start_main /build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:287:0
>     #45 0x000000a511ba in _start ??:0:0
> [ RUN      ] ExtensionWebRequestApiTest.WebRequestAuthRequired
> [10186:10186:0529/230253.379633:WARNING:user_session_manager.cc(1091)] Attempting to save user password for non enterprise user.
> ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
> ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
> ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
> ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
> ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
> [10186:10214:0529/230253.588059:WARNING:alsa_util.cc(24)] PcmOpen: default,No such file or directory
> ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
> ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
> ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
> ALSA lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
> ALSA lib conf.c:4727:(snd_config_expand) Evaluate error: No such file or directory
> ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default
> [10186:10214:0529/230253.589228:WARNING:alsa_util.cc(24)] PcmOpen: plug:default,No such file or directory
> [10186:10186:0529/230258.651324:ERROR:textfield.cc(1754)] Not implemented reached in virtual bool views::Textfield::ShouldDoLearning()
> [10186:10267:0529/230258.790038:WARNING:embedded_test_server.cc(229)] Request not handled. Returning 404: /favicon.ico
> [10186:10186:0529/230259.634483:INFO:CONSOLE(0)] "[SUCCESS] authRequiredNonBlocking", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [10186:10186:0529/230302.223698:INFO:CONSOLE(0)] "[SUCCESS] authRequiredSyncNoAction", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [10186:10186:0529/230305.265591:INFO:CONSOLE(0)] "[SUCCESS] authRequiredSyncCancelAuth", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [10186:10186:0529/230308.238544:INFO:CONSOLE(0)] "[SUCCESS] authRequiredSyncSetAuth", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [10186:10186:0529/230402.646445:INFO:CONSOLE(0)] "[SUCCESS] authRequiredAsyncNoAction", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> [10186:10186:0529/230525.634213:INFO:CONSOLE(0)] "[SUCCESS] authRequiredAsyncCancelAuth", source: chrome-extension://chbigaineimkgiedpecafcaejhjcdebm/test_auth_required.html (0)
> BrowserTestBase received signal: Terminated. Backtrace:
>     #0 0x000000a8dfe1 in __interceptor_backtrace /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/../sanitizer_common/sanitizer_common_interceptors.inc:3980:13
>     #1 0x00001350f30f in base::debug::StackTrace::StackTrace(unsigned long) ./../../base/debug/stack_trace_posix.cc:808:41
>     #2 0x000014f9f062 in content::(anonymous namespace)::DumpStackTraceSignalHandler(int) ./../../content/public/test/browser_test_base.cc:87:5
>     #3 0x000000ab5989 in SignalHandler(int) /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/msan_interceptors.cc:995:3
>     #4 0x7f0a55d86cb0 in killpg ??:?
>     #5 0x7f0a55d86cb0 in ?? ??:0
>     #6 0x000000a6d2d4 in __msan_set_alloca_origin4 /b/build/slave/linux_upload_clang/build/src/third_party/llvm/compiler-rt/lib/msan/msan.cc:558:12
>     #7 0x00001b72c053 in std::__1::enable_if<(__is_forward_iterator<std::__1::__wrap_iter<cc::DrawImage*> >::value) && (is_constructible<cc::DrawImage, std::__1::iterator_traits<std::__1::__wrap_iter<cc::DrawImage*> >::reference>::value), std::__1::__wrap_iter<cc::DrawImage*> >::type std::__1::vector<cc::DrawImage, std::__1::allocator<cc::DrawImage> >::insert<std::__1::__wrap_iter<cc::DrawImage*> >(std::__1::__wrap_iter<cc::DrawImage const*>, std::__1::__wrap_iter<cc::DrawImage*>, std::__1::__wrap_iter<cc::DrawImage*>) ./../../buildtools/third_party/libc++/trunk/include/vector:1959:0
>     #8 0x00001b71d05d in cc::TileManager::ScheduleTasks(cc::TileManager::PrioritizedWorkToSchedule) ./../../cc/tiles/tile_manager.cc:1021:21
>     #9 0x00001b716797 in cc::TileManager::PrepareTiles(cc::GlobalStateThatImpactsTilePriority const&) ./../../cc/tiles/tile_manager.cc:520:3
>     #10 0x00001b4bb195 in cc::LayerTreeHostImpl::PrepareTiles() ./../../cc/trees/layer_tree_host_impl.cc:607:42
>     #11 0x00001b7ebfac in cc::SingleThreadProxy::ScheduledActionPrepareTiles() ./../../cc/trees/single_thread_proxy.cc:834:15
>     #12 0x00001b83107b in cc::Scheduler::ProcessScheduledActions() ./../../cc/scheduler/scheduler.cc:0:20
>     #13 0x00001b82fe9f in cc::Scheduler::OnBeginImplFrameDeadline() ./../../cc/scheduler/scheduler.cc:642:3
>     #14 0x00001322a1d2 in Run ./../../base/callback.h:96:12
>     #15 0x00001322a1d2 in base::debug::TaskAnnotator::RunTask(char const*, base::PendingTask*) ./../../base/debug/task_annotator.cc:101:0
>     #16 0x0000132ab7a5 in base::MessageLoop::RunTask(base::PendingTask*) ./../../base/message_loop/message_loop.cc:319:25
>     #17 0x0000132adb1b in DeferOrRunPendingTask ./../../base/message_loop/message_loop.cc:329:5
>     #18 0x0000132adb1b in base::MessageLoop::DoDelayedWork(base::TimeTicks*) ./../../base/message_loop/message_loop.cc:413:0
>     #19 0x000013559d67 in base::MessagePumpLibevent::Run(base::MessagePump::Delegate*) ./../../base/message_loop/message_pump_libevent.cc:220:27
>     #20 0x00001336b330 in base::RunLoop::Run() ./../../base/run_loop.cc:102:14
>     #21 0x000015058275 in content::RunThisRunLoop(base::RunLoop*) ./../../content/public/test/test_utils.cc:128:13
>     #22 0x00002b95647d in extensions::ResultCatcher::GetNextResult() ./../../extensions/test/result_catcher.cc:35:5
>     #23 0x000004dfa6f2 in extensions::ExtensionApiTest::RunExtensionTestImpl(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*, int) ./../../chrome/browser/extensions/extension_apitest.cc:392:16
>     #24 0x0000049ace7e in extensions::ExtensionWebRequestApiTest_WebRequestAuthRequired_Test::RunTestOnMainThread() ./../../chrome/browser/extensions/api/web_request/web_request_apitest.cc:445:3
>     #25 0x000014f9e3f2 in content::BrowserTestBase::ProxyRunTestOnMainThreadLoop() ./../../content/public/test/browser_test_base.cc:385:5
>     #26 0x00001387fbe5 in Run ./../../base/callback.h:125:12
>     #27 0x00001387fbe5 in ChromeBrowserMainParts::PreMainMessageLoopRunImpl() ./../../chrome/browser/chrome_browser_main.cc:2098:0
>     #28 0x00001387b5c0 in ChromeBrowserMainParts::PreMainMessageLoopRun() ./../../chrome/browser/chrome_browser_main.cc:1492:18
>     #29 0x000007604b81 in chromeos::ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() ./../../chrome/browser/chromeos/chrome_browser_main_chromeos.cc:684:32
>     #30 0x00000bd8f78b in content::BrowserMainLoop::PreMainMessageLoopRun() ./../../content/browser/browser_main_loop.cc:962:13
>     #31 0x00000d34ab21 in Run ./../../base/callback.h:125:12
>     #32 0x00000d34ab21 in content::StartupTaskRunner::RunAllTasksNow() ./../../content/browser/startup_task_runner.cc:44:0
>     #33 0x00000bd875e8 in content::BrowserMainLoop::CreateStartupTasks() ./../../content/browser/browser_main_loop.cc:873:25
>     #34 0x00000bd9b176 in content::BrowserMainRunnerImpl::Initialize(content::MainFunctionParams const&, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) ./../../content/browser/browser_main_runner_impl.cc:148:15
>     #35 0x00000bd7c28c in content::BrowserMain(content::MainFunctionParams const&, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) ./../../content/browser/browser_main.cc:47:20
>     #36 0x000012ff6795 in content::RunBrowserProcessMain(content::MainFunctionParams const&, content::ContentMainDelegate*, std::__1::unique_ptr<content::BrowserProcessSubThread, std::__1::default_delete<content::BrowserProcessSubThread> >) ./../../content/app/content_main_runner_impl.cc:620:10
>     #37 0x000012ffa9aa in content::ContentMainRunnerImpl::Run() ./../../content/app/content_main_runner_impl.cc:964:12
>     #38 0x00001c607013 in service_manager::Main(service_manager::MainParams const&) ./../../services/service_manager/embedder/main.cc:459:29
>     #39 0x000012ff0d18 in content::ContentMain(content::ContentMainParams const&) ./../../content/app/content_main.cc:19:10
>     #40 0x000014f9c8c0 in content::BrowserTestBase::SetUp() ./../../content/public/test/browser_test_base.cc:323:3
>     #41 0x00001372d0cf in InProcessBrowserTest::SetUp() ./../../chrome/test/base/in_process_browser_test.cc:244:20
>     #42 0x000008b46826 in testing::Test::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
>     #43 0x000008b4a8bc in testing::TestInfo::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2667:11
>     #44 0x000008b4c34a in testing::TestCase::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:2785:28
>     #45 0x000008b82a55 in testing::internal::UnitTestImpl::RunAllTests() ./../../third_party/googletest/src/googletest/src/gtest.cc:5047:43
>     #46 0x000008b81328 in testing::UnitTest::Run() ./../../third_party/googletest/src/googletest/src/gtest.cc:0:0
>     #47 0x0000137959f1 in RUN_ALL_TESTS ./../../third_party/googletest/src/googletest/include/gtest/gtest.h:2329:46
>     #48 0x0000137959f1 in base::TestSuite::Run() ./../../base/test/test_suite.cc:275:0
>     #49 0x0000131f45a4 in ChromeTestSuiteRunner::RunTestSuite(int, char**) ./../../chrome/test/base/chrome_test_launcher.cc:65:38
>     #50 0x000015048025 in content::LaunchTests(content::TestLauncherDelegate*, unsigned long, int, char**) ./../../content/public/test/test_launcher.cc:625:31
>     #51 0x0000131f5d07 in LaunchChromeTests(unsigned long, content::TestLauncherDelegate*, int, char**) ./../../chrome/test/base/chrome_test_launcher.cc:170:10
>     #52 0x0000131f4390 in main ./../../chrome/test/base/browser_tests_main_chromeos.cc:21:10
>     #53 0x7f0a55d71f45 in __libc_start_main /build/eglibc-ripdx6/eglibc-2.19/csu/libc-start.c:287:0
>     #54 0x000000a511ba in _start ??:0:0
> 
> 
> Original change's description:
> > shared worker: Add tests for Chrome extensions.
> > 
> > We didn't have specific test coverage for shared worker from Chrome
> > extensions, just incidental ones via the ExtensionApiTest.Debugger and
> > ExtensionApiTestWithSwitch.ExtensionDebugger.
> > 
> > Shared workers go through a very different loading path than other
> > resources, so it's useful to have tests for them especially
> > including interaction with service workers.
> > 
> > This adds tests that currently fail with NetworkService, a next
> > patch will have a fix.
> > 
> > Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
> > Change-Id: Ifa6bb3dec8bdea34c3fbefbaeab324fadcb5c929
> > Bug: 839982
> > Reviewed-on: https://chromium-review.googlesource.com/1074848
> > Commit-Queue: Matt Falkenhagen <falken@chromium.org>
> > Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#562700}
> 
> TBR=falken@chromium.org,lazyboy@chromium.org
> 
> Change-Id: I880c6e859c9414070ad4783dc9e703f4324ecf29
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 839982
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
> Reviewed-on: https://chromium-review.googlesource.com/1078367
> Reviewed-by: Thiemo Nagel <tnagel@chromium.org>
> Commit-Queue: Thiemo Nagel <tnagel@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#562766}

TBR=falken@chromium.org,lazyboy@chromium.org,tnagel@chromium.org

Change-Id: I991a94e747d633670cf7fa886c177626d553f690
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 839982
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Reviewed-on: https://chromium-review.googlesource.com/1078387
Reviewed-by: Thiemo Nagel <tnagel@chromium.org>
Commit-Queue: Thiemo Nagel <tnagel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562770}
  • Loading branch information
thiemonagel authored and Commit Bot committed May 30, 2018
1 parent 5dccd78 commit 610eddf
Show file tree
Hide file tree
Showing 14 changed files with 255 additions and 1 deletion.
52 changes: 52 additions & 0 deletions chrome/browser/extensions/shared_worker_apitest.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/files/file_path.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/process_manager.h"
#include "extensions/test/background_page_watcher.h"
#include "extensions/test/extension_test_message_listener.h"

namespace extensions {

// This tests an extension that starts a shared worker.
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SharedWorker) {
EXPECT_TRUE(RunExtensionTest("shared_worker/basic")) << message_;
}

// This tests an extension that is controlled by a service worker and starts a
// shared worker. The requests for the shared worker scripts and the requests
// initiated by the shared worker should be seen by the service worker.
IN_PROC_BROWSER_TEST_F(ExtensionApiTest,
SharedWorker_ControlledByServiceWorker) {
// Load the extension. It will register a service worker.
ExtensionTestMessageListener listener("READY", false);
listener.set_failure_message("FAIL");
const Extension* extension = LoadExtension(
test_data_dir_.AppendASCII("shared_worker/service_worker_controlled"));
EXPECT_TRUE(listener.WaitUntilSatisfied());
EXPECT_TRUE(extension);
ProcessManager* process_manager = ProcessManager::Get(profile());
ExtensionHost* background_page =
process_manager->GetBackgroundHostForExtension(extension->id());

// Close the background page and start it again, so it is controlled
// by the service worker.
ExtensionTestMessageListener listener2("CONTROLLED", false);
listener2.set_failure_message("FAIL");
background_page->Close();
BackgroundPageWatcher(process_manager, extension).WaitForClose();
background_page = nullptr;
process_manager->WakeEventPage(extension->id(), base::DoNothing());
BackgroundPageWatcher(process_manager, extension).WaitForOpen();
EXPECT_TRUE(listener2.WaitUntilSatisfied());

// The background page should conduct the tests.
ExtensionTestMessageListener listener3("PASS", false);
listener3.set_failure_message("FAIL");
EXPECT_TRUE(listener3.WaitUntilSatisfied());
}

} // namespace extensions
3 changes: 2 additions & 1 deletion chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ test("browser_tests") {
"../browser/ui/blocked_content/tab_under_blocker_browsertest.cc",
"../browser/ui/tabs/pinned_tab_service_browsertest.cc",

#If this list is used on Android in the future, these browser / speech/*
# If this list is used on Android in the future, these browser / speech/*
# files will probably not be applicable.
"../browser/speech/extension_api/tts_extension_apitest.cc",
"../browser/speech/speech_recognition_browsertest.cc",
Expand Down Expand Up @@ -1327,6 +1327,7 @@ test("browser_tests") {
"../browser/extensions/sandboxed_pages_apitest.cc",
"../browser/extensions/service_worker_apitest.cc",
"../browser/extensions/shared_module_apitest.cc",
"../browser/extensions/shared_worker_apitest.cc",
"../browser/extensions/startup_helper_browsertest.cc",
"../browser/extensions/stubs_apitest.cc",
"../browser/extensions/subscribe_page_action_browsertest.cc",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

chrome.test.runTests([
function worker() {
const workerPort = new SharedWorker("worker.js").port;
workerPort.onmessage = (evt) => {
if (evt.data != 'hullo there!') {
chrome.test.fail();
} else {
chrome.test.succeed();
}
};
workerPort.start();
},

function workerWithImport() {
const workerPort = new SharedWorker("worker-with-import.js").port;
workerPort.onmessage = (evt) => {
if (evt.data != 'hullo there!') {
chrome.test.fail();
} else {
chrome.test.succeed();
}
};
workerPort.start();
}
]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Shared worker",
"version": "1.0",
"manifest_version": 2,
"background": {
"scripts": ["background.js"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

importScripts('worker.js');
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

self.addEventListener('connect', function(e) {
var port = e.ports[0];
port.start();
port.postMessage('hullo there!');
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!--
Copyright 2018 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<html><body>
background.html contents for testing.
<script src="background.js"></script>
</body></html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

async function setup() {
const reg = await navigator.serviceWorker.register('service_worker.js');
await navigator.serviceWorker.ready;
if (navigator.serviceWorker.controller) {
chrome.test.sendMessage('CONTROLLED');
} else {
chrome.test.sendMessage('READY');
}
}

async function getMessageFromWorker(worker) {
return new Promise(resolve => {
worker.port.onmessage = evt => {
resolve(evt.data);
}
});
}

async function getMessageFromServiceWorker() {
return new Promise(resolve => {
navigator.serviceWorker.onmessage = evt => {
resolve(evt.data);
}
});
}


async function start() {
await setup();
if (!navigator.serviceWorker.controller) {
// The browser will reload this background page so it gets controlled.
return;
}

// Start the shared worker. It should send a message about the resources it
// loaded.
const sharedWorker = new SharedWorker('shared_worker.js');
sharedWorker.port.start();
const kExpectedMessage = [
'CONNECTED',
'SCRIPT_IMPORTED',
'FETCHED'
];
const data = await getMessageFromWorker(sharedWorker);
if (data.length != kExpectedMessage.length) {
throw new Error('bad message length: ' +
`expected ${kExpectedMessage.length}, got ${data.length}`);
}
for (let i = 0; i < data.length; i++) {
if (data[i] != kExpectedMessage[i]) {
throw new Error(
`bad message: expected ${kExpectedMessage[i]}, got ${data[i]}`);
}
}

// Ask the service worker what URLs it intercepted.
navigator.serviceWorker.controller.postMessage('tell me what urls you saw');
const urls = await getMessageFromServiceWorker();
const kExpectedUrls = [
'background.html',
'background.js',
'shared_worker.js',
'shared_worker_import.js',
'data_for_fetch'
];
if (urls.length != kExpectedUrls.length) {
throw new Error(
`bad urls: expected ${kExpectedUrls.length}, got ${urls.length}`);
}
for (let i = 0; i < urls.length; i++) {
const expected = new URL(kExpectedUrls[i], self.location).toString();
if (urls[i] != expected)
throw new Error(`bad url: expected ${expected}, got ${urls[i]}`);
}

chrome.test.sendMessage('PASS');
}

start().catch(err => {
console.error(err.name + ': ' + err.message);
chrome.test.sendMessage('FAIL');
});
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FETCHED
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Shared worker",
"version": "1.0",
"manifest_version": 2,
"background": {
"page": "background.html",
"persistent": false
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

let urlsSeen = [];

self.addEventListener('fetch', e => {
urlsSeen.push(e.request.url);
});

self.addEventListener('message', e => {
e.source.postMessage(urlsSeen);
urlsSeen = [];
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

let importScriptsGreeting;
let message = [];

self.onconnect = async function(e) {
const port = e.ports[0];
port.start();
message.push('CONNECTED');

// The import scripts writes to |importScriptsGreeting|.
importScripts('shared_worker_import.js');
message.push(importScriptsGreeting);

const resp = await fetch(new URL('data_for_fetch', self.location));
const text = await resp.text();
message.push(text.trim());

port.postMessage(message);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

importScriptsGreeting = 'SCRIPT_IMPORTED';
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@
# to work with network service.
-ConditionalCacheCountingHelperBrowserTest.Count

# https://crbug.com/839982
-ExtensionApiTest.SharedWorker_ControlledByServiceWorker

# NOTE: if adding an exclusion for an existing failure (e.g. additional test for
# feature X that is already not working), please add it beside the existing
# failures. Otherwise please reach out to network-service-dev@.

0 comments on commit 610eddf

Please sign in to comment.