Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BraveMainDelegate is not used on upstream browser tests #22021

Open
bridiver opened this issue Mar 31, 2022 · 4 comments
Open

BraveMainDelegate is not used on upstream browser tests #22021

bridiver opened this issue Mar 31, 2022 · 4 comments

Comments

@bridiver
Copy link
Contributor

[2022-03-31T06:06:24.188Z] [560929:1:0331/060620.726846:FATAL:execution_context.cc(152)] Check failed: cmd_line->HasSwitch(kBraveSessionToken).
[2022-03-31T06:06:24.188Z] #0 0x55b6bdba0fa9 base::debug::CollectStackTrace()
[2022-03-31T06:06:24.188Z] #1 0x55b6bdabf623 base::debug::StackTrace::StackTrace()
[2022-03-31T06:06:24.188Z] #2 0x55b6bdad934f logging::LogMessage::~LogMessage()
[2022-03-31T06:06:24.188Z] #3 0x55b6bdad9dfe logging::LogMessage::~LogMessage()
[2022-03-31T06:06:24.188Z] #4 0x55b6c26ed6b0 brave::BraveSessionCache::BraveSessionCache()
[2022-03-31T06:06:24.188Z] #5 0x55b6c26ed026 brave::BraveSessionCache::From()
[2022-03-31T06:06:24.188Z] #6 0x55b6c26ecf9a brave::AllowFontFamily()
[2022-03-31T06:06:24.188Z] #7 0x55b6c3316c01 blink::FontFallbackList::GetFontData()
[2022-03-31T06:06:24.188Z] #8 0x55b6c33167ce blink::FontFallbackList::FontDataAt()
[2022-03-31T06:06:24.188Z] #9 0x55b6c33161e6 blink::FontFallbackList::DeterminePrimarySimpleFontDataCore()
[2022-03-31T06:06:24.188Z] #10 0x55b6c3316185 blink::FontFallbackList::DeterminePrimarySimpleFontData()
[2022-03-31T06:06:24.188Z] #11 0x55b6c309ed4f blink::ComputedStyle::ComputedLineHeight()
[2022-03-31T06:06:24.188Z] #12 0x55b6c28e8e41 blink::TextControlInnerEditorElement::CreateInnerEditorStyle()
[2022-03-31T06:06:24.188Z] #13 0x55b6c28e8782 blink::TextControlInnerEditorElement::CustomStyleForLayoutObject()
[2022-03-31T06:06:24.188Z] #14 0x55b6c252c107 blink::Element::StyleForLayoutObject()
[2022-03-31T06:06:24.188Z] #15 0x55b6c252d605 blink::Element::RecalcOwnStyle()
[2022-03-31T06:06:24.188Z] #16 0x55b6c252ca7e blink::Element::RecalcStyle()
[2022-03-31T06:06:24.188Z] #17 0x55b6c24cd5b2 blink::ContainerNode::RecalcDescendantStyles()
[2022-03-31T06:06:24.188Z] #18 0x55b6c252d01a blink::Element::RecalcStyle()
[2022-03-31T06:06:24.188Z] #19 0x55b6c24cd5b2 blink::ContainerNode::RecalcDescendantStyles()
[2022-03-31T06:06:24.188Z] #20 0x55b6c252d104 blink::Element::RecalcStyle()
[2022-03-31T06:06:24.188Z] #21 0x55b6c24cd5b2 blink::ContainerNode::RecalcDescendantStyles()
[2022-03-31T06:06:24.188Z] #22 0x55b6c252d104 blink::Element::RecalcStyle()
[2022-03-31T06:06:24.188Z] #23 0x55b6c24cd5b2 blink::ContainerNode::RecalcDescendantStyles()
[2022-03-31T06:06:24.188Z] #24 0x55b6c252d104 blink::Element::RecalcStyle()
[2022-03-31T06:06:24.188Z] #25 0x55b6c246607a blink::StyleEngine::RecalcStyle()
[2022-03-31T06:06:24.188Z] #26 0x55b6c24670ef blink::StyleEngine::UpdateStyleAndLayoutTree()
[2022-03-31T06:06:24.188Z] #27 0x55b6c24e6c20 blink::Document::UpdateStyle()
[2022-03-31T06:06:24.188Z] #28 0x55b6c24e61c4 blink::Document::UpdateStyleAndLayoutTreeForThisDocument()
[2022-03-31T06:06:24.188Z] #29 0x55b6c24e276f blink::Document::UpdateStyleAndLayoutTree()
[2022-03-31T06:06:24.188Z] #30 0x55b6c264f2c5 blink::FrameSelection::FocusedOrActiveStateChanged()
[2022-03-31T06:06:24.188Z] #31 0x55b6c2f1da14 blink::FocusController::ActiveHasChanged()
[2022-03-31T06:06:24.188Z] #32 0x55b6c37f86ba blink::WebViewImpl::SetPageFocus()
[2022-03-31T06:06:24.188Z] #33 0x55b6bd0f0781 blink::mojom::blink::RemoteFrameStubDispatch::Accept()
[2022-03-31T06:06:24.188Z] #34 0x55b6bf0ebc4d mojo::InterfaceEndpointClient::HandleValidatedMessage()
[2022-03-31T06:06:24.188Z] #35 0x55b6bf0f3cf9 mojo::MessageDispatcher::Accept()
[2022-03-31T06:06:24.188Z] #36 0x55b6bf0ed89d mojo::InterfaceEndpointClient::HandleIncomingMessage()
[2022-03-31T06:06:24.188Z] #37 0x55b6bf3434bd IPC::(anonymous namespace)::ChannelAssociatedGroupController::AcceptOnEndpointThread()
[2022-03-31T06:06:24.188Z] #38 0x55b6bf0ef23c base::internal::Invoker<>::RunOnce()
[2022-03-31T06:06:24.188Z] #39 0x55b6bdb39509 base::TaskAnnotator::RunTaskImpl()
[2022-03-31T06:06:24.188Z] #40 0x55b6bdb5ea65 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl()
[2022-03-31T06:06:24.188Z] #41 0x55b6bdb5e10e base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()
[2022-03-31T06:06:24.188Z] #42 0x55b6bdb5f262 base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork()
[2022-03-31T06:06:24.188Z] #43 0x55b6bdaecb5b base::MessagePumpDefault::Run()
[2022-03-31T06:06:24.188Z] #44 0x55b6bdb5f80a base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run()
[2022-03-31T06:06:24.188Z] #45 0x55b6bdb1789a base::RunLoop::Run()
[2022-03-31T06:06:24.188Z] #46 0x55b6c47ecfa2 content::RendererMain()
[2022-03-31T06:06:24.188Z] #47 0x55b6bbf56448 content::RunZygote()
[2022-03-31T06:06:24.188Z] #48 0x55b6bbf56b5f content::RunOtherNamedProcessTypeMain()
[2022-03-31T06:06:24.188Z] #49 0x55b6bbf57c1c content::ContentMainRunnerImpl::Run()
[2022-03-31T06:06:24.188Z] #50 0x55b6bbf5537a content::RunContentProcess()
[2022-03-31T06:06:24.188Z] #51 0x55b6bbf5545e content::ContentMain()
[2022-03-31T06:06:24.188Z] #52 0x55b6be54f15a content::LaunchTests()
[2022-03-31T06:06:24.188Z] #53 0x55b6bda634ac LaunchChromeTests()
[2022-03-31T06:06:24.188Z] #54 0x55b6bda5e305 main
[2022-03-31T06:06:24.188Z] #55 0x7fc338a960b3 __libc_start_main
[2022-03-31T06:06:24.188Z] #56 0x55b6b701076a _start
[2022-03-31T06:06:24.188Z] Task trace:
[2022-03-31T06:06:24.188Z] #0 0x55b6bf33f9bf IPC::(anonymous namespace)::ChannelAssociatedGroupController::Accept()
[2022-03-31T06:06:24.188Z] Crash keys:
[2022-03-31T06:06:24.188Z] "top-origin" = "http://a.com:42907/"
[2022-03-31T06:06:24.188Z] "url-chunk" = "http://b.com:42907/autofill_address_form.html"
[2022-03-31T06:06:24.188Z] "extension-1" = "mnojpmjdmbbfmejpflffifhffcmidifd"
[2022-03-31T06:06:24.188Z] "num-extensions" = "1"
[2022-03-31T06:06:24.188Z] "blink_scheduler_async_stack" = "0x55B6BF33F9BF 0x0"
[2022-03-31T06:06:24.188Z] "v8_code_space_firstpage_address" = "0x55b638000000"
[2022-03-31T06:06:24.188Z] "v8_map_space_firstpage_address" = "0x16b3001c0000"
[2022-03-31T06:06:24.188Z] "v8_ro_space_firstpage_address" = "0x16b300000000"
[2022-03-31T06:06:24.188Z] "v8_isolate_address" = "0x147800d38000"
[2022-03-31T06:06:24.188Z] "variations" = "8d569531-4f54ac4d,"
[2022-03-31T06:06:24.188Z] "num-experiments" = "1"
[2022-03-31T06:06:24.188Z] "switch-17" = "--disable-features=IPH_AutofillVirtualCardSuggestion,IPH_Desktop"
[2022-03-31T06:06:24.188Z] "switch-16" = "--enable-features=TestFeatureForBrowserTest1"
[2022-03-31T06:06:24.188Z] "switch-15" = "--field-trial-handle=0,i,13807466769332821333,169291920760445014"
[2022-03-31T06:06:24.188Z] "switch-14" = "--shared-files=v8_context_snapshot_data:100"
[2022-03-31T06:06:24.188Z] "switch-13" = "--launch-time-ticks=4655428853"
[2022-03-31T06:06:24.188Z] "switch-12" = "--renderer-client-id=7"
[2022-03-31T06:06:24.188Z] "switch-11" = "--enable-main-frame-before-activation"
[2022-03-31T06:06:24.188Z] "switch-10" = "--num-raster-threads=4"
[2022-03-31T06:06:24.188Z] "switch-9" = "--lang=en-US"
[2022-03-31T06:06:24.188Z] "switch-8" = "--test-type=browser"
[2022-03-31T06:06:24.188Z] "switch-7" = "--ipc-connection-timeout=30"
[2022-03-31T06:06:24.188Z] "switch-6" = "--force-color-profile=srgb"
[2022-03-31T06:06:24.188Z] "switch-5" = "--dom-automation"
[2022-03-31T06:06:24.188Z] "switch-4" = "--origin-trial-public-key=bYUKPJoPnCxeNvu72j4EmPuK7tr1PAC7SHh8ld"
[2022-03-31T06:06:24.188Z] "switch-3" = "--display-capture-permissions-policy-allowed"
[2022-03-31T06:06:24.188Z] "switch-2" = "--disable-client-side-phishing-detection"
[2022-03-31T06:06:24.188Z] "switch-1" = "--user-data-dir=/tmp/.org.chromium.Chromium.sfsIEC/user_data"
[2022-03-31T06:06:24.188Z] "num-switches" = "20"

@bridiver
Copy link
Contributor Author

this only happens on linux upstream browser tests

pilgrim-brave added a commit to brave/brave-core that referenced this issue Mar 31, 2022
* Implement navigator.languages farbling

* add support for HTTP headers

* add support for farbling HTTP header

* add reduce language preference toggle in settings

* Implement font whitelist

* add sublabel to reduce-lang preference toggle

* rebase patches

* use anonymous namespace

* also add our AllowFontFamily method to TestFontSelector to avoid compile errors

* farble all non-whitelisted fonts without enumeration

* rename to MakePseudoRandomGeneratorForURL

* move session token management to singleton service

* move font whitelist to .cc file

* move prefs constants and code around

* pref names browsertest fix

* reduce patches (really)

* add web worker and service worker tests

* get URL differently, move DCHECK

* propogate reduce-language pref to renderers

* consolidate feature detection, add some comments

* lint

* gn_check

* gn_check

* refactor default locale lookup

* lint

* default session key to 12345 if command line switch is missing
brave/brave-browser#22021

* change 12345 -> 23456 so it doesn’t match the test default

Co-authored-by: bridiver <github@brianjohnson.cc>
@goodov
Copy link
Member

goodov commented Apr 1, 2022

This is not Linux specific, it applies to all platforms. The issue is that we launch upstream tests without BraveMainDelegate, but using upstream impl instead:
https://github.com/chromium/chromium/blob/102.0.4977.1/chrome/test/base/chrome_test_launcher.h#L43

The goal should be to run upstream tests in the same configuration as brave_browser_tests is running.

@mariospr
Copy link
Contributor

mariospr commented Apr 1, 2022

I noticed that when enabling the upstream tests, and that's why I had to adapt a bit to make sure upstream tests run with the same configuration, even if using the ChromeMainDelegate, see brave/brave-core@51f42f9

Maybe something changed recently upstream and now that approach needs updating?

@goodov
Copy link
Member

goodov commented Apr 1, 2022

I don't think it's useful to run upstream tests with chromium parts which we always replace with our parts in the real browser. The idea of upstream tests to me is that they are maintained by upstream, but we run it in our browser configuration to check for obvious errors during everyday dev process.

I think we should override ChromeMainDelegate and ChromeContentBrowserClient in a way that they will always be used everywhere. I.e. make using ChromeMainDelegate = BraveMainDelegate and similar for the other class. It's not an easy task, but we will have similar issues in future if we will continue to have separate Brave*/Chrome* instances of these base classes.

@goodov goodov changed the title session key command line switch is sometimes missing on upstream browser tests Session key command line switch is missing on upstream browser tests Apr 1, 2022
@goodov goodov changed the title Session key command line switch is missing on upstream browser tests BraveMainDelegate is not used on upstream browser tests Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants